From: Bryan Tong Minh Date: Sat, 26 Feb 2011 14:30:52 +0000 (+0000) Subject: Add TEMPORARY TABLE support to Sqlite X-Git-Tag: 1.31.0-rc.0~31755 X-Git-Url: http://git.cyclocoop.org/%7B%24www_url%7Dadmin/compta/pie.php?a=commitdiff_plain;h=5d2794d89de9b3380ae7a55bd48cfcf75e5edf37;p=lhc%2Fweb%2Fwiklou.git Add TEMPORARY TABLE support to Sqlite --- diff --git a/includes/db/DatabaseSqlite.php b/includes/db/DatabaseSqlite.php index 60cede3cc5..b5baf21b5e 100644 --- a/includes/db/DatabaseSqlite.php +++ b/includes/db/DatabaseSqlite.php @@ -601,6 +601,12 @@ class DatabaseSqlite extends DatabaseBase { } $sql = $obj->sql; $sql = preg_replace( '/\b' . preg_quote( $oldName ) . '\b/', $newName, $sql, 1 ); + if ( $temporary && strpos( $oldName, 'searchindex' ) === false ) { + # For some reason TEMPORARY TABLE doesn't work with searchindex + # We need to explicitly look for searchindex rather than VIRTUAL + # because we don't want to clone the FTS subtables either + $sql = str_replace( 'CREATE TABLE', 'CREATE TEMPORARY TABLE', $sql ); + } return $this->query( $sql, $fname ); }