[MDEV-26132] Removing COM_STMT_CLOSE executes previous statement again. Created: 2021-07-13  Updated: 2023-04-27

Status: Open
Project: MariaDB Server
Component/s: Prepared Statements
Affects Version/s: 10.2.39, 10.3.30, 10.4.20, 10.5.11, 10.6.3
Fix Version/s: 10.4, 10.5, 10.6

Type: Bug Priority: Major
Reporter: Georg Richter Assignee: Dmitry Shulga
Resolution: Unresolved Votes: 0
Labels: None


 Description   

In branch 3.2-georg of Connector/C I tried to remove a COM_STMT_CLOSE before reusing a statement with mariadb_stmt_execute_direct, which ends up in strange behavior, since the previously executed statement was executed again.

From general log:

10882 Prepare  DROP TABLE IF EXISTS bulk_null
10882 Execute  DROP TABLE IF EXISTS bulk_null
10882 Prepare  CREATE TABLE bulk_null (a int not null auto_increment primary key, b varchar(20))
10882 Execute  DROP TABLE IF EXISTS bulk_null

How to repeat:
Checkout branch 3.2-georg of Connector/C, build and run bulk1 test.

If I replace execute_direct api calls by mysql_stmt_prepare and mysql_stmt_execute it works as expected.


Generated at Thu Feb 08 09:42:59 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.