summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--system/database/drivers/sqlite3/sqlite3_driver.php10
1 files changed, 4 insertions, 6 deletions
diff --git a/system/database/drivers/sqlite3/sqlite3_driver.php b/system/database/drivers/sqlite3/sqlite3_driver.php
index 1f2d8f0a0..2af973875 100644
--- a/system/database/drivers/sqlite3/sqlite3_driver.php
+++ b/system/database/drivers/sqlite3/sqlite3_driver.php
@@ -139,14 +139,12 @@ class CI_DB_sqlite3_driver extends CI_DB {
*/
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);
}
// --------------------------------------------------------------------