From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: David Pirotte Newsgroups: gmane.lisp.guile.devel Subject: Re: Problems with guile-sqlite3 Date: Fri, 1 Apr 2011 20:05:51 -0300 Message-ID: <20110401200551.2f7c4135@rascar> References: <20110401023323.32041242@rascar> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="MP_/PW8e1YxMX+6jKSEx_15pF_k" X-Trace: dough.gmane.org 1301699186 31241 80.91.229.12 (1 Apr 2011 23:06:26 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Fri, 1 Apr 2011 23:06:26 +0000 (UTC) Cc: Andy Wingo , guile-devel@gnu.org To: Detlev Zundel Original-X-From: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Sat Apr 02 01:06:22 2011 Return-path: Envelope-to: guile-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1Q5nQ3-00063f-0O for guile-devel@m.gmane.org; Sat, 02 Apr 2011 01:06:19 +0200 Original-Received: from localhost ([127.0.0.1]:33746 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Q5nPz-0003mt-PJ for guile-devel@m.gmane.org; Fri, 01 Apr 2011 19:06:15 -0400 Original-Received: from [140.186.70.92] (port=47939 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Q5nPp-0003ml-OE for guile-devel@gnu.org; Fri, 01 Apr 2011 19:06:09 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Q5nPn-0006yD-BO for guile-devel@gnu.org; Fri, 01 Apr 2011 19:06:05 -0400 Original-Received: from maximusconfessor.all2all.org ([62.58.108.13]:49957) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Q5nPn-0006y8-4a for guile-devel@gnu.org; Fri, 01 Apr 2011 19:06:03 -0400 Original-Received: from localhost (unknown [192.168.0.2]) by maximusconfessor.all2all.org (Postfix) with ESMTP id 75301A04C16E; Sat, 2 Apr 2011 01:06:02 +0200 (CEST) Original-Received: from maximusconfessor.all2all.org ([192.168.0.1]) by localhost (maximusconfessor.all2all.org [192.168.0.2]) (amavisd-new, port 10024) with ESMTP id We5nDw+afui5; Sat, 2 Apr 2011 00:49:24 +0200 (CEST) Original-Received: from rascar (unknown [189.60.162.71]) by maximusconfessor.all2all.org (Postfix) with ESMTPSA id 8C1F6A04C153; Sat, 2 Apr 2011 01:05:54 +0200 (CEST) In-Reply-To: X-Mailer: Claws Mail 3.7.8 (GTK+ 2.20.1; i486-pc-linux-gnu) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-Received-From: 62.58.108.13 X-BeenThere: guile-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Developers list for Guile, the GNU extensibility library" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Errors-To: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.lisp.guile.devel:12142 Archived-At: --MP_/PW8e1YxMX+6jKSEx_15pF_k Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Le Fri, 01 Apr 2011 11:12:03 +0200, Detlev Zundel a =C3=A9crit : > Hi David, >=20 > > Just tried guile-sqlite3 - after applying the 2 patches of Detlev - and > > succeeded with > > ... > Thanks for testing. Unfortunately currently I'm not able to reproduce > your findings - in my little test I was successful in reading records > from a small database. >=20 > Can you show me the exact calls and the database you used? Hello Detlev, Andy, I spotted where the problem comes from: it is when a text value is empty. I= have produced a small but complete example [attached]: can you reproduce it ? Thanks, David --MP_/PW8e1YxMX+6jKSEx_15pF_k Content-Type: text/x-scheme Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=empty-string.scm (define-module (empty-string) :use-module (ice-9 format) :use-module (sqlite3)) (export db create insert query-1 query-2 stmt) (define stmt #f) #! April the 1st, 2011 origin/HEAD -> origin/master origin/master Retreiving an empty string triggers an error !# ;;; ;;; Opening a test db ;;; (define db (sqlite-open "/tmp/sqlite.db" 6)) (define create "create table test ( reference integer primary key, name text, firstname text, email text );") (define insert "insert into test values (1,'BLAISE','Virginie','');") (define query-1 "select reference, name, firstname from test;") (define query-2 "select * from test;") (for-each (lambda (sql-stmt) (set! stmt (sqlite-prepare db sql-stmt)) (format #t "~S~%" (sqlite-step stmt)) (sqlite-finalize stmt)) (list create insert query-1 query-2)) ;;; ;;; Closing ;;; (sqlite-close db) --MP_/PW8e1YxMX+6jKSEx_15pF_k--