Fossil SCM
Make sure foreign key constraints are disabled when a new database connection is created.
Commit
fe57da72abef9d9003ac93f68699f74032fbe9bc
Parent
a2749215b71b297…
1 file changed
+2
-1
M
src/db.c
+2
-1
| --- src/db.c | ||
| +++ src/db.c | ||
| @@ -640,11 +640,11 @@ | ||
| 640 | 640 | zVfs |
| 641 | 641 | ); |
| 642 | 642 | if( rc!=SQLITE_OK ){ |
| 643 | 643 | db_err(sqlite3_errmsg(db)); |
| 644 | 644 | } |
| 645 | - sqlite3_busy_timeout(db, 5000); | |
| 645 | + sqlite3_busy_timeout(db, 5000); | |
| 646 | 646 | return db; |
| 647 | 647 | } |
| 648 | 648 | |
| 649 | 649 | |
| 650 | 650 | /* |
| @@ -1143,10 +1143,11 @@ | ||
| 1143 | 1143 | ** database connection is first established. |
| 1144 | 1144 | */ |
| 1145 | 1145 | LOCAL void db_connection_init(void){ |
| 1146 | 1146 | static int once = 1; |
| 1147 | 1147 | if( once ){ |
| 1148 | + sqlite3_exec(g.db, "PRAGMA foreign_keys=OFF;", 0, 0, 0); | |
| 1148 | 1149 | sqlite3_create_function(g.db, "print", -1, SQLITE_UTF8, 0,db_sql_print,0,0); |
| 1149 | 1150 | sqlite3_create_function( |
| 1150 | 1151 | g.db, "file_is_selected", 1, SQLITE_UTF8, 0, file_is_selected,0,0 |
| 1151 | 1152 | ); |
| 1152 | 1153 | if( g.fSqlTrace ){ |
| 1153 | 1154 |
| --- src/db.c | |
| +++ src/db.c | |
| @@ -640,11 +640,11 @@ | |
| 640 | zVfs |
| 641 | ); |
| 642 | if( rc!=SQLITE_OK ){ |
| 643 | db_err(sqlite3_errmsg(db)); |
| 644 | } |
| 645 | sqlite3_busy_timeout(db, 5000); |
| 646 | return db; |
| 647 | } |
| 648 | |
| 649 | |
| 650 | /* |
| @@ -1143,10 +1143,11 @@ | |
| 1143 | ** database connection is first established. |
| 1144 | */ |
| 1145 | LOCAL void db_connection_init(void){ |
| 1146 | static int once = 1; |
| 1147 | if( once ){ |
| 1148 | sqlite3_create_function(g.db, "print", -1, SQLITE_UTF8, 0,db_sql_print,0,0); |
| 1149 | sqlite3_create_function( |
| 1150 | g.db, "file_is_selected", 1, SQLITE_UTF8, 0, file_is_selected,0,0 |
| 1151 | ); |
| 1152 | if( g.fSqlTrace ){ |
| 1153 |
| --- src/db.c | |
| +++ src/db.c | |
| @@ -640,11 +640,11 @@ | |
| 640 | zVfs |
| 641 | ); |
| 642 | if( rc!=SQLITE_OK ){ |
| 643 | db_err(sqlite3_errmsg(db)); |
| 644 | } |
| 645 | sqlite3_busy_timeout(db, 5000); |
| 646 | return db; |
| 647 | } |
| 648 | |
| 649 | |
| 650 | /* |
| @@ -1143,10 +1143,11 @@ | |
| 1143 | ** database connection is first established. |
| 1144 | */ |
| 1145 | LOCAL void db_connection_init(void){ |
| 1146 | static int once = 1; |
| 1147 | if( once ){ |
| 1148 | sqlite3_exec(g.db, "PRAGMA foreign_keys=OFF;", 0, 0, 0); |
| 1149 | sqlite3_create_function(g.db, "print", -1, SQLITE_UTF8, 0,db_sql_print,0,0); |
| 1150 | sqlite3_create_function( |
| 1151 | g.db, "file_is_selected", 1, SQLITE_UTF8, 0, file_is_selected,0,0 |
| 1152 | ); |
| 1153 | if( g.fSqlTrace ){ |
| 1154 |