[CONC-424] mysql_stmt_store_result returns empty error Created: 2019-06-28 Updated: 2020-08-25 Resolved: 2019-06-30 |
|
| Status: | Closed |
| Project: | MariaDB Connector/C |
| Component/s: | None |
| Affects Version/s: | 3.0.10 |
| Fix Version/s: | 3.0.11, 3.1.3 |
| Type: | Bug | Priority: | Major |
| Reporter: | Geoff Montee (Inactive) | Assignee: | Georg Richter |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Attachments: |
|
||||||||||||||||||||
| Issue Links: |
|
||||||||||||||||||||
| Description |
|
The mysql_stmt_store_result function can return an error, even though mysql_stmt_errno(), mysql_stmt_sqlstate(), and mysql_stmt_error() do not actually contain information about an error. This may be related to running stored procedures that contain a cursor. To reproduce, load the attached schema:
And then build the attached program:
And then run the program. At that point, you should see an empty error:
See |
| Comments |
| Comment by Georg Richter [ 2019-06-30 ] |
|
Server sends the flag SERVER_STATUS_CURSOR_EXISTS to force the client to retrive rows by sending COM_STMT_FETCH. This doesn't work, since
This is a server bug in all versions (including MySQL server). Since text and binary protocol use the same function, the stmt->error is not updated correctly (which is a bug). |
| Comment by Georg Richter [ 2019-06-30 ] |
|
commit d09ac51df3c35e569e91313affb58ae74fd3470a Workaround/Fix for 1) In case a cursor is used in a stored procedure server sends a SERVER_STATUS_CURSOR_EXISTS flag, 2) The stmt error codes weren't update for all COM_STMT* commands correctly, e.g. COM_STMT_FETCH didn't show an error even if it failed. |