diff options
Diffstat (limited to 'drivers/adodb-mysqli.inc.php')
| -rw-r--r-- | drivers/adodb-mysqli.inc.php | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/drivers/adodb-mysqli.inc.php b/drivers/adodb-mysqli.inc.php index 7d5282ed..eb209de6 100644 --- a/drivers/adodb-mysqli.inc.php +++ b/drivers/adodb-mysqli.inc.php @@ -947,15 +947,27 @@ class ADODB_mysqli extends ADOConnection { $table = "$owner.$table"; } - $a_create_table = $this->getRow(sprintf('SHOW CREATE TABLE `%s`', $table)); + $a_create_table = array_change_key_case( + $this->getRow( + sprintf('SHOW CREATE TABLE `%s`', $table)), + CASE_UPPER + ); $this->setFetchMode($savem); - $create_sql = $a_create_table["Create Table"] ?? $a_create_table["Create View"]; + $create_sql = $a_create_table["CREATE TABLE"] ?? $a_create_table["CREATE VIEW"]; $matches = array(); - if (!preg_match_all("/FOREIGN KEY \(`(.*?)`\) REFERENCES `(.*?)` \(`(.*?)`\)/", $create_sql, $matches)) return false; + if (!preg_match_all( + "/FOREIGN KEY \(`(.*?)`\) REFERENCES `(.*?)` \(`(.*?)`\)/", + $create_sql, + $matches + ) + ) { + return false; + } + $foreign_keys = array(); $num_keys = count($matches[0]); for ( $i = 0; $i < $num_keys; $i ++ ) { |
