diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/plugins/sqldrivers/odbc/qsql_odbc.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/plugins/sqldrivers/odbc/qsql_odbc.cpp b/src/plugins/sqldrivers/odbc/qsql_odbc.cpp index 9c4d61eb4bf..b7415123a9d 100644 --- a/src/plugins/sqldrivers/odbc/qsql_odbc.cpp +++ b/src/plugins/sqldrivers/odbc/qsql_odbc.cpp @@ -96,7 +96,6 @@ inline static QVarLengthArray<SQLTCHAR> toSQLTCHAR(const QString &input) { QVarLengthArray<SQLTCHAR> result; toSQLTCHARImpl(result, input); - result.append(0); // make sure it's null terminated, doesn't matter if it already is, it does if it isn't. return result; } @@ -2129,7 +2128,10 @@ void QODBCDriverPrivate::checkUnicode() hDbc, &hStmt); - r = SQLExecDirect(hStmt, toSQLTCHAR("select 'test'"_L1).data(), SQL_NTS); + { + auto encoded = toSQLTCHAR("select 'test'"_L1); + r = SQLExecDirect(hStmt, encoded.data(), SQLINTEGER(encoded.size())); + } if (r == SQL_SUCCESS) { r = SQLFetch(hStmt); if (r == SQL_SUCCESS) { |