[CONC-641] mysql_stmt_close() interferes with the query results of other statements Created: 2023-03-23  Updated: 2023-03-23  Resolved: 2023-03-23

Status: Closed
Project: MariaDB Connector/C
Component/s: API
Affects Version/s: 3.1.13, 3.3.4
Fix Version/s: N/A

Type: Bug Priority: Major
Reporter: Tao Su Assignee: Georg Richter
Resolution: Not a Bug Votes: 0
Labels: foundation
Environment:

All plateform


Attachments: Text File stmt_close_bugdemo.c    

 Description   

Use mysql_stmt_init() to create multiple statements. When one statement A completes its work (that is, fetches all result sets or no result sets) but is not closed, use statement B to query with result sets and succeed. Closing statement A at this point will cause the result set of statement B to disappear. The same problem will occur if statement B is replaced with mysql_query(). Attached is the demo code.



 Comments   
Comment by Georg Richter [ 2023-03-23 ]

You have to store a pending result set first before sending further commands to the server.
Also add error checking to your code: The error commands out of sync is generated in mysql_stmt_close(), since the command COM_STMT_CLOSE couldn't be sent to server.

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