1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-11-05 04:30:38 +03:00

In the command-line shell, when running ".schema" give a sensible error when

the database file is locked.

FossilOrigin-Name: cc329eb8d65171f3f4fcb39b0e55ef85c97a77f3510cf864bbc1537f993d0074
This commit is contained in:
drh
2017-07-07 18:06:49 +00:00
parent 9b8c5f6819
commit a7a0bfab91
3 changed files with 16 additions and 10 deletions

View File

@@ -5829,8 +5829,14 @@ static int do_meta_command(char *zLine, ShellState *p){
}
if( zDiv ){
sqlite3_stmt *pStmt = 0;
sqlite3_prepare_v2(p->db, "SELECT name FROM pragma_database_list",
-1, &pStmt, 0);
rc = sqlite3_prepare_v2(p->db, "SELECT name FROM pragma_database_list",
-1, &pStmt, 0);
if( rc ){
utf8_printf(stderr, "Error: %s\n", sqlite3_errmsg(p->db));
sqlite3_finalize(pStmt);
rc = 1;
goto meta_command_exit;
}
appendText(&sSelect, "SELECT sql FROM", 0);
iSchema = 0;
while( sqlite3_step(pStmt)==SQLITE_ROW ){