Created
July 4, 2013 02:14
-
-
Save simonwelsh/5924395 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/model/MySQLDatabase.php b/model/MySQLDatabase.php | |
index 7ec6d5b..02dc037 100644 | |
--- a/model/MySQLDatabase.php | |
+++ b/model/MySQLDatabase.php | |
@@ -801,8 +801,10 @@ class MySQLDatabase extends SS_Database { | |
* NOTE: Experimental; introduced for db-abstraction and may changed before 2.4 is released. | |
*/ | |
public function hasTable($table) { | |
- $SQL_table = Convert::raw2sql($table); | |
- return (bool)($this->query("SHOW TABLES LIKE '$SQL_table'")->value()); | |
+ if(!isset($this->tableList[strtolower($table)])) { | |
+ $this->tableList = $this->tableList(); | |
+ } | |
+ return isset($this->tableList[strtolower($table)]); | |
} | |
/** |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment