Bug #54346
opendbstore: bind text/blob columns with SQLITE_STATIC instead of SQLITE_TRANSIENT
0%
Description
use of SQLITE_TRANSIENT indicates that the given memory isn't stable over the lifetime of the operation, so requests that sqlite make a copy of this data. prefer to use SQLITE_STATIC, and find a way to guarantee that the memory doesn't go away before our call to sqlite3_reset(stmt)
for text columns, we're mostly passing in memory from std::strings stored in the DBOpParams, which should already provide this guarantee. so maybe SQL_BIND_TEXT() can use SQLITE_STATIC already
blobs will take more work, because the encoding happens inside of SQL_ENCODE_BLOB_PARAM(), and the resulting bufferlist goes away right after SQL_BIND_BLOB. if we did the encoding earlier in op, like when preparing the params, we could store the encoded bufferlist in params as well. that would allow SQL_BIND_BLOB() to use SQLITE_STATIC too