Edit report at https://bugs.php.net/bug.php?id=81658&edit=1
ID: 81658
Updated by: git@php.net
Reported by: yury at codescar dot eu
Summary: mysql_option MYSQL_OPT_LOAD_DATA_LOCAL_DIR not
available in mariadb libraries
-Status: Open
+Status: Closed
Type: Bug
Package: Compile Failure
Operating System: Debian 10 (OS irrelevant)
PHP Version: 8.1.0
Block user comment: N
Private report: N
New Comment:
Automatic comment on behalf of devnexen (author) and cmb69 (committer)
Revision: https://github.com/php/php-src/commit/15e7e570a52795a6fea4af8d02f04567320d802f
Log: Fix #81658: MYSQL_OPT_LOAD_DATA_LOCAL_DIR not available in MariaDB
Previous Comments:
------------------------------------------------------------------------
[2021-12-05 15:52:40] bugs dot php at osxtra dot dev
cmb@php.net's suggestion on 2021-11-26 @ 11:53 UTC seems to do the trick.
OS: OSX 10.15.7 (19H15)
Compiled app versions:
Apache: 2.4.51
PHP: 8.1.0
MariaDB: 10.6.4
Editing these five lines in files located at php/8.1.0/ext/mysqli/ will allow the native MariaDB
client to compile:
mysqli.c:600
Original: #if MYSQL_VERSION_ID >= 80021 || defined(MYSQLI_USE_MYSQLND)
Modified: #if (MYSQL_VERSION_ID >= 80021 && !defined(MARIADB_BASE_VERSION)) ||
defined(MYSQLI_USE_MYSQLND)
mysqli_api.c:1723
Original: #if MYSQL_VERSION_ID >= 80021 || defined(MYSQLI_USE_MYSQLND)
Modified: #if (MYSQL_VERSION_ID >= 80021 && !defined(MARIADB_BASE_VERSION)) ||
defined(MYSQLI_USE_MYSQLND)
mysqli_driver.c:547
Original: #if MYSQL_VERSION_ID >= 80021 || defined(PDO_USE_MYSQLND)
Modified: #if (MYSQL_VERSION_ID >= 80021 && !defined(MARIADB_BASE_VERSION)) ||
defined(PDO_USE_MYSQLND)
mysqli_driver.c:773
Original: #if MYSQL_VERSION_ID >= 80021 || defined(PDO_USE_MYSQLND)
Modified: #if (MYSQL_VERSION_ID >= 80021 && !defined(MARIADB_BASE_VERSION)) ||
defined(PDO_USE_MYSQLND)
mysqli_nonapi.c:336
Original: #if MYSQL_VERSION_ID >= 80021 || defined(MYSQLI_USE_MYSQLND)
Modified: #if (MYSQL_VERSION_ID >= 80021 && !defined(MARIADB_BASE_VERSION)) ||
defined(MYSQLI_USE_MYSQLND)
With original code, php -i reports:
Client API library version => mysqlnd 8.1.0
Client API version => mysqlnd 8.1.0
With edited code, php -i reports:
Client API library version => 3.2.4
Client API header version => 10.6.4-MariaDB
------------------------------------------------------------------------
[2021-11-26 11:53:13] cmb@php.net
> MYSQL_OPT_LOAD_DATA_LOCAL_DIR is defined as member of enum> mysql_option [â¦]
Ah, right, thanks! Then we likely need something like:
#if (MYSQL_VERSION_ID >= 80021 && !defined(MARIADB_BASE_VERSION)) ||
defined(MYSQLI_USE_MYSQLND)
------------------------------------------------------------------------
[2021-11-26 09:08:11] yury at codescar dot eu
Problem is OS irrelevant, it has to do with mariadb libraries
------------------------------------------------------------------------
[2021-11-26 09:03:15] oliver at erply dot com
Having the same issue with only difference, building on CentOS.
------------------------------------------------------------------------
[2021-11-26 05:49:25] yury at codescar dot eu
>>That versioning is a mess, but can't we just do>> #ifdef MYSQL_OPT_LOAD_DATA_LOCAL_DIR>>here?
MYSQL_OPT_LOAD_DATA_LOCAL_DIR is defined as member of enum mysql_option
(https://github.com/mysql/mysql-server/blob/3290a66c89eb1625a7058e0ef732432b6952b435/include/mysql.h#L213),
so I think the preprocessor won't know anything about it.
------------------------------------------------------------------------
The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
https://bugs.php.net/bug.php?id=81658
--
Edit this bug report at https://bugs.php.net/bug.php?id=81658&edit=1