1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
|
--- a/driver/mysql_connection.cpp
+++ b/driver/mysql_connection.cpp
@@ -1067,6 +1067,7 @@ MySQL_Connection::getClientOption(const sql::SQLString & optionName, void * opti
proxy->get_character_set_info(&cs);
*(static_cast<int *>(optionValue)) = cs.mbmaxlen;
/* mysql_get_option() was added in mysql 5.7.3 version */
+#if !defined( MARIADB_BASE_VERSION ) && !defined ( MARIADB_VERSION_ID )
} else if ( proxy->get_server_version() >= 50703 ) {
try {
if (GET_CONN_OPTION(optionName, optionValue, intOptions)) {
@@ -1080,6 +1081,7 @@ MySQL_Connection::getClientOption(const sql::SQLString & optionName, void * opti
CPP_ERR_FMT("Unsupported option : %d:(%s) %s", proxy->errNo(), proxy->sqlstate().c_str(), proxy->error().c_str());
throw e;
}
+#endif
}
}
/* }}} */
@@ -1097,11 +1099,13 @@ MySQL_Connection::getClientOption(const sql::SQLString & optionName)
MY_CHARSET_INFO cs;
proxy->get_character_set_info(&cs);
return cs.dir ? sql::SQLString(cs.dir) : "";
+#if !defined( MARIADB_BASE_VERSION ) && !defined ( MARIADB_VERSION_ID )
} else if ( proxy->get_server_version() >= 50703 ) {
const char* optionValue= NULL;
if (GET_CONN_OPTION(optionName, &optionValue, stringOptions)) {
return optionValue ? sql::SQLString(optionValue) : "";
}
+#endif
}
return "";
}
--- a/driver/nativeapi/libmysql_static_proxy.cpp
+++ b/driver/nativeapi/libmysql_static_proxy.cpp
@@ -325,7 +325,7 @@ LibmysqlStaticProxy::options(MYSQL * mysql, enum mysql_option option, const void
int
LibmysqlStaticProxy::get_option(MYSQL * mysql, enum mysql_option option, const void *arg)
{
-#if MYSQL_VERSION_ID >= 50703
+#if MYSQL_VERSION_ID >= 50703 && !defined( MARIADB_BASE_VERSION ) && !defined ( MARIADB_VERSION_ID )
if (::mysql_get_option(mysql, option, arg)) {
throw sql::InvalidArgumentException("Unsupported option provided to mysql_get_option()");
} else {
|