Update of /cvsroot/ruby-dbi/src/ext/dbd_sqlite
In directory sc8-pr-cvs1:/tmp/cvs-serv24938
Modified Files:
SQLite.c
Log Message:
fixed bug: Prepared statement is executed twice: once with no match, once with
a match. The second case fails and segfaults.
Index: SQLite.c
===================================================================
RCS file: /cvsroot/ruby-dbi/src/ext/dbd_sqlite/SQLite.c,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- SQLite.c 14 May 2003 18:36:16 -0000 1.5
+++ SQLite.c 14 May 2003 19:52:07 -0000 1.6
@@ -475,7 +475,7 @@
/* col_info */
tables = rb_hash_new(); /* cache the table informations here */
- if (rb_iv_get(self, "@col_info") == Qnil) {
+ if (rb_iv_get(self, "@col_info") == Qnil || RARRAY(rb_iv_get(self, "@col_info"))->len == 0) {
rb_iv_set(self, "@col_info", rb_ary_new2(sm->ncolumn));
for (i=0; i<sm->ncolumn;i++) { /* only first column */
|