Project

General

Profile

Actions

Bug #54346

open

dbstore: bind text/blob columns with SQLITE_STATIC instead of SQLITE_TRANSIENT

Added by Casey Bodley about 2 years ago. Updated about 2 years ago.

Status:
New
Priority:
Normal
Assignee:
Target version:
-
% Done:

0%

Source:
Tags:
dbstore
Backport:
Regression:
No
Severity:
3 - minor
Reviewed:
Affected Versions:
ceph-qa-suite:
Pull request ID:
Crash signature (v1):
Crash signature (v2):

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

Actions #1

Updated by Soumya Koduri about 2 years ago

  • Assignee set to Soumya Koduri
Actions

Also available in: Atom PDF