aboutsummaryrefslogtreecommitdiff
path: root/tool/sqldiff.c
diff options
context:
space:
mode:
Diffstat (limited to 'tool/sqldiff.c')
-rw-r--r--tool/sqldiff.c13
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++){