From owner-freebsd-hackers@FreeBSD.ORG Mon May 14 21:51:30 2007 Return-Path: X-Original-To: freebsd-hackers@freebsd.org Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id F39D416A402 for ; Mon, 14 May 2007 21:51:29 +0000 (UTC) (envelope-from rick@kiwi-computer.com) Received: from kiwi-computer.com (keira.kiwi-computer.com [63.224.10.3]) by mx1.freebsd.org (Postfix) with SMTP id 81BBD13C44B for ; Mon, 14 May 2007 21:51:29 +0000 (UTC) (envelope-from rick@kiwi-computer.com) Received: (qmail 85654 invoked by uid 2001); 14 May 2007 21:52:47 -0000 Date: Mon, 14 May 2007 16:52:47 -0500 From: "Rick C. Petty" To: 'Michel Talon' Message-ID: <20070514215247.GA79797@keira.kiwi-computer.com> References: <20070514082512.GA25544@lpthe.jussieu.fr> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20070514082512.GA25544@lpthe.jussieu.fr> User-Agent: Mutt/1.4.2.1i Cc: freebsd-hackers@freebsd.org Subject: Re: DPS Initial Ideas X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: rick-freebsd@kiwi-computer.com List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 May 2007 21:51:30 -0000 On Mon, May 14, 2007 at 10:25:12AM +0200, 'Michel Talon' wrote: > > niobe% sqlite3 index.db > sqlite> CREATE TABLE index6 ( > pkgname varchar(1), > path varchar(1), > prefix varchar(1), > comment varchar(1), > descr varchar(1), > maintainer varchar(1), > categories varchar(1), > build_deps varchar(1), > run_deps varchar(1), > website varchar(1), > extract_deps varchar(1), > patch_deps varchar(1), > fetch_deps varchar(1)); > sqlite> .import INDEX-6 index6 > ... completes in less than 2 seconds > sqlite> select * from index6 where path = "/usr/ports/accessibility/atk"; > atk-1.12.4|/usr/ports/accessibility/atk|/usr/local|A GNOME accessibility > toolkit > (ATK)|/usr/ports/accessibility/atk/pkg-descr|gnome@FreeBSD.org|accessibility > devel|gettext-0.14.5_2 glib-2.12.9 libiconv-1.9.2_2 libtool-1.5.22_3 > perl-5.8.8 pkg-config-0.21|gettext-0.14.5_2 glib-2.12.9 libiconv-1.9.2_2 > perl-5.8.8 > pkg-config-0.21|http://developer.gnome.org/projects/gap/||libtool-1.5.22_3| What this shows me is that sqlite doesn't follow SQL92 standards. According to the section 6.1 of the standard[1]: Syntax rule #1 states "VARCHAR is equivalent to CHARACTER VARYING." Syntax rule #9b states "If VARYING is specified in , then the length in characters of the character string is variable, with a minimum length of 0 and a maximum length of the value of ." So your example should have failed to work correctly. You should have used something more appropriate, like VARCHAR(255) instead of VARCHAR(1). If SQLite isn't even standards-compliant, why is anyone considering it? =) Nitpicky, I know, but it makes me wonder what else they don't follow... -- Rick C. Petty [1] http://www.contrib.andrew.cmu.edu/~shadow/sql/sql1992.txt