author: Filip Januš date: 7.11.2019 Patch for resolving build errors. Some includes were missing. In some tests were mistaken parameter names. diff -ur mysql-connector-odbc-8.0.18/include/mysql-8.0/mysql.h mysql-connector-odbc-8.0.18_patch/include/mysql-8.0/mysql.h --- mysql-connector-odbc-8.0.18/include/mysql-8.0/mysql.h 2019-09-10 15:03:07.000000000 +0200 +++ mysql-connector-odbc-8.0.18_patch/include/mysql-8.0/mysql.h 2019-10-31 20:25:44.505636473 +0100 @@ -83,11 +83,6 @@ /* Include declarations of plug-in API */ #include "mysql/client_plugin.h" // IWYU pragma: keep -/* - The client should be able to know which version it is compiled against, - even if mysql.h doesn't use this information directly. -*/ -#include "mysql_version.h" // IWYU pragma: keep // MYSQL_TIME is part of our public API. #include "mysql_time.h" // IWYU pragma: keep diff -ur mysql-connector-odbc-8.0.18/MYODBC_MYSQL.h mysql-connector-odbc-8.0.18_patch/MYODBC_MYSQL.h --- mysql-connector-odbc-8.0.18/MYODBC_MYSQL.h 2019-10-31 21:03:27.937285702 +0100 +++ mysql-connector-odbc-8.0.18_patch/MYODBC_MYSQL.h 2019-10-31 22:23:04.900307889 +0100 @@ -55,7 +55,7 @@ #include "include/mysql-8.0/thr_mutex.h" #include "include/mysql-8.0/my_sys.h" #include -#include +#include #include "include/mysql-8.0/my_alloc.h" #include "include/mysql-8.0/mysql/service_mysql_alloc.h" #include "include/mysql-8.0/m_ctype.h" @@ -80,9 +80,6 @@ #define PSI_NOT_INSTRUMENTED 0 #define MIN_MYSQL_VERSION 40100L -#if MYSQL_VERSION_ID < MIN_MYSQL_VERSION -# error "Connector/ODBC requires v4.1 (or later) of the MySQL client library" -#endif #define my_sys_init my_init #define x_free(A) { void *tmp= (A); if (tmp) my_free((char *) tmp); } diff -ur mysql-connector-odbc-8.0.18/mysql_sys/my_alloc.cc mysql-connector-odbc-8.0.18_patch/mysql_sys/my_alloc.cc --- mysql-connector-odbc-8.0.18/mysql_sys/my_alloc.cc 2019-09-10 15:03:07.000000000 +0200 +++ mysql-connector-odbc-8.0.18_patch/mysql_sys/my_alloc.cc 2019-10-31 20:17:43.299224904 +0100 @@ -35,6 +35,7 @@ #include #include +#include "MYODBC_MYSQL.h" #include "my_alloc.h" #include "my_compiler.h" #include "my_dbug.h" diff -ur mysql-connector-odbc-8.0.18/mysql_sys/my_lib.cc mysql-connector-odbc-8.0.18_patch/mysql_sys/my_lib.cc --- mysql-connector-odbc-8.0.18/mysql_sys/my_lib.cc 2019-09-10 15:03:07.000000000 +0200 +++ mysql-connector-odbc-8.0.18_patch/mysql_sys/my_lib.cc 2019-10-31 20:34:42.564285962 +0100 @@ -38,6 +38,7 @@ #include #include +#include "MYODBC_MYSQL.h" #include "m_string.h" #include "my_alloc.h" #include "my_dbug.h" diff -ur mysql-connector-odbc-8.0.18/test/my_error.c mysql-connector-odbc-8.0.18_patch/test/my_error.c --- mysql-connector-odbc-8.0.18/test/my_error.c 2019-09-10 15:03:07.000000000 +0200 +++ mysql-connector-odbc-8.0.18_patch/test/my_error.c 2019-10-31 20:42:01.484915785 +0100 @@ -171,13 +171,13 @@ /* ODBC 3.8 applications should use ... SQLSetEnvAttr to set the SQL_ATTR_ODBC_VERSION environment attribute to SQL_OV_ODBC_3_80*/ ok_env(henv1, SQLSetEnvAttr(henv1, SQL_ATTR_ODBC_VERSION, - (SQLPOINTER)SQL_OV_ODBC3_80, 0)); + (SQLPOINTER)SQL_OV_ODBC3, 0)); ok_env(henv1, SQLAllocHandle(SQL_HANDLE_DBC, henv1, &hdbc1)); ok_env(henv1, SQLGetEnvAttr(henv1, SQL_ATTR_ODBC_VERSION, (SQLPOINTER)&ov_version, 0, 0)); - is_num(ov_version, SQL_OV_ODBC3_80); + is_num(ov_version, SQL_OV_ODBC3); free_basic_handles(&henv1, &hdbc1, &hstmt1); diff -ur mysql-connector-odbc-8.0.18/test/my_info.c mysql-connector-odbc-8.0.18_patch/test/my_info.c --- mysql-connector-odbc-8.0.18/test/my_info.c 2019-09-10 15:03:07.000000000 +0200 +++ mysql-connector-odbc-8.0.18_patch/test/my_info.c 2019-10-31 20:43:45.431699005 +0100 @@ -36,7 +36,7 @@ SQL_ALTER_DOMAIN, SQL_ALTER_TABLE, #ifndef USE_IODBC - SQL_ASYNC_DBC_FUNCTIONS, +// SQL_ASYNC_DBC_FUNCTIONS, #endif SQL_ASYNC_MODE, SQL_BATCH_ROW_COUNT, diff -ur mysql-connector-odbc-8.0.18/test/my_param.c mysql-connector-odbc-8.0.18_patch/test/my_param.c --- mysql-connector-odbc-8.0.18/test/my_param.c 2019-09-10 15:03:07.000000000 +0200 +++ mysql-connector-odbc-8.0.18_patch/test/my_param.c 2019-10-31 20:50:16.954363038 +0100 @@ -1432,7 +1432,7 @@ - ok_stmt(hstmt, SQLBindParameter(hstmt, 1, SQL_PARAM_OUTPUT_STREAM, + ok_stmt(hstmt, SQLBindParameter(hstmt, 1, SQL_PARAM_OUTPUT, SQL_C_BINARY, SQL_VARBINARY, 0, 0, (SQLPOINTER)123, /* Application-defined token. Using ordinal position or a pointer to some data structure for it would be a better idea */ @@ -1522,7 +1522,7 @@ ok_stmt(hstmt, SQLBindParameter(hstmt, 1, SQL_PARAM_INPUT, SQL_C_LONG, SQL_INTEGER, 0, 0, &intParam, 0, NULL)); - ok_stmt(hstmt, SQLBindParameter(hstmt, 2, SQL_PARAM_INPUT_OUTPUT_STREAM, + ok_stmt(hstmt, SQLBindParameter(hstmt, 2, SQL_PARAM_INPUT_OUTPUT, SQL_C_BINARY, SQL_VARBINARY, 0, 0, (SQLPOINTER)2, /* Application-defined token. Using ordinal position or a pointer to some data structure are good ideas here */ @@ -1636,7 +1636,7 @@ SET param2= concat('a', param2, 'z');\ END;"); - ok_stmt(hstmt, SQLBindParameter(hstmt, 1, SQL_PARAM_INPUT_OUTPUT_STREAM, + ok_stmt(hstmt, SQLBindParameter(hstmt, 1, SQL_PARAM_INPUT_OUTPUT, SQL_C_BINARY, SQL_VARBINARY, 0, 0, (SQLPOINTER)1, /* Application-defined token. Using ordinal position or a pointer to some data structure are good ideas here */