summaryrefslogtreecommitdiffstats
path: root/src/sql/drivers
diff options
context:
space:
mode:
authorJørgen Lind <jorgen.lind@nokia.com>2011-05-04 10:41:39 (GMT)
committerJørgen Lind <jorgen.lind@nokia.com>2011-05-04 10:41:39 (GMT)
commit8a706b5133b1ba1d5eb5fdca97e002597d6ff829 (patch)
tree5cf57028938262d25ea1894784dd97289184241c /src/sql/drivers
parent9625c564877414695a9706acf34bc8719018ef06 (diff)
parent60e65cc23bf1df213320604062ef98e40c46d3df (diff)
downloadQt-8a706b5133b1ba1d5eb5fdca97e002597d6ff829.zip
Qt-8a706b5133b1ba1d5eb5fdca97e002597d6ff829.tar.gz
Qt-8a706b5133b1ba1d5eb5fdca97e002597d6ff829.tar.bz2
Merge remote-tracking branch 'origin/4.8' into lighthouse-master
Diffstat (limited to 'src/sql/drivers')
-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 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());
}