1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-07-30 19:03:16 +03:00

sqldiff: fail if the 2nd db argument cannot be opened read-only.

FossilOrigin-Name: e8b33525fc2b4d609a7be9acc43fbc66638effaa7b092b48568ded6c53c4f4db
This commit is contained in:
stephan
2024-07-12 14:41:16 +00:00
parent be3778dee2
commit 2e32cbc4a5
3 changed files with 14 additions and 8 deletions

View File

@ -2006,6 +2006,13 @@ int main(int argc, char **argv){
if( rc || zErrMsg ){
cmdlineError("\"%s\" does not appear to be a valid SQLite database", zDb1);
}
{
sqlite3 *db2 = 0;
if( sqlite3_open_v2(zDb2, &db2, SQLITE_OPEN_READONLY, 0) ){
cmdlineError("cannot open database file \"%s\"", zDb2);
}
sqlite3_close(db2);
}
#ifndef SQLITE_OMIT_LOAD_EXTENSION
sqlite3_enable_load_extension(g.db, 1);
for(i=0; i<nExt; i++){