[CONC-154] Repeated use of prepared statements hangs in vio_real_read Created: 2016-01-25  Updated: 2016-01-25  Resolved: 2016-01-25

Status: Closed
Project: MariaDB Connector/C
Component/s: None
Affects Version/s: 2.1, 3.0.0, 2.2.0
Fix Version/s: 2.2.3, 3.0.1

Type: Bug Priority: Major
Reporter: Tobias Pankrath Assignee: Georg Richter
Resolution: Fixed Votes: 0
Labels: None
Environment:

Centos6 and Centos7


Attachments: File mariadbconntest.tar.gz    

 Description   

I have attached a sample project with a setup.sql that can be used to setup the tables for the statements and a simple main.cpp that reuses a prepared statement to query a table.

The second call to mysql_stmt_execute will hang indefinitely in vio_real_read.

This code works perfectly fine if linked against the libmariadbclient from the mariadb source
but hangs if linked against the connector. I've tried 2.1.0, 2.2.0 and a github checkout of 3.0.0, binary distributions and self-compiled.

Here it hangs:
(gdb) bt
#0 0x00007f4193b337c0 in __read_nocancel () from /lib64/libpthread.so.0
#1 0x0000000000420266 in vio_real_read ()
#2 0x0000000000420362 in vio_read ()
#3 0x0000000000420865 in my_real_read ()
#4 0x000000000042149d in my_net_read ()
#5 0x000000000040c372 in net_safe_read ()
#6 0x000000000041726d in mthd_stmt_flush_unbuffered ()
#7 0x00000000004195a3 in mysql_stmt_execute ()
#8 0x000000000040b0dc in main ()



 Comments   
Comment by Georg Richter [ 2016-01-25 ]

Fixed in C/C 2.2 and 3.0 - changeset a89d465f576ad28c84f8dc1f06f6c1ffd14583bc

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