Commit 4d676a35 authored by Robert Lyon's avatar Robert Lyon

Bug 1483077: escaping names when showing table / index

behatnotneeded

Change-Id: Id5b2a01d1ac240cdb271bfc952c41691a4bc4287
Signed-off-by: Robert Lyon's avatarRobert Lyon <robertl@catalyst.net.nz>
parent e744d682
...@@ -167,8 +167,8 @@ class ADODB_mysql extends ADOConnection { ...@@ -167,8 +167,8 @@ class ADODB_mysql extends ADOConnection {
} }
// get index details // get index details
$rs = $this->Execute(sprintf('SHOW INDEX FROM "%s"',$table)); $rs = $this->Execute(sprintf('SHOW INDEX FROM `%s`',$table));
// restore fetchmode // restore fetchmode
if (isset($savem)) { if (isset($savem)) {
$this->SetFetchMode($savem); $this->SetFetchMode($savem);
...@@ -639,7 +639,7 @@ class ADODB_mysql extends ADOConnection { ...@@ -639,7 +639,7 @@ class ADODB_mysql extends ADOConnection {
if ( !empty($owner) ) { if ( !empty($owner) ) {
$table = "$owner.$table"; $table = "$owner.$table";
} }
$a_create_table = $this->getRow(sprintf('SHOW CREATE TABLE %s', $table)); $a_create_table = $this->getRow(sprintf('SHOW CREATE TABLE `%s`', $table));
if ($associative) { if ($associative) {
$create_sql = isset($a_create_table["Create Table"]) ? $a_create_table["Create Table"] : $a_create_table["Create View"]; $create_sql = isset($a_create_table["Create Table"]) ? $a_create_table["Create Table"] : $a_create_table["Create View"];
} else $create_sql = $a_create_table[1]; } else $create_sql = $a_create_table[1];
...@@ -872,4 +872,4 @@ class ADORecordSet_ext_mysql extends ADORecordSet_mysql { ...@@ -872,4 +872,4 @@ class ADORecordSet_ext_mysql extends ADORecordSet_mysql {
} }
?> ?>
\ No newline at end of file
...@@ -328,7 +328,7 @@ class ADODB_mysqli extends ADOConnection { ...@@ -328,7 +328,7 @@ class ADODB_mysqli extends ADOConnection {
} }
// get index details // get index details
$rs = $this->Execute(sprintf('SHOW INDEXES FROM "%s"',$table)); $rs = $this->Execute(sprintf('SHOW INDEXES FROM `%s`',$table));
// restore fetchmode // restore fetchmode
if (isset($savem)) { if (isset($savem)) {
...@@ -557,7 +557,7 @@ class ADODB_mysqli extends ADOConnection { ...@@ -557,7 +557,7 @@ class ADODB_mysqli extends ADOConnection {
if ( !empty($owner) ) { if ( !empty($owner) ) {
$table = "$owner.$table"; $table = "$owner.$table";
} }
$a_create_table = $this->getRow(sprintf('SHOW CREATE TABLE %s', $table)); $a_create_table = $this->getRow(sprintf('SHOW CREATE TABLE `%s`', $table));
if ($associative) { if ($associative) {
$create_sql = isset($a_create_table["Create Table"]) ? $a_create_table["Create Table"] : $a_create_table["Create View"]; $create_sql = isset($a_create_table["Create Table"]) ? $a_create_table["Create Table"] : $a_create_table["Create View"];
} else $create_sql = $a_create_table[1]; } else $create_sql = $a_create_table[1];
...@@ -1266,4 +1266,4 @@ class ADORecordSet_array_mysqli extends ADORecordSet_array { ...@@ -1266,4 +1266,4 @@ class ADORecordSet_array_mysqli extends ADORecordSet_array {
} }
?> ?>
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment