[CONC-212] mariadnb_stmt_execute_direct in combination with mysql_real_query cause "out of sync" Created: 2016-11-08  Updated: 2023-12-22

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

Type: Bug Priority: Major
Reporter: Lawrin Novitsky Assignee: Georg Richter
Resolution: Unresolved Votes: 0
Labels: None
Environment:

server from 10.2 branch, Connector/C from master branch



 Description   

Here is minimal testcase I have come up with

stmt = mysql_stmt_init(ma);

mariadb_stmt_execute_direct(stmt, "SELECT 1,2", strlen("SELECT 1,2"));
mysql_stmt_store_result(stmt);
mysql_stmt_free_result(stmt);
mysql_stmt_reset(stmt);

mariadb_stmt_execute_direct(stmt, "SELECT 1,2", strlen("SELECT 1,2"));
mysql_stmt_store_result(stmt);
mysql_stmt_free_result(stmt);

mysql_real_query(ma, "drop table if exists t_count", strlen("drop table if exists t_count"));

mysql_real_query(ma, "create table t_count (a int)", strlen("create table t_count (a int)"));

mysql_stmt_close(stmt);

The error occurs on 2nd mysql_real_query. Moving mysql_stmt_close(stmt); above them changes nothing. Removing one of mariadb_stmt_execute_direct eliminates error.
Lowered priority - closing, instead of resetting stmt between two mariadb_stmt_execute_direct calls eliminates bug. And closing is the right thing to do.



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

If substitute mariadb_stmt_direct_execute with (mysql_stmt_prepare + execute), the error is "No data supplied for parameters in prepared statement"
With C/C 2.3 no errors on same scenario

Comment by JiraAutomate [ 2023-12-22 ]

Automated message:
----------------------------
Since this issue has not been updated since 6 weeks, it's time to move it back to Stalled.

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