summaryrefslogtreecommitdiffstats
path: root/src/sql
diff options
context:
space:
mode:
authorBill King <bill.king@nokia.com>2009-04-15 13:22:48 +1000
committerBill King <bill.king@nokia.com>2009-04-15 13:26:55 +1000
commit3eb4aacf07c77876c6ce68e9746906424934433b (patch)
treeb9536bb5134c3ad315d37caf9258c9ebcf32c970 /src/sql
parente3462ae7868c679bc88dc01de85ca39454651ff7 (diff)
Fixes an issue with FreeTDS and quoting.
Microsofts SQL Server odbc driver calls SET QUOTED_IDENTIFIER_ON, but freetds doesn't, so any quoting fails. This fixes that issue. Reviewed-by: abcd
Diffstat (limited to 'src/sql')
-rw-r--r--src/sql/drivers/odbc/qsql_odbc.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/sql/drivers/odbc/qsql_odbc.cpp b/src/sql/drivers/odbc/qsql_odbc.cpp
index 71b1b2a213..d6423ae9f3 100644
--- a/src/sql/drivers/odbc/qsql_odbc.cpp
+++ b/src/sql/drivers/odbc/qsql_odbc.cpp
@@ -55,6 +55,7 @@
#include <qvarlengtharray.h>
#include <qvector.h>
#include <QDebug>
+#include <QSqlQuery>
QT_BEGIN_NAMESPACE
@@ -1800,6 +1801,10 @@ bool QODBCDriver::open(const QString & db,
d->checkHasMultiResults();
setOpen(true);
setOpenError(false);
+ if(d->isMSSqlServer) {
+ QSqlQuery i(createResult());
+ i.exec(QLatin1String("SET QUOTED_IDENTIFIER ON"));
+ }
return true;
}