You are assuming that the column is either NULL or a SQLITE_TEXT value. This assumption is obviously violated by the real data returned by your query (which you do not show).
A second possibility would be that another thread has done something to your prepared statement between retrieving the column type and retrieving the data. -----Ursprüngliche Nachricht----- Von: sqlite-users [mailto:sqlite-users-boun...@mailinglists.sqlite.org] Im Auftrag von heribert Gesendet: Dienstag, 11. September 2018 13:59 An: SQLite mailing list <sqlite-users@mailinglists.sqlite.org> Betreff: [EXTERNAL] [sqlite] sqlite3_column_type returns NOT SQLITE_NULL and the following sqlite3_column_text returns with nullptr I've a prepared select statement (the database is in :memory: based.). After binding the input values, calling next, checking the result type of a text column, sometimes the follwing sqlite3_column_text returns with a nullptr. The stange thing is: the prior called sqlite3_column_type do not return with SQLITE_NULL. if (sqlite3_column_type(_sqlite3_stmt, Field) == SQLITE_NULL) return false; LPCSTR cp = (LPCSTR)sqlite3_column_text(_sqlite3_stmt, Field); if (cp == nullptr) { ASSERT(false); return false; } Is that correct? May it be possible that sqlite3_column_type returns NOT SQLITE_NULL and the following sqlite3_column_text returns with nullptr? Thx for any hint heribert _______________________________________________ sqlite-users mailing list sqlite-users@mailinglists.sqlite.org http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users ___________________________________________ Gunter Hick | Software Engineer | Scientific Games International GmbH | Klitschgasse 2-4, A-1130 Vienna | FN 157284 a, HG Wien, DVR: 0430013 | (O) +43 1 80100 - 0 May be privileged. May be confidential. Please delete if not the addressee. _______________________________________________ sqlite-users mailing list sqlite-users@mailinglists.sqlite.org http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users