我尝试使用MySQL ODBC驱动程序,但在编译时导致错误。 MySQL ODBC驱动程序适用于Mariadb 5.5但不适用于Mariadb 10.那么Mariadb 10是否有ODBC驱动程序?
我安装了MySQL Connector ODBC Driver源代码版本。
以下是错误消息:
* MySQL Connector ODBC Driver 5.3.4
Scanning dependencies of target myodbc5a
[ 6%] Building C object driver/CMakeFiles/myodbc5a.dir/catalog.c.o
[ 7%] Building C object driver/CMakeFiles/myodbc5a.dir/catalog_no_i_s.c.o
/myodbc/mysql-connector-odbc-5.3.4-src/driver/catalog_no_i_s.c:1096:69: error: macro "my_init_dynamic_array" requires 5 arguments, but only 4 given
/myodbc/mysql-connector-odbc-5.3.4-src/driver/catalog_no_i_s.c: In function 'foreign_keys_no_i_s':
/myodbc/mysql-connector-odbc-5.3.4-src/driver/catalog_no_i_s.c:1096: error: 'my_init_dynamic_array' undeclared (first use in this function)
/myodbc/mysql-connector-odbc-5.3.4-src/driver/catalog_no_i_s.c:1096: error: (Each undeclared identifier is reported only once
/myodbc/mysql-connector-odbc-5.3.4-src/driver/catalog_no_i_s.c:1096: error: for each function it appears in.)
make[2]: *** [driver/CMakeFiles/myodbc5a.dir/catalog_no_i_s.c.o] 오류 1
make[1]: *** [driver/CMakeFiles/myodbc5a.dir/all] 오류 2
make: *** [all] 오류 2
* MySQL Conncector ODBC Driver 5.2.7
[ 5%] Built target myodbc-util
Scanning dependencies of target myodbc5a
[ 6%] Building C object driver/CMakeFiles/myodbc5a.dir/catalog.c.o
[ 8%] Building C object driver/CMakeFiles/myodbc5a.dir/catalog_no_i_s.c.o
/myodbc/mysql-connector-odbc-5.2.7-src/driver/catalog_no_i_s.c:1096:69: error: macro "my_init_dynamic_array" requires 5 arguments, but only 4 given
/myodbc/mysql-connector-odbc-5.2.7-src/driver/catalog_no_i_s.c: In function 'foreign_keys_no_i_s':
/myodbc/mysql-connector-odbc-5.2.7-src/driver/catalog_no_i_s.c:1096: error: 'my_init_dynamic_array' undeclared (first use in this function)
/myodbc/mysql-connector-odbc-5.2.7-src/driver/catalog_no_i_s.c:1096: error: (Each undeclared identifier is reported only once
/myodbc/mysql-connector-odbc-5.2.7-src/driver/catalog_no_i_s.c:1096: error: for each function it appears in.)
make[2]: *** [driver/CMakeFiles/myodbc5a.dir/catalog_no_i_s.c.o] 오류 1
make[1]: *** [driver/CMakeFiles/myodbc5a.dir/all] 오류 2
make: *** [all] 오류 2
* MySQL Conncector ODBC Driver 5.1.13
[ 9%] Building C object driver/CMakeFiles/myodbc5.dir/ansi.c.o
[ 11%] Building C object driver/CMakeFiles/myodbc5.dir/catalog.c.o
[ 12%] Building C object driver/CMakeFiles/myodbc5.dir/catalog_no_i_s.c.o
[ 14%] Building C object driver/CMakeFiles/myodbc5.dir/connect.c.o
[ 16%] Building C object driver/CMakeFiles/myodbc5.dir/cursor.c.o
[ 18%] Building C object driver/CMakeFiles/myodbc5.dir/desc.c.o
/myodbc/mysql-connector-odbc-5.1.13-src/driver/desc.c:66:66: error: macro "my_init_dynamic_array" requires 5 arguments, but only 4 given
/myodbc/mysql-connector-odbc-5.1.13-src/driver/desc.c: In function 'desc_alloc':
/myodbc/mysql-connector-odbc-5.1.13-src/driver/desc.c:66: error: 'my_init_dynamic_array' undeclared (first use in this function)
/myodbc/mysql-connector-odbc-5.1.13-src/driver/desc.c:66: error: (Each undeclared identifier is reported only once
/myodbc/mysql-connector-odbc-5.1.13-src/driver/desc.c:66: error: for each function it appears in.)
/myodbc/mysql-connector-odbc-5.1.13-src/driver/desc.c: In function 'MySQLSetDescField':
/myodbc/mysql-connector-odbc-5.1.13-src/driver/desc.c:778: warning: cast from pointer to integer of different size
/myodbc/mysql-connector-odbc-5.1.13-src/driver/desc.c:786: warning: cast from pointer to integer of different size
/myodbc/mysql-connector-odbc-5.1.13-src/driver/desc.c:895:57: error: macro "my_init_dynamic_array" requires 5 arguments, but only 4 given
/myodbc/mysql-connector-odbc-5.1.13-src/driver/desc.c: In function 'MySQLCopyDesc':
/myodbc/mysql-connector-odbc-5.1.13-src/driver/desc.c:893: error: 'my_init_dynamic_array' undeclared (first use in this function)
make[2]: *** [driver/CMakeFiles/myodbc5.dir/desc.c.o] 오류 1
make[1]: *** [driver/CMakeFiles/myodbc5.dir/all] 오류 2
make: *** [all] 오류 2
答案 0 :(得分:0)
Gentoo似乎有一个补丁:
问题是通过添加每线程内存使用情况统计信息(https://mariadb.atlassian.net/browse/MDEV-4011)引入的,这需要在my_init_dynamic_array()
宏中添加一个附加参数。此宏未定义为公共客户端API的一部分,但仍在my_sys.h
头文件中公开,并由MySQL ODBC使用,因此在针对最近的MariaDB版本编译时,此更改破坏了ODBC代码。
替代方案正在应用上面的补丁,或者切换到MariaDB ODBC驱动程序(虽然仍处于测试阶段):
https://mariadb.com/kb/en/mariadb/client-libraries/mariadb-odbc-driver/