Change SQLite3 _execute to use is_write_type()
diff --git a/system/database/drivers/sqlite3/sqlite3_driver.php b/system/database/drivers/sqlite3/sqlite3_driver.php
index 1f2d8f0..2af9738 100644
--- a/system/database/drivers/sqlite3/sqlite3_driver.php
+++ b/system/database/drivers/sqlite3/sqlite3_driver.php
@@ -139,14 +139,12 @@
*/
protected function _execute($sql)
{
- if ( ! preg_match('/^(SELECT|EXPLAIN).+$/i', ltrim($sql)))
- {
- return $this->conn_id->exec($sql);
- }
-
// TODO: Implement use of SQLite3::querySingle(), if needed
// TODO: Use $this->_prep_query(), if needed
- return $this->conn_id->query($sql);
+
+ return $this->is_write_type($sql)
+ ? $this->conn_id->exec($sql)
+ : $this->conn_id->query($sql);
}
// --------------------------------------------------------------------