gint r;
r=sqlite3_exec(db, sql, NULL, NULL, NULL);
-if (r!=SQLITE_OK)
- g_printerr("SQL ERROR:(%s) %s\n", sql, sqlite3_errmsg(db));
+if (r!=SQLITE_OK && r!=SQLITE_DONE)
+ g_printerr("SQL ERROR %d:(%s) %s\n", r, sql, sqlite3_errmsg(db));
-return (r==SQLITE_OK) ? TRUE : FALSE;
+return (r==SQLITE_OK || r==SQLITE_DONE) ? TRUE : FALSE;
}
/**
g_assert(sql);
r=sqlite3_step(sql);
-if (r!=SQLITE_OK)
- g_printerr("SQL ERROR: %s\n", sqlite3_errmsg(db));
+if (r!=SQLITE_OK && r!=SQLITE_DONE)
+ g_printerr("SQL ERROR %d: %s\n", r, sqlite3_errmsg(db));
sqlite3_reset(sql);
sqlite3_clear_bindings(sql);
-return (r==SQLITE_OK) ? TRUE : FALSE;
+return (r==SQLITE_OK || r==SQLITE_DONE) ? TRUE : FALSE;
}
/**