[ODBC-325] Reduce COM_STMT_RESET Created: 2021-06-22  Updated: 2021-06-23  Resolved: 2021-06-23

Status: Closed
Project: MariaDB Connector/ODBC
Component/s: General
Affects Version/s: None
Fix Version/s: 3.1.13

Type: Bug Priority: Major
Reporter: Vladislav Vaintroub Assignee: Georg Richter
Resolution: Duplicate Votes: 0
Labels: None

Issue Links:
Duplicate
duplicates ODBC-319 Some performance improvements Closed

 Description   

While testing connector back in October, I noticed there is COM_STMT_RESET before every COM_STMT_EXECUTE in the Connector/C. This of course has impact on performance.
This should be removed, and COM_STMT_RESET should be sent to server only when needed.



 Comments   
Comment by Georg Richter [ 2021-06-23 ]

wlad Some more information about version and circumstances (especially which application) would be helpful:

COM_STMT_RESET will be send in mysql_stmt_internal_reset, if parameter is_close is zero. This happens only when calling mysql_stmt_reset api function, which isn't used internally by Connector/C.

Comment by Vladislav Vaintroub [ 2021-06-23 ]

I'd suggest analyzing mariadb server logs https://jira.mariadb.org/secure/attachment/57593/mariadb_logs.7z attached to https://jira.mariadb.org/browse/ODBC-313 as a starting point. It has a lot of resets in the mariadb query log. Those resets come from our ODBC driver, which has zero mysql_stmt_reset API functions in its code (at least, this is what git grep tells me) .

The version I encountered it was 3.1 somewhere in October last year, when debugging something unrelated.

Comment by Georg Richter [ 2021-06-23 ]

Thanks for the information. Actual version in October 2020 was ODBC 3.1.10:

georg@beethoven:~/work/mariadb/conn/odbc$ git checkout tags/3.1.10
georg@beethoven:~/work/mariadb/conn/odbc$ git branch
* (HEAD detached at 3.1.10)
georg@beethoven:~/work/mariadb/conn/odbc$ git grep mysql_stmt_reset
ma_statement.c:        mysql_stmt_reset(Stmt->stmt);
ma_statement.c:            mysql_stmt_reset(Stmt->MultiStmts[i]);

Comment by Lawrin Novitsky [ 2021-06-23 ]

That was fixed in 3.1.13

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