Date: Mon, 14 May 2007 18:06:37 -0400 From: Kris Kennaway <kris@obsecurity.org> To: "Rick C. Petty" <rick-freebsd@kiwi-computer.com> Cc: freebsd-hackers@freebsd.org, 'Michel Talon' <talon@lpthe.jussieu.fr> Subject: Re: DPS Initial Ideas Message-ID: <20070514220637.GA6849@xor.obsecurity.org> In-Reply-To: <20070514215247.GA79797@keira.kiwi-computer.com> References: <20070514082512.GA25544@lpthe.jussieu.fr> <20070514215247.GA79797@keira.kiwi-computer.com>
next in thread | previous in thread | raw e-mail | index | archive | help
On Mon, May 14, 2007 at 04:52:47PM -0500, Rick C. Petty wrote: > 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 <character string type>, 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 <length>." > > So your example should have failed to work correctly. You should have used > something more appropriate, like VARCHAR(255) instead of VARCHAR(1). Some of the fields can (and do) have unbounded length. Kris
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20070514220637.GA6849>