From owner-freebsd-hackers@FreeBSD.ORG Mon May 14 22:06:39 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 0F3DF16A406 for ; Mon, 14 May 2007 22:06:39 +0000 (UTC) (envelope-from kris@obsecurity.org) Received: from elvis.mu.org (elvis.mu.org [192.203.228.196]) by mx1.freebsd.org (Postfix) with ESMTP id F2B3013C480 for ; Mon, 14 May 2007 22:06:38 +0000 (UTC) (envelope-from kris@obsecurity.org) Received: from obsecurity.dyndns.org (elvis.mu.org [192.203.228.196]) by elvis.mu.org (Postfix) with ESMTP id 752C61A3C19; Mon, 14 May 2007 15:07:28 -0700 (PDT) Received: by obsecurity.dyndns.org (Postfix, from userid 1000) id 0478752A38; Mon, 14 May 2007 18:06:37 -0400 (EDT) Date: Mon, 14 May 2007 18:06:37 -0400 From: Kris Kennaway To: "Rick C. Petty" Message-ID: <20070514220637.GA6849@xor.obsecurity.org> References: <20070514082512.GA25544@lpthe.jussieu.fr> <20070514215247.GA79797@keira.kiwi-computer.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20070514215247.GA79797@keira.kiwi-computer.com> User-Agent: Mutt/1.4.2.2i Cc: freebsd-hackers@freebsd.org, 'Michel Talon' Subject: Re: DPS Initial Ideas X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list 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 22:06:39 -0000 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 , 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). Some of the fields can (and do) have unbounded length. Kris