[CONC-297] The difference of local_infile definition makes issues on a big endian environment Created: 2017-12-04 Updated: 2018-08-08 Resolved: 2017-12-04 |
|
| Status: | Closed |
| Project: | MariaDB Connector/C |
| Component/s: | None |
| Affects Version/s: | 3.0.2 |
| Fix Version/s: | 3.0.3 |
| Type: | Bug | Priority: | Major |
| Reporter: | Jun Aruga | Assignee: | Georg Richter |
| Resolution: | Fixed | Votes: | 2 |
| Labels: | None | ||
| Environment: |
OS: Fedora Project version 28 (rawhide) (develop version). |
||
| Description |
|
mariadb-c-connector is using mysql_optionsv `MYSQL_OPT_LOCAL_INFILE` value (arg1) as my_bool (char) in this code. Ref: https://github.com/MariaDB/mariadb-connector-c/blob/v3.0.2/libmariadb/mariadb_lib.c#L2652 ``` 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). Ex. It is also written on the document.. 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. I want to know why this project changed uint to my_bool (char). I came from mysql ruby binding project. See https://github.com/brianmario/mysql2/pull/914 . Thank you. |
| Comments |
| Comment by Georg Richter [ 2017-12-04 ] |
|
Fixed rev. 434b67e624d72147a2987eed0a8e5a0765d16be1 |
| Comment by Aaron Stone [ 2017-12-04 ] |
|
Thank you! |
| Comment by Jun Aruga [ 2017-12-05 ] |
|
Thank you! |
| Comment by Jun Aruga [ 2018-07-11 ] |
|
@Georg I noticed that the local_file issue still happened with mariadb-connector-c 3.0.5 on big endian environment. |