Bug #22797 SQLTables does evil things with a MYSQL_RES
Submitted: 28 Sep 2006 19:09 Modified: 6 Jun 2007 11:57
Reporter: Jim Winstead Email Updates:
Status: Closed Impact on me:
None 
Category:Connector / ODBC Severity:S3 (Non-critical)
Version:3.51r116 OS:Linux (Linux, x86_64)
Assigned to: Jim Winstead CPU Architecture:Any
Tags: SQLTables

[28 Sep 2006 19:09] Jim Winstead
Description:
The implementation of SQLTables() in C/ODBC 3.51 monkeys around with the internals of the MYSQL_RES structure to place copies of hard-coded, statically-allocated data there. This causes trouble with mysql_free_result() is then called on the structure that has been monkeyed with.

How to repeat:
For one thing, t_sqltables() in my_test2.c fails. You can also see fun errors like "Error: Freeing unallocated data at line 894, 'client.c'" in the test output.

Suggested fix:
Don't monkey with the internals of MYSQL_RES.
[16 May 2007 21:53] Jim Winstead
fix freeing of "fake" results

Attachment: bug22797.patch (application/octet-stream, text), 6.07 KiB.

[29 May 2007 19:53] Jim Winstead
The fix for this bug has been committed, and will be in 3.51.16.
[6 Jun 2007 11:57] MC Brown
A note has been added to the 3.51.16 changelog.