Bug #70493 `compare' symbol in ODBC conflicts with XSB Prolog
Submitted: 2 Oct 2013 20:50 Modified: 13 Feb 2023 21:40
Reporter: Jess Balint Email Updates:
Status: Closed Impact on me:
None 
Category:Connector / ODBC Severity:S3 (Non-critical)
Version:5.2 OS:Any
Assigned to: CPU Architecture:Any

[2 Oct 2013 20:50] Jess Balint
Description:
crash with stack:

#0  0x00007f8e60b27ff6 in __strcmp_ssse3 () from /usr/lib/libc.so.6
#1  0x0000000000494b5e in compare ()
#2  0x00007f8e5e80895e in is_query_separator () from /home/jbalint/sw/mysql-connector-odbc-5.2.5-linux-glibc2.5-x86-64bit/lib/libmyodbc5w.so
#3  0x00007f8e5e808a6b in tokenize () from /home/jbalint/sw/mysql-connector-odbc-5.2.5-linux-glibc2.5-x86-64bit/lib/libmyodbc5w.so
#4  0x00007f8e5e808df1 in parse () from /home/jbalint/sw/mysql-connector-odbc-5.2.5-linux-glibc2.5-x86-64bit/lib/libmyodbc5w.so
#5  0x00007f8e5e80f7a2 in prepare () from /home/jbalint/sw/mysql-connector-odbc-5.2.5-linux-glibc2.5-x86-64bit/lib/libmyodbc5w.so
#6  0x00007f8e5e80909d in my_SQLPrepare () from /home/jbalint/sw/mysql-connector-odbc-5.2.5-linux-glibc2.5-x86-64bit/lib/libmyodbc5w.so
#7  0x00007f8e5e808ff5 in MySQLPrepare () from /home/jbalint/sw/mysql-connector-odbc-5.2.5-linux-glibc2.5-x86-64bit/lib/libmyodbc5w.so
#8  0x00007f8e5e8188f5 in SQLPrepareWImpl () from /home/jbalint/sw/mysql-connector-odbc-5.2.5-linux-glibc2.5-x86-64bit/lib/libmyodbc5w.so
#9  0x00007f8e5e817997 in SQLExecDirectW () from /home/jbalint/sw/mysql-connector-odbc-5.2.5-linux-glibc2.5-x86-64bit/lib/libmyodbc5w.so
#10 0x00007f8e5f3f978d in SQLExecDirect () from /usr/lib/libodbc.so.2
#11 0x00007f8e5f64b584 in driverODBC_query () from /home/jbalint/sw/xsb-src/XSB/config/x86_64-unknown-linux-gnu/lib/odbc_driver.so
#12 0x00007f8e5f854218 in queryConnection () from /home/jbalint/sw/xsb-src/XSB/config/x86_64-unknown-linux-gnu/lib/driver_manager.so
#13 0x0000000000449966 in emuloop ()
#14 0x000000000046798c in xsb ()
#15 0x000000000041114e in main ()

How to repeat:
run query with XSB ODBC interface

Suggested fix:
make `compare' static in parse.c, or change the name.
[3 Oct 2013 10:35] Bogdan Degtyariov
Thank you Jess. Indeed, that function has to be renamed into something less ambiguous.
[8 Feb 2023 3:07] Bogdan Degtyariov
Posted by developer:
 
The symbol collision was resolved by renaming `compare()` function to `parser_compare()` in the parser module of ODBC driver.
[8 Feb 2023 3:07] Bogdan Degtyariov
Posted by developer:
 
The symbol collision was resolved by renaming `compare()` function to `parser_compare()` in the parser module of ODBC driver.
[13 Feb 2023 21:40] Philip Olson
Posted by developer:
 
Fixed as of the upcoming MySQL Connector/ODBC 8.0.33 release, and here's the proposed changelog entry from the documentation team:

Renamed compare() to parser_compare() in the parser module to avoid a
symbol collision with the XSB ODBC interface.

Thank you for the bug report.