[ODBC-54] macro MARIADB_INVALID_SOCKET undefined (in ma_odbc.h) Created: 2016-09-27  Updated: 2016-09-27  Resolved: 2016-09-27

Status: Closed
Project: MariaDB Connector/ODBC
Component/s: None
Affects Version/s: 2.0.12
Fix Version/s: 3.0.0

Type: Bug Priority: Major
Reporter: Michal Schorm Assignee: Lawrin Novitsky
Resolution: Duplicate Votes: 0
Labels: None
Environment:

Fedora24



 Description   

Hello, I'm trying to pack and distribute odbc-connector to Fedora repos.

But there is critical error while compiling about undefined macro MARIADB_INVALID_SOCKET
_______________________________________

$ make
Scanning dependencies of target maodbc
[ 5%] Building C object CMakeFiles/maodbc.dir/odbc_3_api.c.o
[ 11%] Building C object CMakeFiles/maodbc.dir/ma_error.c.o
[ 17%] Building C object CMakeFiles/maodbc.dir/ma_connection.c.o
/home/ODBC/rpmbuild/SOURCES/mariadb-connector-odbc-2.0.12-ga-src/ma_connection.c: In function ‘CheckConnection’:
/home/ODBC/rpmbuild/SOURCES/mariadb-connector-odbc-2.0.12-ga-src/ma_connection.c:121:41: error: ‘MARIADB_INVALID_SOCKET’ undeclared (first use in this function)
if (mysql_get_socket(Dbc->mariadb) == MARIADB_INVALID_SOCKET)
^~~~~~~~~~~~~~~~~~~~~~
/home/ODBC/rpmbuild/SOURCES/mariadb-connector-odbc-2.0.12-ga-src/ma_connection.c:121:41: note: each undeclared identifier is reported only once for each function it appears in
CMakeFiles/maodbc.dir/build.make:110: návod pro cíl „CMakeFiles/maodbc.dir/ma_connection.c.o“ selhal
make[2]: *** [CMakeFiles/maodbc.dir/ma_connection.c.o] Chyba 1
CMakeFiles/Makefile2:67: návod pro cíl „CMakeFiles/maodbc.dir/all“ selhal
make[1]: *** [CMakeFiles/maodbc.dir/all] Error 2
Makefile:149: návod pro cíl „all“ selhal
make: *** [all] Error 2

______________________________________________

Sugested sollution:
add following to the beginning of file "ma_odbc.h" ( ~ line 28)

#ifndef MARIADB_INVALID_SOCKET
#define MARIADB_INVALID_SOCKET 0
#endif

Replace 0 with suitable value. I don't know what goes there since it is undefined in the source code.



 Comments   
Comment by Lawrin Novitsky [ 2016-09-27 ]

Thank you for your report!
I think here, as also in the CONC-203, the reason is wrong Connector/C version. Or maybe it picks wrong headers(server's or mysql?) I guess it is duplicate of ODBC-39, and close for this reason. You can re-open, if you disagree.

Generated at Thu Feb 08 03:25:53 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.