Re: [Cppcms-users] Bizarre prepared statement problem
Brought to you by:
artyom-beilis
From: Artyom B. <art...@ya...> - 2012-05-23 08:19:14
|
----- Original Message ----- > From: "ele...@ex..." <ele...@ex...> > Subject: Re: [Cppcms-users] Bizarre prepared statement problem > > Read about SQLITE_STATIC vs SQLITE_TRANSIENT, interesting stuff. > > Petr > See: http://thread.gmane.org/gmane.comp.db.sqlite.general/74538 The problem that unlike in all other databases, sqlite3 requires that binded value expected to be valid during all the statement execution process. That is very different from the semantics in MySQL, PostrgreSQL and ODBC drivers. The semantics of cppdb::statement requires that binded string value be valid until query()/exec()/row() or operator result() is executed. This worked 100% for all other DB but not for sqlite3. That is why full copy semantics now applied. > Does this mean that doing a manual cppdb::statement and bind() is now > going to work with temporaries as well? > No, it may work now for sqlite3 but still may be changed in future. For example if at some point result() would contain only table with all the results and not actually call sqlite3_step() I would be able to use SQLITE_STATIC again. Also it is not promised with other DB. So do not relay on such a behavior Artyom Beilis -------------- CppCMS - C++ Web Framework: http://cppcms.com/ CppDB - C++ SQL Connectivity: http://cppcms.com/sql/cppdb/ |