[CONC-435] Connector stmt sends 'close' command if stmt handle was never used Created: 2019-08-19 Updated: 2021-01-20 |
|
| Status: | Open |
| Project: | MariaDB Connector/C |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Major |
| Reporter: | Lawrin Novitsky | Assignee: | Lawrin Novitsky |
| Resolution: | Unresolved | Votes: | 1 |
| Labels: | None | ||
| Description |
|
If application inits stmt handle, but then closes it without use, C/C sends redundant 'close' command to the server for the stmtid==0. Application has to call mysql_stmt_close in this case, as it needs to free allocated stmt handle memory, anyway. |
| Comments |
| Comment by George Diamantopoulos [ 2019-09-02 ] | |||||||||||
|
Hello all, If there's a patch available or a fix lands in master for this issue, please let me know via this issue. I can test against an application that is known to trigger this. Thanks! | |||||||||||
| Comment by Georg Richter [ 2019-09-03 ] | |||||||||||
|
Can you provide a test case please to reproduce this issue? | |||||||||||
| Comment by George Diamantopoulos [ 2019-09-05 ] | |||||||||||
|
@georg Actually I didn't come across this during development using C/C. It manifests when using asterisk 16 with an ODBC backend via C/ODBC. If you believe this to be a client issue, I can raise this with asterisk devs, but it was Lawrin who suggested that this be dealt with in either C/C or C/ODBC in Having said that, asterisk functionality doesn't seem to be affected, as far as I can tell. The main issue is that Maxscale's log, which sits between C/ODBC and the MariaDB servers, is inundated with warnings about this. In terms of further debugging information, what I can provide is an ODBC trace with the client's (asterisk's) behaviour. If that would be of any value, please let me know. Thanks! | |||||||||||
| Comment by Lawrin Novitsky [ 2019-09-10 ] | |||||||||||
|
Well, that looked for me as most viable version explaining those 0 stmt id's. I'll try to repeat that with C/ODBC | |||||||||||
| Comment by Serge Rogatch [ 2020-06-08 ] | |||||||||||
|
I'm getting "Unknown prepared statement handler (300) given to mysqld_stmt_execute". Is it the same bug, or shall I open a new ticket? Can someone explain what 300 stands for? | |||||||||||
| Comment by Georg Richter [ 2020-06-08 ] | |||||||||||
|
I wonder if we had some similiar bug already in ODBC. This is the relevant part in Connector/C:
That means, we will only send a COM_STMT_CLOSE if the statement was already prepared. Is there any chance to debug and to check if stmt->id has a value? Also a valgrind run would be useful, to check if something was overwritten. | |||||||||||
| Comment by Georg Richter [ 2021-01-20 ] | |||||||||||
|
Can you check if this issue was also fixed by fix for |