Run one statement against the database; returns the rows it changed, -1 * when it failed. */
| 9552 | /* Run one statement against the database; returns the rows it changed, -1 |
| 9553 | * when it failed. */ |
| 9554 | static int dm_exec(const char *db, const char *sql) { |
| 9555 | sqlite3 *h = NULL; |
| 9556 | int changed = -1; |
| 9557 | if (sqlite3_open_v2(db, &h, SQLITE_OPEN_READWRITE, NULL) == SQLITE_OK && |
| 9558 | sqlite3_exec(h, sql, NULL, NULL, NULL) == SQLITE_OK) { |
| 9559 | changed = sqlite3_changes(h); |
| 9560 | } |
| 9561 | sqlite3_close(h); |
| 9562 | return changed; |
| 9563 | } |
| 9564 | |
| 9565 | /* One damaged stored scope (A's row, `find` replaced by `put`): 0 when the |
| 9566 | * run that reads it fails visibly and the next one rebuilds; else the step |
no outgoing calls
no test coverage detected