]> granicus.if.org Git - pdns/commitdiff
Like many others, Charles Sprickman discovered powerdns gsqlite3 needs write access...
authorBert Hubert <bert.hubert@netherlabs.nl>
Sun, 29 May 2011 08:09:28 +0000 (08:09 +0000)
committerBert Hubert <bert.hubert@netherlabs.nl>
Sun, 29 May 2011 08:09:28 +0000 (08:09 +0000)
git-svn-id: svn://svn.powerdns.com/pdns/trunk/pdns@2202 d19b8d6e-7fed-0310-83ef-9ca221ded41b

modules/gsqlite3backend/ssqlite3.cc

index f376fc2ccc1acf5b3163f5b9c4a5201c7cf94dbe..2f32ef1c87e0878f49c39075e4feaa5aa142b9ae 100644 (file)
@@ -116,7 +116,13 @@ bool SSQLite3::getRow( row_t & row )
     m_pStmt = NULL;
     return false;
   }
-
+  
+  if(rc == SQLITE_CANTOPEN) {
+    string error ="CANTOPEN error in sqlite3, often caused by unwritable sqlite3 directory: "+string(sqlite3_errmsg(m_pDB));
+    sqlite3_finalize(m_pStmt);
+    throw sPerrorException(error);
+  }
+  
   // Something went wrong, complain.
   throw sPerrorException( "Error while retrieving SQLite query results: "+string(sqlite3_errmsg(m_pDB) ));