You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
cmd0.execute() runs a command that is empty (one space). This returns SQLITE_MISUSE as expected.
I expect cmd1.execute_all() should run "CREATE TABLE BAR(v);" and then should either break from the while loop, or run the command on " " which would return SQLITE_MISUSE. Instead it segfaults. I think the problem stems from the while loop that detects if we're done:
while (std::strlen(sql) > 0) { // sqlite3_complete() is broken.
...
sqlite3_transfer_bindings(old_stmt, stmt_); // <-- SIGSEGV here
...
sql = tail_;
}
If sqlite3_complete() really is broken and we need to write our own implementation, then perhaps we should do something more elaborate than std::strlen(sql) > 0. Maybe something like this could work:
When running
sqlite3ppp::command::execute_all()
with a command that has trailing whitespace, we get aSIGSEGV
fromsqlite3_transfer_bindings()
.Consider the following:
cmd0.execute()
runs a command that is empty (one space). This returnsSQLITE_MISUSE
as expected.I expect
cmd1.execute_all()
should run"CREATE TABLE BAR(v);"
and then should either break from the while loop, or run the command on" "
which would returnSQLITE_MISUSE
. Instead it segfaults. I think the problem stems from the while loop that detects if we're done:If
sqlite3_complete()
really is broken and we need to write our own implementation, then perhaps we should do something more elaborate thanstd::strlen(sql) > 0
. Maybe something like this could work:The text was updated successfully, but these errors were encountered: