summaryrefslogtreecommitdiffstats
path: root/system/database/drivers/sqlite3
diff options
context:
space:
mode:
authorAndrey Andreev <narf@bofh.bg>2012-03-02 12:51:22 +0100
committerAndrey Andreev <narf@bofh.bg>2012-03-02 12:51:22 +0100
commita92c7cdeddd9f1b46a6c8f254b2949ad047bbc21 (patch)
tree2f7703fd696735fcc09619b05c254fcecc447002 /system/database/drivers/sqlite3
parent927e950cb9e01d02415e13a8fb13eb95ce4a31c6 (diff)
Change SQLite3 _execute to use is_write_type()
Diffstat (limited to 'system/database/drivers/sqlite3')
-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);
}
// --------------------------------------------------------------------