mysqlxx: added option MYSQL_OPT_LOCAL_INFILE [#CONV-3016].

This commit is contained in:
Alexey Milovidov 2011-08-23 17:46:58 +00:00
parent 66d4adda93
commit 2b5d719414

View File

@ -46,6 +46,12 @@ void Connection::connect(const char* db,
if (mysql_options(&driver, MYSQL_OPT_CONNECT_TIMEOUT, reinterpret_cast<const char *>(&timeout)))
throw ConnectionFailed(mysql_error(&driver), mysql_errno(&driver));
/** Включаем возможность использовать запрос LOAD DATA LOCAL INFILE с серверами,
* которые были скомпилированы без опции --enable-local-infile.
*/
if (mysql_options(&driver, MYSQL_OPT_LOCAL_INFILE, NULL))
throw ConnectionFailed(mysql_error(&driver), mysql_errno(&driver));
if (!mysql_real_connect(&driver, server, user, password, db, port, NULL, driver.client_flag))
throw ConnectionFailed(mysql_error(&driver), mysql_errno(&driver));