aboutsummaryrefslogtreecommitdiff
path: root/tool/sqldiff.c
diff options
context:
space:
mode:
authorstephan <stephan@noemail.net>2024-07-12 13:45:15 +0000
committerstephan <stephan@noemail.net>2024-07-12 13:45:15 +0000
commit74d5faec938ed149de77ce5de1e20d608806af93 (patch)
treea3adaf74f8e6c49428fc8594431b881f098aec79 /tool/sqldiff.c
parent64ef4582c2018dac671282c3432c72a998549d24 (diff)
downloadsqlite-74d5faec938ed149de77ce5de1e20d608806af93.tar.gz
sqlite-74d5faec938ed149de77ce5de1e20d608806af93.zip
sqldiff: if the first db argument does not exist, fail instead of creating an empty db. Resolving that for the second argument is trickier, as discussed in [forum:ec2d429e32 | forum post ec2d429e32].
FossilOrigin-Name: 0547ccf776c6054732437bffb8b2fe2ed5194ef817c2593f8cec4a3e2b749720
Diffstat (limited to 'tool/sqldiff.c')
-rw-r--r--tool/sqldiff.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/tool/sqldiff.c b/tool/sqldiff.c
index a213a6704..96d3b6eab 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);
}