** Run an SQL command and return the single integer result. */
| 15525 | ** Run an SQL command and return the single integer result. |
| 15526 | */ |
| 15527 | static int db_int(ShellState *p, const char *zSql){ |
| 15528 | sqlite3_stmt *pStmt; |
| 15529 | int res = 0; |
| 15530 | sqlite3_prepare_v2(p->db, zSql, -1, &pStmt, 0); |
| 15531 | if( pStmt && sqlite3_step(pStmt)==SQLITE_ROW ){ |
| 15532 | res = sqlite3_column_int(pStmt,0); |
| 15533 | } |
| 15534 | sqlite3_finalize(pStmt); |
| 15535 | return res; |
| 15536 | } |
| 15537 | |
| 15538 | /* |
| 15539 | ** Convert a 2-byte or 4-byte big-endian integer into a native integer |
no outgoing calls
no test coverage detected