Status: Closed (View Workflow)
Affects Version/s: 3.0.2
Fix Version/s: 3.0.3
Environment:OS: Fedora Project version 28 (rawhide) (develop version).
Architecture: ppc64 big endian.
mysql2: MySQL Ruby binding.
mariadb-c-connector is using mysql_optionsv `MYSQL_OPT_LOCAL_INFILE` value (arg1) as my_bool (char) in this code.
if (!arg1 || test((my_bool) arg1))
The part was changed from `uint` to `my_bool` in below commit.
The issue is seeing other MySQL server and MariaDB server code, it is defined as uint, not my_bool (char).
> if (!arg || MY_TEST((uint) arg))
It is also written on the document..
> MYSQL_OPT_LOCAL_INFILE (argument type: optional pointer to unsigned int)
This difference causes that local_infile with mariadb-c-connector does not work on big endian environment.
Because on little endian (major environment such as x86_64), when set
mysql_options MYSQL_OPT_LOCAL_INFILE arg as type uint 1 = "0x01 0x00 0x00 0x00" to enable local_infile, this becomes "0x01" by char (my_bool) cast.
But on big endian environment, when set type uint 1 = "0x00 0x00 0x00 0x01" to enable local_infile, this becomes "0x00" by char (my_bool) cast. As a result, local_infile is not set as on.
I want to know why this project changed uint to my_bool (char).
I wish it is changed to uint (unsigned int) again.
I came from mysql ruby binding project. See https://github.com/brianmario/mysql2/pull/914 .