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>
pull/176/head
Marc-Oliver Teschke 10 years ago committed by Marc-Oliver Teschke
parent eb0dec9613
commit 78a58162d8

@ -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);

Loading…
Cancel
Save