diff options
author | drh <> | 2024-07-31 23:46:10 +0000 |
---|---|---|
committer | drh <> | 2024-07-31 23:46:10 +0000 |
commit | a3ee3860a2bef9f44561093b5e39d9160840671b (patch) | |
tree | fab970cd979cde29df6ca4ddc1856fd2d6af870d /tool/sqldiff.c | |
parent | c96e47c80e67d3a21c591ccb3432f3c18153f8aa (diff) | |
parent | a1291e79d3d0c8b6aa40b455151b988a92879e17 (diff) | |
download | sqlite-a3ee3860a2bef9f44561093b5e39d9160840671b.tar.gz sqlite-a3ee3860a2bef9f44561093b5e39d9160840671b.zip |
Merge all the latest trunk enhancements into the exists-to-join branch.
FossilOrigin-Name: 9084a4c8726a2c7ba1c381886e29c7b86121d531282be0d63d5988d84f6f448d
Diffstat (limited to 'tool/sqldiff.c')
-rw-r--r-- | tool/sqldiff.c | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/tool/sqldiff.c b/tool/sqldiff.c index a213a6704..8b2293caf 100644 --- a/tool/sqldiff.c +++ b/tool/sqldiff.c @@ -31,7 +31,7 @@ ** correctly on Windows: ** ** fprintf() -> Wfprintf() -** +** */ #if defined(_WIN32) # include "console_io.h" @@ -65,7 +65,7 @@ struct GlobalVars { static void strFree(sqlite3_str *pStr){ sqlite3_free(sqlite3_str_finish(pStr)); } - + /* ** Print an error resulting from faulting command-line arguments and ** abort the program. @@ -1998,7 +1998,7 @@ int main(int argc, char **argv){ if( g.bSchemaOnly && g.bSchemaCompare ){ cmdlineError("The --schema option is useless with --table %s .", zTab); } - rc = sqlite3_open(zDb1, &g.db); + rc = sqlite3_open_v2(zDb1, &g.db, SQLITE_OPEN_READONLY, 0); if( rc ){ cmdlineError("cannot open database file \"%s\"", zDb1); } @@ -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++){ |