]> granicus.if.org Git - pdns/commitdiff
gsqlite3: Check whether foreign keys should be turned on
authorAki Tuomi <cmouse@cmouse.fi>
Fri, 8 Jul 2016 08:57:57 +0000 (11:57 +0300)
committerAki Tuomi <cmouse@cmouse.fi>
Fri, 8 Jul 2016 09:42:22 +0000 (12:42 +0300)
modules/gsqlite3backend/gsqlite3backend.cc

index 26fefb96e6e68b1c6006b6f29919ccec96c088dc..baf7872a4b6dbcd8d055719cc9099bbd3305a716 100644 (file)
@@ -50,7 +50,9 @@ gSQLite3Backend::gSQLite3Backend( const std::string & mode, const std::string &
     if(!getArg("pragma-synchronous").empty()) {
       ptr->execute("PRAGMA synchronous="+getArg("pragma-synchronous"));
     }
-    ptr->execute("PRAGMA foreign_keys = 1");
+    if (mustDo("pragma-foreign-keys")) {
+      ptr->execute("PRAGMA foreign_keys = 1");
+    }
   }  
   catch( SSqlException & e ) 
   {