On 1 Dec 2005, at 21:52, [EMAIL PROTECTED] wrote:

SQLite does has a separate BLOB type.  But for TEXT types, SQLite
still works like Perl and carries around a length so that the string
can have embedded '\000' characters.  I just added a test to the
test suite to verify that this works.

Suppose you do this:

   sqlite3_bind_text(pVm, 1, "abc\000xyz\000pq", 10, SQLITE_STATIC);

If this is part of an INSERT, say, then you will insert a 10-character
string that happens to contain a couple of extra \000 characters.

Right. So it's retreival that's the issue when this occurs, because I do:

  int col_type = sqlite3_column_type(stmt, i);

and it returns SQLITE_TEXT, so I then do:

  val = (char*)sqlite3_column_text(stmt, i);

which doesn't return a length for me.

Would sqlite3_column_bytes() return the right length there rather than me doing strlen() on the resulting data?

Matt.


______________________________________________________________________
This email has been scanned by the MessageLabs Email Security System.
For more information please visit http://www.messagelabs.com/email ______________________________________________________________________

Reply via email to