[CONC-242] Incorrect description for mysql_optionsv option MYSQL_OPT_RECONNECT Created: 2017-03-08  Updated: 2017-07-05  Resolved: 2017-07-05

Status: Closed
Project: MariaDB Connector/C
Component/s: None
Affects Version/s: 2.3.2
Fix Version/s: N/A

Type: Bug Priority: Blocker
Reporter: Zhang Jingqiang Assignee: Georg Richter
Resolution: Fixed Votes: 0
Labels: None


 Description   

The current document said that that option can accept following as param:
NULL or (void *)"1"
But in 2.3.2 source code file libmariadb.c:3046,
mysql->reconnect= *(uint *)arg1;
where uint is unsigne int, which consume 4 bytes, and there is no NULL check for arg1.
And in 3.0.1 source code file mariadb_lib.c:2650,
mysql->options.reconnect= *(my_bool *)arg1;
where my_bool is a char type, which consume 1 byte, and there is no NULL check for arg1.

Please correct the document AND please also document the type change (uint -> char) since version 3.0.1, as old code which use "*(uint *)arg1 == 1" won't equal to "*(char *)arg1 == 1" in Big Endian arch.



 Comments   
Comment by Georg Richter [ 2017-03-15 ]

The correct behavior is as implemented in C/C 3.0:
The parameter should be a pointer to

my_bool

This needs to be fixed in API Documentation and in C/C 2.3

Comment by Georg Richter [ 2017-07-05 ]

Already fixed in documentation:

https://mariadb.com/kb/en/mariadb/mysql_optionsv/

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