Fossil SCM

Make sure foreign key constraints are disabled when a new database connection is created.

drh 2009-09-19 17:58 trunk
Commit fe57da72abef9d9003ac93f68699f74032fbe9bc
1 file changed +2 -1
+2 -1
--- src/db.c
+++ src/db.c
@@ -640,11 +640,11 @@
640640
zVfs
641641
);
642642
if( rc!=SQLITE_OK ){
643643
db_err(sqlite3_errmsg(db));
644644
}
645
- sqlite3_busy_timeout(db, 5000);
645
+ sqlite3_busy_timeout(db, 5000);
646646
return db;
647647
}
648648
649649
650650
/*
@@ -1143,10 +1143,11 @@
11431143
** database connection is first established.
11441144
*/
11451145
LOCAL void db_connection_init(void){
11461146
static int once = 1;
11471147
if( once ){
1148
+ sqlite3_exec(g.db, "PRAGMA foreign_keys=OFF;", 0, 0, 0);
11481149
sqlite3_create_function(g.db, "print", -1, SQLITE_UTF8, 0,db_sql_print,0,0);
11491150
sqlite3_create_function(
11501151
g.db, "file_is_selected", 1, SQLITE_UTF8, 0, file_is_selected,0,0
11511152
);
11521153
if( g.fSqlTrace ){
11531154
--- 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

Keyboard Shortcuts

Open search /
Next entry (timeline) j
Previous entry (timeline) k
Open focused entry Enter
Show this help ?
Toggle theme Top nav button