summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEmmanuel BOURGERIE <manu.dwarf@gmail.com>2011-04-27 14:04:00 +1000
committerOlivier Goffart <olivier.goffart@nokia.com>2011-05-10 12:54:49 +0200
commitb1d6704b146c6ad8fd675a1cca3ab5e4e0e8b9c5 (patch)
tree7b8f7adf4dd126324dcaff217eb048bbf4e16d52
parent4a93814a1d7d09e78829fd73eba74169c1bd2200 (diff)
Change-Id: Ia7bdb0ceecf2892f6be73d1816764a2bab6275f1 Merge-request: 1010 Reviewed-by: Charles Yin <charles.yin@nokia.com> (cherry picked from commit a18f36048aa23fb088527c26274e49ce626ddf4d)
-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 49e7f138ee..37c3055ba1 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());
}