diff options
author | Qt Continuous Integration System <qt-info@nokia.com> | 2011-04-28 16:09:05 (GMT) |
---|---|---|
committer | Qt Continuous Integration System <qt-info@nokia.com> | 2011-04-28 16:09:05 (GMT) |
commit | 223821eb07c1243a0bcd3741fe09516807eb1b00 (patch) | |
tree | e4c749e30f2c9762cb690573106b9af2b2886838 /src/sql | |
parent | 5159920a3bd2ab75035fd130a3b840cd856021bd (diff) | |
parent | ce4996b624678f37b13fbb7db810cccd8970a889 (diff) | |
download | Qt-223821eb07c1243a0bcd3741fe09516807eb1b00.zip Qt-223821eb07c1243a0bcd3741fe09516807eb1b00.tar.gz Qt-223821eb07c1243a0bcd3741fe09516807eb1b00.tar.bz2 |
Merge branch 4.7 into qt-4.8-from-4.7
Diffstat (limited to 'src/sql')
-rw-r--r-- | src/sql/drivers/mysql/qsql_mysql.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/sql/drivers/mysql/qsql_mysql.cpp b/src/sql/drivers/mysql/qsql_mysql.cpp index 49e7f13..4250b61 100644 --- a/src/sql/drivers/mysql/qsql_mysql.cpp +++ b/src/sql/drivers/mysql/qsql_mysql.cpp @@ -1374,12 +1374,16 @@ QStringList QMYSQLDriver::tables(QSql::TableType type) const } else { QSqlQuery q(createResult()); if(type & QSql::Tables) { - q.exec(QLatin1String("select table_name from information_schema.tables where table_type = 'BASE TABLE'")); + QString sql = QLatin1String("select table_name from information_schema.tables where table_schema = '") + QLatin1String(d->mysql->db) + QLatin1String("' and table_type = 'BASE TABLE'"); + q.exec(sql); + while(q.next()) tl.append(q.value(0).toString()); } if(type & QSql::Views) { - q.exec(QLatin1String("select table_name from information_schema.tables where table_type = 'VIEW'")); + QString sql = QLatin1String("select table_name from information_schema.tables where table_schema = '") + QLatin1String(d->mysql->db) + QLatin1String("' and table_type = 'VIEW'"); + q.exec(sql); + while(q.next()) tl.append(q.value(0).toString()); } |