summaryrefslogtreecommitdiffstats
path: root/src/plugins/sqldrivers
diff options
context:
space:
mode:
Diffstat (limited to 'src/plugins/sqldrivers')
-rw-r--r--src/plugins/sqldrivers/CMakeLists.txt2
-rw-r--r--src/plugins/sqldrivers/ibase/qsql_ibase.cpp2
-rw-r--r--src/plugins/sqldrivers/mysql/qsql_mysql.cpp31
-rw-r--r--src/plugins/sqldrivers/odbc/CMakeLists.txt2
-rw-r--r--src/plugins/sqldrivers/psql/CMakeLists.txt2
-rw-r--r--src/plugins/sqldrivers/qt_cmdline.cmake1
6 files changed, 18 insertions, 22 deletions
diff --git a/src/plugins/sqldrivers/CMakeLists.txt b/src/plugins/sqldrivers/CMakeLists.txt
index 91c971790b..b704e272f6 100644
--- a/src/plugins/sqldrivers/CMakeLists.txt
+++ b/src/plugins/sqldrivers/CMakeLists.txt
@@ -36,7 +36,7 @@ include(configure.cmake)
qt_feature_module_end(NO_MODULE)
-if(QT_FEATURE_sql_psql)
+if(QT_FEATURE_sql_psql AND QT_FEATURE_regularexpression)
add_subdirectory(psql)
endif()
diff --git a/src/plugins/sqldrivers/ibase/qsql_ibase.cpp b/src/plugins/sqldrivers/ibase/qsql_ibase.cpp
index 0f2cfd73bf..ba820a4416 100644
--- a/src/plugins/sqldrivers/ibase/qsql_ibase.cpp
+++ b/src/plugins/sqldrivers/ibase/qsql_ibase.cpp
@@ -798,7 +798,7 @@ bool QIBaseResultPrivate::writeArray(int column, const QList<QVariant> &list)
ba.resize(int(bufLen));
if (list.size() > arraySize) {
- error = QLatin1String("Array size missmatch: size of %1 is %2, size of provided list is %3");
+ error = QLatin1String("Array size mismatch: size of %1 is %2, size of provided list is %3");
error = error.arg(QLatin1String(sqlname)).arg(arraySize).arg(list.size());
q->setLastError(QSqlError(error, QLatin1String(""), QSqlError::StatementError));
return false;
diff --git a/src/plugins/sqldrivers/mysql/qsql_mysql.cpp b/src/plugins/sqldrivers/mysql/qsql_mysql.cpp
index 96bba79da1..caf406da46 100644
--- a/src/plugins/sqldrivers/mysql/qsql_mysql.cpp
+++ b/src/plugins/sqldrivers/mysql/qsql_mysql.cpp
@@ -1304,11 +1304,20 @@ bool QMYSQLDriver::open(const QString& db,
unixSocket.isNull() ? nullptr : unixSocket.toUtf8().constData(),
optionFlags);
+ if (mysql != d->mysql) {
+ setLastError(qMakeError(tr("Unable to connect"),
+ QSqlError::ConnectionError, d));
+ mysql_close(d->mysql);
+ d->mysql = nullptr;
+ setOpenError(true);
+ return false;
+ }
+
// now ask the server to match the charset we selected
- if (!cs || mysql_set_character_set(d->mysql, cs->csname)) {
+ if (!cs || mysql_set_character_set(d->mysql, cs->csname) != 0) {
bool ok = false;
for (const char *p : wanted_charsets) {
- if (mysql_set_character_set(d->mysql, p)) {
+ if (mysql_set_character_set(d->mysql, p) == 0) {
ok = true;
break;
}
@@ -1319,24 +1328,16 @@ bool QMYSQLDriver::open(const QString& db,
mysql_character_set_name(d->mysql));
}
- if (mysql == d->mysql) {
- if (!db.isEmpty() && mysql_select_db(d->mysql, db.toUtf8().constData())) {
- setLastError(qMakeError(tr("Unable to open database '%1'").arg(db), QSqlError::ConnectionError, d));
- mysql_close(d->mysql);
- setOpenError(true);
- return false;
- }
- if (reconnect)
- mysql_options(d->mysql, MYSQL_OPT_RECONNECT, &reconnect);
- } else {
- setLastError(qMakeError(tr("Unable to connect"),
- QSqlError::ConnectionError, d));
+ if (!db.isEmpty() && mysql_select_db(d->mysql, db.toUtf8().constData())) {
+ setLastError(qMakeError(tr("Unable to open database '%1'").arg(db), QSqlError::ConnectionError, d));
mysql_close(d->mysql);
- d->mysql = nullptr;
setOpenError(true);
return false;
}
+ if (reconnect)
+ mysql_options(d->mysql, MYSQL_OPT_RECONNECT, &reconnect);
+
d->preparedQuerysEnabled = checkPreparedQueries(d->mysql);
#if QT_CONFIG(thread)
diff --git a/src/plugins/sqldrivers/odbc/CMakeLists.txt b/src/plugins/sqldrivers/odbc/CMakeLists.txt
index 1bbae1b3ec..c521f38160 100644
--- a/src/plugins/sqldrivers/odbc/CMakeLists.txt
+++ b/src/plugins/sqldrivers/odbc/CMakeLists.txt
@@ -32,5 +32,3 @@ qt_internal_extend_target(QODBCDriverPlugin CONDITION UNIX
DEFINES
UNICODE
)
-
-qt_internal_force_macos_intel_arch(QODBCDriverPlugin)
diff --git a/src/plugins/sqldrivers/psql/CMakeLists.txt b/src/plugins/sqldrivers/psql/CMakeLists.txt
index 8ed84c9028..d3a6a8588e 100644
--- a/src/plugins/sqldrivers/psql/CMakeLists.txt
+++ b/src/plugins/sqldrivers/psql/CMakeLists.txt
@@ -35,5 +35,3 @@ if(MINGW)
DISABLE_PRECOMPILE_HEADERS ON
)
endif()
-
-qt_internal_force_macos_intel_arch(QPSQLDriverPlugin)
diff --git a/src/plugins/sqldrivers/qt_cmdline.cmake b/src/plugins/sqldrivers/qt_cmdline.cmake
index 91b6f9f767..93991fb2a9 100644
--- a/src/plugins/sqldrivers/qt_cmdline.cmake
+++ b/src/plugins/sqldrivers/qt_cmdline.cmake
@@ -15,4 +15,3 @@ qt_commandline_option(plugin-sql-oci TYPE void NAME sql-oci)
qt_commandline_option(plugin-sql-odbc TYPE void NAME sql-odbc)
qt_commandline_option(plugin-sql-psql TYPE void NAME sql-psql)
qt_commandline_option(plugin-sql-sqlite TYPE void NAME sql-sqlite)
-qt_commandline_assignment(MYSQL_PATH mysql.prefix)