Re: [sqlite] shell crashes when there is no column name

2014-01-15 Thread Klaas V
Clemens wrote:

  $ sqlite3
  SQLite version 3.8.3 2014-01-11 12:52:25
  Enter .help for instructions
  Enter SQL statements terminated with a ;
  sqlite .header on
  sqlite values(1);
  (null)
  1
  sqlite .mode html
  sqlite values(1);
  Segmentation fault


One runs the risk stumbling upon obscure bugs sing what seems to be a beta.
Aforementioned becomes almost certain when one uses new features.

With the official 'r.v.u b' out of the box (no special compiler options 
whatsoever):

sqlite3
SQLite version 3.8.2 2013-12-06 14:53:30
Enter .help for instructions
Enter SQL statements terminated with a ;
sqlite .he on
sqlite values(1);
Error: near values: syntax error
sqlite .mode html
sqlite values(1);
Error: near values: syntax error

  And I guess NULL should not be returned in the first place if there is no 
 error.

Since you did not provide a column name returning (null) is quite logical. What 
else? 

 

Kind regards | Cordiali saluti | Vriendelijke groeten | Freundlliche Grüße,
Klaas `Z4us` V, CIO  freelance software engineer
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] shell crashes when there is no column name

2014-01-15 Thread Clemens Ladisch
Klaas V wrote:
 Clemens wrote:
  $ sqlite3
  SQLite version 3.8.3 2014-01-11 12:52:25
  Enter .help for instructions
  Enter SQL statements terminated with a ;
  sqlite .header on
  sqlite values(1);
  (null)
  1
  sqlite .mode html
  sqlite values(1);
  Segmentation fault

 One runs the risk stumbling upon obscure bugs sing what seems to be a beta.
 Aforementioned becomes almost certain when one uses new features.

Indeed.  This is why I was playing with VALUES.

  And I guess NULL should not be returned in the first place if there is no 
 error.

 Since you did not provide a column name returning (null) is quite logical.

(null) is just what fprintf outputs for a NULL string.

And a NULL column name is considered a bug:
http://www.sqlite.org/cgi/src/info/260587d272


Regards,
Clemens
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] shell crashes when there is no column name

2014-01-15 Thread Richard Hipp
On Wed, Jan 15, 2014 at 6:48 AM, Clemens Ladisch clem...@ladisch.de wrote:


 And a NULL column name is considered a bug:
 http://www.sqlite.org/cgi/src/info/260587d272


Not so much a bug as undesirable.  Note that even with the change
referenced above, sqlite3_column_name() might still return NULL if there is
an out-of-memory error.  (This is very unlikely to happen, but it is
possible.)  So the shell has been updated to test that case too.
http://www.sqlite.org/src/info/ac15455abc

We run extension OOM testing on the core library and probably would have
caught the above problem there.  But the level of testing on the
command-line shell is much lower.  And as this problem was in the
command-line shell, not the core library, it managed to slip through.


-- 
D. Richard Hipp
d...@sqlite.org
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


[sqlite] shell crashes when there is no column name

2014-01-13 Thread Clemens Ladisch
Hi,

the shell does not always check the return value of sqlite3_column_name()
for being NULL:

  $ sqlite3
  SQLite version 3.8.3 2014-01-11 12:52:25
  Enter .help for instructions
  Enter SQL statements terminated with a ;
  sqlite .header on
  sqlite values(1);
  (null)
  1
  sqlite .mode html
  sqlite values(1);
  Segmentation fault


And I guess NULL should not be returned in the first place if there is
no error.


Regards,
Clemens
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users