Changing TRANSIENT to STATIC in sqlite binds in action log
Change-Id: I1a425f12b89df46058b01f4563fe6ed76f09d3c3
diff --git a/src/action-log.cc b/src/action-log.cc
index 6be38ee..0bc913c 100644
--- a/src/action-log.cc
+++ b/src/action-log.cc
@@ -192,14 +192,14 @@
);
}
- sqlite3_bind_blob (stmt, 1, device_name->buf (), device_name->length (), SQLITE_TRANSIENT);
+ sqlite3_bind_blob (stmt, 1, device_name->buf (), device_name->length (), SQLITE_STATIC);
sqlite3_bind_int64 (stmt, 2, seq_no);
sqlite3_bind_int (stmt, 3, 0);
- sqlite3_bind_text (stmt, 4, filename.c_str (), filename.size (), SQLITE_TRANSIENT);
+ sqlite3_bind_text (stmt, 4, filename.c_str (), filename.size (), SQLITE_STATIC);
sqlite3_bind_int64 (stmt, 5, version);
sqlite3_bind_int64 (stmt, 6, action_time);
- sqlite3_bind_blob (stmt, 7, hash.GetHash (), hash.GetHashBytes (), SQLITE_TRANSIENT);
+ sqlite3_bind_blob (stmt, 7, hash.GetHash (), hash.GetHashBytes (), SQLITE_STATIC);
// sqlite3_bind_int64 (stmt, 8, atime); // NULL
sqlite3_bind_int64 (stmt, 9, wtime);
@@ -209,7 +209,7 @@
if (parent_device_name && parent_seq_no > 0)
{
- sqlite3_bind_blob (stmt, 13, parent_device_name->buf (), parent_device_name->length (), SQLITE_TRANSIENT);
+ sqlite3_bind_blob (stmt, 13, parent_device_name->buf (), parent_device_name->length (), SQLITE_STATIC);
sqlite3_bind_int64 (stmt, 14, parent_seq_no);
}
@@ -248,8 +248,8 @@
// _LOG_DEBUG (" >>>>>>> " << Name (namePtr->buf () << " " << namePtr->length ());
- sqlite3_bind_blob (stmt, 15, namePtr->buf (), namePtr->length (), SQLITE_TRANSIENT);
- sqlite3_bind_blob (stmt, 16, head (actionData), actionData.size (), SQLITE_TRANSIENT);
+ sqlite3_bind_blob (stmt, 15, namePtr->buf (), namePtr->length (), SQLITE_STATIC);
+ sqlite3_bind_blob (stmt, 16, head (actionData), actionData.size (), SQLITE_STATIC);
sqlite3_step (stmt);
@@ -295,7 +295,7 @@
// just in case, remove data from FileState
sqlite3_stmt *stmt;
sqlite3_prepare_v2 (m_db, "DELETE FROM FileState WHERE filename = ? ", -1, &stmt, 0);
- sqlite3_bind_text (stmt, 1, filename.c_str (), filename.size (), SQLITE_TRANSIENT); // file
+ sqlite3_bind_text (stmt, 1, filename.c_str (), filename.size (), SQLITE_STATIC); // file
sqlite3_step (stmt);
@@ -319,15 +319,15 @@
" ?, ?,"
" ?, ?)", -1, &stmt, 0);
- sqlite3_bind_blob (stmt, 1, device_name->buf (), device_name->length (), SQLITE_TRANSIENT);
+ sqlite3_bind_blob (stmt, 1, device_name->buf (), device_name->length (), SQLITE_STATIC);
sqlite3_bind_int64 (stmt, 2, seq_no);
sqlite3_bind_int (stmt, 3, 1);
- sqlite3_bind_text (stmt, 4, filename.c_str (), filename.size (), SQLITE_TRANSIENT); // file
+ sqlite3_bind_text (stmt, 4, filename.c_str (), filename.size (), SQLITE_STATIC); // file
sqlite3_bind_int64 (stmt, 5, version);
sqlite3_bind_int64 (stmt, 6, action_time);
- sqlite3_bind_blob (stmt, 7, parent_device_name->buf (), parent_device_name->length (), SQLITE_TRANSIENT);
+ sqlite3_bind_blob (stmt, 7, parent_device_name->buf (), parent_device_name->length (), SQLITE_STATIC);
sqlite3_bind_int64 (stmt, 8, parent_seq_no);
ActionItemPtr item = make_shared<ActionItem> ();
@@ -348,8 +348,8 @@
Bytes actionData = m_ccnx->createContentObject (actionName, item_msg.c_str (), item_msg.size ());
CcnxCharbufPtr namePtr = actionName.toCcnxCharbuf ();
- sqlite3_bind_blob (stmt, 9, namePtr->buf (), namePtr->length (), SQLITE_TRANSIENT);
- sqlite3_bind_blob (stmt, 10, &actionData[0], actionData.size (), SQLITE_TRANSIENT);
+ sqlite3_bind_blob (stmt, 9, namePtr->buf (), namePtr->length (), SQLITE_STATIC);
+ sqlite3_bind_blob (stmt, 10, &actionData[0], actionData.size (), SQLITE_STATIC);
sqlite3_step (stmt);
@@ -498,7 +498,7 @@
if (action->has_parent_device_name ())
{
- sqlite3_bind_blob (stmt, 13, action->parent_device_name ().c_str (), action->parent_device_name ().size (), SQLITE_TRANSIENT);
+ sqlite3_bind_blob (stmt, 13, action->parent_device_name ().c_str (), action->parent_device_name ().size (), SQLITE_STATIC);
sqlite3_bind_int64 (stmt, 14, action->parent_seq_no ());
}