[CONC-624] Macro SET_CLIENT_STMT_ERROR doesn't support mariadb specific client errors Created: 2023-01-08  Updated: 2023-04-11  Resolved: 2023-01-15

Status: Closed
Project: MariaDB Connector/C
Component/s: Error handling
Affects Version/s: 3.1.19, 3.3.3
Fix Version/s: 3.3.4, 3.1.20

Type: Task Priority: Major
Reporter: Georg Richter Assignee: Georg Richter
Resolution: Fixed Votes: 0
Labels: None

Issue Links:
Problem/Incident
causes CONC-643 Fix for CONC-624 broke support for C++03 Closed

 Description   

Connector/C doesn't support mariadb client specific error numbers (>= CER_MIN_ERROR) in macro SET_CLIENT_STMT_ERROR, since this macro uses ER() macro. Therefore a crash will occur if the error code exceeds CR_MAX_ERROR.



 Comments   
Comment by David Ritter [ 2023-04-11 ]

The commit message for the change that addressed this notes

  • SET_CLIENT_STMT_ERROR now maps to stmt_set_error and accepts variadic arguments

This does have the side effect (not sure if it's intended or not) of now requiring the C++11 standard (previously the client could be used with C++03 but variadic argument usage breaks that) in order to compile cleanly (and break builds where warnings are treated as errors)

As I noted, I'm not sure if this is intentional or not, but if so perhaps the new C++ language requirement for the client should be noted.

Comment by Georg Richter [ 2023-04-11 ]

Hi David,

thanks for your comment - I already planned to remove the macro and replace it with the function call.

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