diff options
author | Dries Buytaert <dries@buytaert.net> | 2009-05-03 08:56:19 +0000 |
---|---|---|
committer | Dries Buytaert <dries@buytaert.net> | 2009-05-03 08:56:19 +0000 |
commit | c5926f4961506ad886e6110bc506bf72e4588bc8 (patch) | |
tree | 6efe325fc02f12a6b8e2e12612fe721ac9bbeac5 /includes/database/sqlite | |
parent | d4193f5178141a3474a08a8f2e77107a5fd5e0a0 (diff) | |
download | brdo-c5926f4961506ad886e6110bc506bf72e4588bc8.tar.gz brdo-c5926f4961506ad886e6110bc506bf72e4588bc8.tar.bz2 |
- Patch #396578 by Damien Tournoud: added db_truncate_table() to the database layer.
Diffstat (limited to 'includes/database/sqlite')
-rw-r--r-- | includes/database/sqlite/query.inc | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/includes/database/sqlite/query.inc b/includes/database/sqlite/query.inc index ab6e2da50..98fa80754 100644 --- a/includes/database/sqlite/query.inc +++ b/includes/database/sqlite/query.inc @@ -136,5 +136,17 @@ class DeleteQuery_sqlite extends DeleteQuery { } /** + * SQLite specific implementation of TruncateQuery. + * + * SQLite doesn't support TRUNCATE, but a DELETE query with no condition has + * exactly the effect (it is implemented by DROPing the table). + */ +class TruncateQuery_sqlite extends TruncateQuery { + public function __toString() { + return 'DELETE FROM {' . $this->connection->escapeTable($this->table) . '} '; + } +} + +/** * @} End of "ingroup database". */ |