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|[EMAIL PROTECTED]|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
_______________________________________________
freebsd-hackers@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to "[EMAIL PROTECTED]"

Reply via email to