[CONC-203] macro my_free(PTR) causes build errors for ODBC connector (in my_sys.h) Created: 2016-09-27  Updated: 2016-09-27  Resolved: 2016-09-27

Status: Closed
Project: MariaDB Connector/C
Component/s: None
Affects Version/s: 2.3.1
Fix Version/s: 2.3.1

Type: Bug Priority: Critical
Reporter: Michal Schorm Assignee: Georg Richter
Resolution: Done Votes: 0
Labels: None
Environment:

Fedora24



 Description   

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

In Fedora, we build, with mariadb-connector-c pkg also mariadb-connector-c-devel with some libraries, etc. in order to supply them to build this or another packages.

In file /usr/include/mariadb/my_sys.h there is a macro, that brick build of ODBC connector.
line ~ 129

#define my_free(PTR,FG) my_no_flags_free(PTR)

which does not make even sense (well, otherwise you should commented it).

__________________________________
Here is an example of build log form odbc connector (errors like this are all over the log):

/home/ODBC/rpmbuild/SOURCES/mariadb-connector-odbc-2.0.12-ga-src/odbc_3_api.c: In function ‘SQLTablesW’:
/home/ODBC/rpmbuild/SOURCES/mariadb-connector-odbc-2.0.12-ga-src/odbc_3_api.c:3180:22: error: macro "my_free" requires 2 arguments, but only 1 given
MADB_FREE(CpCatalog);
^
___________________________________

Suggested solution:

in file file/usr/include/mariadb/my_sys.h on line 129 change
#define my_free(PTR,FG) my_no_flags_free(PTR)

to
// #define my_free(PTR,FG) my_no_flags_free(PTR)
#define my_free(PTR) my_no_flags_free(PTR)

___________________________________

Now it works well.

Note:
Since it blocks compiling of ODBC connector, first this patch MUST appear in new stable version of C connector or be backported to version 2.3.1.
Only after that connector C can be rebuld for Fedora, backported to older Fedora versions and only after that ODBC connector can be build for Fedora.



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

Hello,

single parameter my_free is in repo repo since march 2015 https://github.com/MariaDB/mariadb-connector-c/blob/connector_c_2.3/include/my_sys.h#L129

And it is apparently in 2.3.1. Thus closing this bug. I'd imagine, that if there is problem, it is most probably in c/odbc build, which picks the wrong file.

Best regards,
Lawrin

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