Fix missing error handling for 'sqlite3_step' on 'SQLite3_result'

Error handling for 'sqlite3_step' should be performed in a similar
fashion as for 'sqlite3_exec'. Not handling these potential errors could
result in invalid empty/incomplete resultsets when reading from the
internal SQLite3 databases.
pull/4833/head
Javier Jaramago Fernández 1 year ago
parent cff7eaea69
commit b27d1a92b1

@ -764,7 +764,13 @@ void SQLite3_result::add_column_definition(int a, const char *b) {
* @return An integer representing the result of the operation (SQLITE_ROW on success).
*/
int SQLite3_result::add_row(sqlite3_stmt *stmt, bool skip) {
int rc=(*proxy_sqlite3_step)(stmt);
int rc = 0;
do {
rc = (*proxy_sqlite3_step)(stmt);
if (rc == SQLITE_BUSY || rc == SQLITE_LOCKED) {
usleep(USLEEP_SQLITE_LOCKED);
}
} while (rc == SQLITE_BUSY || rc == SQLITE_LOCKED);
if (rc!=SQLITE_ROW) return rc;
if (skip==false) {
SQLite3_row *row=new SQLite3_row(columns);

Loading…
Cancel
Save