diff options
author | Bill King <bill.king@nokia.com> | 2009-06-15 00:28:47 (GMT) |
---|---|---|
committer | Bill King <bill.king@nokia.com> | 2009-06-15 03:09:19 (GMT) |
commit | b8430baeadd62b643ff07a2588c62141146c08fd (patch) | |
tree | dc2d7d5e0add68df3b60b67faeaa778617b76ced /src/sql/drivers/mysql/qsql_mysql.cpp | |
parent | 16fe846058aa0a89577660d18bdc0aceda7fecfd (diff) | |
download | Qt-b8430baeadd62b643ff07a2588c62141146c08fd.zip Qt-b8430baeadd62b643ff07a2588c62141146c08fd.tar.gz Qt-b8430baeadd62b643ff07a2588c62141146c08fd.tar.bz2 |
BT Revert "Fix the behaviour of sql classes regarding quoted identifiers"
This reverts commit bb7bddc47dd0748b45d22180d9e3c8e5209010b3
due to forward binary compatibility issues in a point release.
Diffstat (limited to 'src/sql/drivers/mysql/qsql_mysql.cpp')
-rw-r--r-- | src/sql/drivers/mysql/qsql_mysql.cpp | 19 |
1 files changed, 2 insertions, 17 deletions
diff --git a/src/sql/drivers/mysql/qsql_mysql.cpp b/src/sql/drivers/mysql/qsql_mysql.cpp index 53645c9..4468686 100644 --- a/src/sql/drivers/mysql/qsql_mysql.cpp +++ b/src/sql/drivers/mysql/qsql_mysql.cpp @@ -1342,7 +1342,7 @@ QSqlIndex QMYSQLDriver::primaryIndex(const QString& tablename) const QSqlQuery i(createResult()); QString stmt(QLatin1String("show index from %1;")); QSqlRecord fil = record(tablename); - i.exec(stmt.arg(tablename)); + i.exec(stmt.arg(escapeIdentifier(tablename, QSqlDriver::TableName))); while (i.isActive() && i.next()) { if (i.value(2).toString() == QLatin1String("PRIMARY")) { idx.append(fil.field(i.value(4).toString())); @@ -1357,14 +1357,10 @@ QSqlIndex QMYSQLDriver::primaryIndex(const QString& tablename) const QSqlRecord QMYSQLDriver::record(const QString& tablename) const { - QString table=tablename; - if(isIdentifierEscaped(table, QSqlDriver::TableName)) - table = stripDelimiters(table, QSqlDriver::TableName); - QSqlRecord info; if (!isOpen()) return info; - MYSQL_RES* r = mysql_list_fields(d->mysql, table.toLocal8Bit().constData(), 0); + MYSQL_RES* r = mysql_list_fields(d->mysql, tablename.toLocal8Bit().constData(), 0); if (!r) { return info; } @@ -1475,17 +1471,6 @@ QString QMYSQLDriver::escapeIdentifier(const QString &identifier, IdentifierType return res; } -bool QMYSQLDriver::isIdentifierEscapedImplementation(const QString &identifier, IdentifierType type) const -{ - Q_UNUSED(type); - bool isLeftDelimited = (identifier.left(1) == QString(QLatin1Char('`'))); - bool isRightDelimited = (identifier.right(1) == QString(QLatin1Char('`'))); - if( identifier.size() > 2 && isLeftDelimited && isRightDelimited ) - return true; - else - return false; -} - QT_END_NAMESPACE #include "qsql_mysql.moc"
\ No newline at end of file |