[ODBC-207] Bug with multistatement prepared statement param realloc Created: 2018-12-23  Updated: 2019-05-21  Resolved: 2019-01-04

Status: Closed
Project: MariaDB Connector/ODBC
Component/s: General
Affects Version/s: None
Fix Version/s: 2.0.19, 3.1.0, 3.0.8

Type: Bug Priority: Major
Reporter: Joshua Colvin Assignee: Lawrin Novitsky
Resolution: Fixed Votes: 0
Labels: None


 Description   

Example use case:
Prepare the following SQL statement:
"INSERT INTO tbl (a,b) VALUES (?,?); SELECT 1 FROM tbl WHERE c = ?"
First execution of prepared statement will work, second execution will segfault or cause memory corruption.

Problem is caused because parameter storage is reallocated for second sub-statement, but not re-adjusted for first sub-statement the next time prepared statement is executed.



 Comments   
Comment by Joshua Colvin [ 2018-12-23 ]

Opened pull request with fix and test
https://github.com/MariaDB/mariadb-connector-odbc/pull/29

Comment by Lawrin Novitsky [ 2019-01-04 ]

The provided pull request has been merged

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