summaryrefslogtreecommitdiff
path: root/modules/gallery/libraries
diff options
context:
space:
mode:
authorTim Almdal <tnalmdal@shaw.ca>2010-02-07 13:54:37 -0800
committerTim Almdal <tnalmdal@shaw.ca>2010-02-07 13:54:37 -0800
commit7df4d795e8c5d4b100637f0fea0ad8ef7f6aeabb (patch)
tree5fdb9d2a11f712cbff82a70e4aed19c77c5370ec /modules/gallery/libraries
parent6340d8caf2261199e029841baca66e302c861679 (diff)
parentadac97b5372322be5154996974a6496198105d16 (diff)
Merge branch 'master' of git@github.com:gallery/gallery3
Diffstat (limited to 'modules/gallery/libraries')
-rw-r--r--modules/gallery/libraries/MY_Database.php9
1 files changed, 8 insertions, 1 deletions
diff --git a/modules/gallery/libraries/MY_Database.php b/modules/gallery/libraries/MY_Database.php
index e2ef68cd..cb70104a 100644
--- a/modules/gallery/libraries/MY_Database.php
+++ b/modules/gallery/libraries/MY_Database.php
@@ -54,11 +54,18 @@ abstract class Database extends Database_Core {
*/
return $sql;
} else if (strpos($sql, "CREATE TABLE") === 0) {
- // Creating a new table add it to the table cache.
+ // Creating a new table; add it to the table cache.
$open_brace = strpos($sql, "{") + 1;
$close_brace = strpos($sql, "}", $open_brace);
$name = substr($sql, $open_brace, $close_brace - $open_brace);
$this->_table_names["{{$name}}"] = "{$prefix}$name";
+ } else if (strpos($sql, "RENAME TABLE") === 0) {
+ // Renaming a table; add it to the table cache.
+ // You must use the form "TO {new_table_name}" exactly for this to work.
+ $open_brace = strpos($sql, "TO {") + 4;
+ $close_brace = strpos($sql, "}", $open_brace);
+ $name = substr($sql, $open_brace, $close_brace - $open_brace);
+ $this->_table_names["{{$name}}"] = "{$prefix}$name";
}
if (!isset($this->_table_names)) {