summaryrefslogtreecommitdiff
path: root/program/lib
diff options
context:
space:
mode:
authorMarc-Oliver Teschke <marcoliverteschke@mac.com>2014-04-14 17:08:01 +0200
committerMarc-Oliver Teschke <teschke@planwerk6.de>2014-04-14 17:08:01 +0200
commit78a58162d8e9c46a90c8406605f4e58bd6ca54fe (patch)
tree87b0d0f692f46a32ff01b7d566830caa3819ba54 /program/lib
parenteb0dec96134916284c5caeb57d1ad23ff67d6264 (diff)
When checking if DB schema is up-to-date, limit the checks to tables in our current schema. Otherwise installer might return false positives when DB user has access to multiple schemas.
Signed-off-by: Marc-Oliver Teschke <teschke@planwerk6.de>
Diffstat (limited to 'program/lib')
-rw-r--r--program/lib/Roundcube/rcube_db.php7
1 files changed, 4 insertions, 3 deletions
diff --git a/program/lib/Roundcube/rcube_db.php b/program/lib/Roundcube/rcube_db.php
index 2828f26ee..a2271fd6d 100644
--- a/program/lib/Roundcube/rcube_db.php
+++ b/program/lib/Roundcube/rcube_db.php
@@ -609,7 +609,8 @@ class rcube_db
{
// get tables if not cached
if ($this->tables === null) {
- $q = $this->query('SELECT TABLE_NAME FROM INFORMATION_SCHEMA.TABLES ORDER BY TABLE_NAME');
+ $q = $this->query('SELECT TABLE_NAME FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA = ? ORDER BY TABLE_NAME',
+ array($this->db_dsnw_array['database']));
if ($q) {
$this->tables = $q->fetchAll(PDO::FETCH_COLUMN, 0);
@@ -631,8 +632,8 @@ class rcube_db
*/
public function list_cols($table)
{
- $q = $this->query('SELECT COLUMN_NAME FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = ?',
- array($table));
+ $q = $this->query('SELECT COLUMN_NAME FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = ? AND TABLE_SCHEMA = ?',
+ array($table, $this->db_dsnw_array['database']));
if ($q) {
return $q->fetchAll(PDO::FETCH_COLUMN, 0);