SQL/MySQL: add connect option MYSQL_OPT_LOCAL_INFILE

Add the connect option MYSQL_OPT_LOCAL_INFILE to be able to specify the
client-side LOCAL capability for LOAD DATA operations

Fixes: QTBUG-104916
Change-Id: I9914250059e7dc1a705941d3b409fa624e105ecd
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
This commit is contained in:
Christian Ehrlicher 2022-10-22 20:48:17 +02:00
parent 4091d73af8
commit 84613e0e4c
2 changed files with 2 additions and 0 deletions

View File

@ -1203,6 +1203,7 @@ bool QMYSQLDriver::open(const QString &db,
{"MYSQL_OPT_READ_TIMEOUT"_L1, MYSQL_OPT_READ_TIMEOUT, setOptionInt},
{"MYSQL_OPT_WRITE_TIMEOUT"_L1, MYSQL_OPT_WRITE_TIMEOUT, setOptionInt},
{"MYSQL_OPT_RECONNECT"_L1, MYSQL_OPT_RECONNECT, setOptionBool},
{"MYSQL_OPT_LOCAL_INFILE"_L1, MYSQL_OPT_LOCAL_INFILE, setOptionInt},
};
auto trySetOption = [&](const QStringView &key, const QStringView &value) -> bool {
for (const mysqloptions &opt : options) {

View File

@ -1132,6 +1132,7 @@ QSqlRecord QSqlDatabase::record(const QString& tablename) const
\li MYSQL_OPT_CONNECT_TIMEOUT
\li MYSQL_OPT_READ_TIMEOUT
\li MYSQL_OPT_WRITE_TIMEOUT
\li MYSQL_OPT_LOCAL_INFILE
\li MYSQL_OPT_SSL_KEY
\li MYSQL_OPT_SSL_CERT
\li MYSQL_OPT_SSL_CA