File mariadb_api.patch of Package mysql-connector-cpp
Index: mysql-connector-c++-1.1.8/driver/nativeapi/libmysql_static_proxy.cpp
===================================================================
--- mysql-connector-c++-1.1.8.orig/driver/nativeapi/libmysql_static_proxy.cpp
+++ mysql-connector-c++-1.1.8/driver/nativeapi/libmysql_static_proxy.cpp
@@ -319,7 +319,7 @@ LibmysqlStaticProxy::options(MYSQL * mys
int
LibmysqlStaticProxy::get_option(MYSQL * mysql, enum mysql_option option, const void *arg)
{
-#if MYSQL_VERSION_ID >= 50703
+#if not defined MARIADB_BASE_VERSION && MYSQL_VERSION_ID >= 50703
if (::mysql_get_option(mysql, option, arg)) {
throw sql::InvalidArgumentException("Unsupported option provided to mysql_get_option()");
} else {
Index: mysql-connector-c++-1.1.8/driver/mysql_connection.cpp
===================================================================
--- mysql-connector-c++-1.1.8.orig/driver/mysql_connection.cpp
+++ mysql-connector-c++-1.1.8/driver/mysql_connection.cpp
@@ -1022,6 +1022,7 @@ MySQL_Connection::getClientOption(const
MY_CHARSET_INFO cs;
proxy->get_character_set_info(&cs);
*(static_cast<int *>(optionValue)) = cs.mbmaxlen;
+#ifndef MARIADB_BASE_VERSION
/* mysql_get_option() was added in mysql 5.7.3 version */
} else if ( proxy->get_server_version() >= 50703 ) {
try {
@@ -1036,6 +1037,7 @@ MySQL_Connection::getClientOption(const
CPP_ERR_FMT("Unsupported option : %d:(%s) %s", proxy->errNo(), proxy->sqlstate().c_str(), proxy->error().c_str());
throw e;
}
+#endif /* MARIADB_BASE_VERSION */
}
}
/* }}} */
@@ -1053,11 +1055,13 @@ MySQL_Connection::getClientOption(const
MY_CHARSET_INFO cs;
proxy->get_character_set_info(&cs);
return cs.dir ? sql::SQLString(cs.dir) : "";
+#ifndef MARIADB_BASE_VERSION
} else if ( proxy->get_server_version() >= 50703 ) {
const char* optionValue= NULL;
if (GET_CONN_OPTION(optionName, &optionValue, stringOptions)) {
return optionValue ? sql::SQLString(optionValue) : "";
}
+#endif /* MARIADB_BASE_VERSION */
}
return "";
}
Index: mysql-connector-c++-1.1.8/driver/nativeapi/libmysql_dynamic_proxy.cpp
===================================================================
--- mysql-connector-c++-1.1.8.orig/driver/nativeapi/libmysql_dynamic_proxy.cpp
+++ mysql-connector-c++-1.1.8/driver/nativeapi/libmysql_dynamic_proxy.cpp
@@ -434,6 +434,7 @@ LibmysqlDynamicProxy::options(MYSQL * my
int
LibmysqlDynamicProxy::get_option(MYSQL * mysql, enum mysql_option option, const void *arg)
{
+#if not defined MARIADB_BASE_VERSION && MYSQL_VERSION_ID >= 50703
ptr2mysql_get_option ptr2_get_option = symbol_safe_cast<ptr2mysql_options4>(GetProcAddr("mysql_get_option"));
if (ptr2_get_option != NULL) {
if (((*ptr2_get_option)(mysql, option, arg))) {
@@ -444,6 +445,9 @@ LibmysqlDynamicProxy::get_option(MYSQL *
} else {
throw ::sql::MethodNotImplementedException("::mysql_get_option()");
}
+#else
+ throw ::sql::MethodNotImplementedException("::mysql_get_option()");
+#endif
}
/* }}} */
@@ -813,7 +817,7 @@ LibmysqlDynamicProxy::stmt_free_result(M
{
ptr2mysql_stmt_free_result ptr2_stmt_free_result = symbol_safe_cast<ptr2mysql_stmt_free_result>(GetProcAddr("mysql_stmt_free_result"));
- return (*ptr2_stmt_next_result)(stmt);
+ return (*ptr2_stmt_free_result)(stmt);
}
/* }}} */