Hello --

I'm trying to track down a segfault that happens when I'm using
DBD::SQLite for Perl, and I'm confused by the documentation for
sqlite3_column_decltype().  I think I understand what it does, but
I think there are some typos that make me uncertain:

 http://sqlite.org/capi3ref.html#sqlite3_column_decltype

 The first argument is a prepared SQL statement. If this statement is
 a SELECT statement, the Nth column of the returned result set of the
 SELECT is a table column then the declared type of the table column
 is returned. If the Nth column of the result set is not at table
 column, then a NULL pointer is returned. The returned string is UTF-8
 encoded for sqlite3_column_decltype() and UTF-16 encoded for
 sqlite3_column_decltype16(). For example, in the database schema:

     CREATE TABLE t1(c1 INTEGER);
     

 And the following statement compiled:

     SELECT c1 + 1, 0 FROM t1;
     

  Then this routine would return the string "INTEGER" for the second
  result column (i==1), and a NULL pointer for the first result column
  (i==0).

Is the first sentence supposed to be "If this statement is a SELECT
statement [and if] the Nth column..."?  And the next sentence should
be "is not [a] table column"?  And is the final paragraph correct, or
are the numbers reversed for which is NULL and which is "INTEGER"?  

I think what's happening with the Perl interface is that
sqlite3_column_decltype() returns NULL if the table is created without
an explicit type, instead of the "" or "TEXT" that I would have
expected.  Is this correct?  Or should it return something else?

Thanks!

Nathan Kurz
[EMAIL PROTECTED]

Reply via email to