summaryrefslogtreecommitdiffstats
path: root/src/sql
diff options
context:
space:
mode:
authorEmmanuel BOURGERIE <manu.dwarf@gmail.com>2011-04-27 04:04:00 (GMT)
committerCharles Yin <charles.yin@nokia.com>2011-04-27 04:55:21 (GMT)
commita18f36048aa23fb088527c26274e49ce626ddf4d (patch)
tree769ed9d552386ae8af8eb53d358e68a7630d88f3 /src/sql
parente945c5009881eac49fd9b54966643a7e9d24c433 (diff)
downloadQt-a18f36048aa23fb088527c26274e49ce626ddf4d.zip
Qt-a18f36048aa23fb088527c26274e49ce626ddf4d.tar.gz
Qt-a18f36048aa23fb088527c26274e49ce626ddf4d.tar.bz2
Fixed QTBUG-11935
Change-Id: Ia7bdb0ceecf2892f6be73d1816764a2bab6275f1 Merge-request: 1010 Reviewed-by: Charles Yin <charles.yin@nokia.com>
Diffstat (limited to 'src/sql')
-rw-r--r--src/sql/drivers/mysql/qsql_mysql.cpp8
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 495b1a6..2a969ee 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 = ':schema' and table_type = 'BASE TABLE'");
+ sql.replace(QLatin1String(":schema"), QLatin1String(d->mysql->db));
+ 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 = ':schema' and table_type = 'VIEW'");
+ sql.replace(QLatin1String(":schema"), QLatin1String(d->mysql->db));
+ q.exec(sql);
while(q.next())
tl.append(q.value(0).toString());
}