summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDamien Regad <dregad@mantisbt.org>2016-09-06 10:12:40 +0200
committerDamien Regad <dregad@mantisbt.org>2016-09-06 10:24:43 +0200
commitbfb32f996ece70578ca9189dff026b19e46bb61d (patch)
treea4ec65b5f425fd4c65555c19ca08ea1f098ee342
parent0f17de1959ecebe235d2589a231c753518762da0 (diff)
downloadadodb-bfb32f996ece70578ca9189dff026b19e46bb61d.tar.gz
adodb-bfb32f996ece70578ca9189dff026b19e46bb61d.tar.bz2
adodb-bfb32f996ece70578ca9189dff026b19e46bb61d.zip
PDO/mysql: fix MetaTables broken SQL
When a schema is specified in $showSchema, the function generates an invalid where clause: WHERE TABLE_SCHEMA= from myschema ^ should be 'myschema' Fixes #275
-rw-r--r--drivers/adodb-pdo_mysql.inc.php2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/adodb-pdo_mysql.inc.php b/drivers/adodb-pdo_mysql.inc.php
index b1df4c35..8eaba8ae 100644
--- a/drivers/adodb-pdo_mysql.inc.php
+++ b/drivers/adodb-pdo_mysql.inc.php
@@ -70,7 +70,7 @@ class ADODB_pdo_mysql extends ADODB_pdo {
{
$save = $this->metaTablesSQL;
if ($showSchema && is_string($showSchema)) {
- $this->metaTablesSQL .= " from $showSchema";
+ $this->metaTablesSQL .= $this->qstr($showSchema);
} else {
$this->metaTablesSQL .= 'schema()';
}