summaryrefslogtreecommitdiffstats
path: root/system/database/drivers/pdo/pdo_driver.php
diff options
context:
space:
mode:
authorAndrey Andreev <narf@bofh.bg>2012-06-25 17:11:39 +0200
committerAndrey Andreev <narf@bofh.bg>2012-06-25 17:11:39 +0200
commite61b19f90e23e6b7f51e910b488a37f6f8fb7c93 (patch)
treeaa04795b1f5ef449fd89c3b8a2677cc3254e8481 /system/database/drivers/pdo/pdo_driver.php
parent01800a3787c1e045a1c9a3f39411d18e6f49011b (diff)
Add a default _truncate() method to PDO
Diffstat (limited to 'system/database/drivers/pdo/pdo_driver.php')
-rw-r--r--system/database/drivers/pdo/pdo_driver.php18
1 files changed, 18 insertions, 0 deletions
diff --git a/system/database/drivers/pdo/pdo_driver.php b/system/database/drivers/pdo/pdo_driver.php
index ab1e4ce23..3197e7506 100644
--- a/system/database/drivers/pdo/pdo_driver.php
+++ b/system/database/drivers/pdo/pdo_driver.php
@@ -400,6 +400,24 @@ class CI_DB_pdo_driver extends CI_DB {
return $sql;
}
+ // --------------------------------------------------------------------
+
+ /**
+ * Truncate statement
+ *
+ * Generates a platform-specific truncate string from the supplied data
+ *
+ * If the database does not support the truncate() command,
+ * then this method maps to 'DELETE FROM table'
+ *
+ * @param string the table name
+ * @return string
+ */
+ protected function _truncate($table)
+ {
+ return 'TRUNCATE TABLE '.$table;
+ }
+
}
/* End of file pdo_driver.php */