Bug #81658 [NEW]: mysql_option MYSQL_OPT_LOAD_DATA_LOCAL_DIR not available in mariadb libraries
From: yury at codescar dot eu
Operating system: Debian 10
PHP version: 8.1.0RC6
Package: Compile Failure
Bug Type: Bug
Bug description:mysql_option MYSQL_OPT_LOAD_DATA_LOCAL_DIR not available in mariadb libraries
Description:
------------
Compiling PHP 8.1.0
(https://www.php.net/distributions/php-8.1.0.tar.bz2) on Debian 10 with
libmariadb packages (10.3.31 version) instead of mysqlnd, fails with
error:
> /tmp/php-8.1.0/ext/mysqli/mysqli.c:600:59: error:
'MYSQL_OPT_LOAD_DATA_LOCAL_DIR' undeclared (first use in this function);
did you mean 'MYSQL_OPT_READ_TIMEOUT'?
REGISTER_LONG_CONSTANT("MYSQLI_OPT_LOAD_DATA_LOCAL_DIR",
MYSQL_OPT_LOAD_DATA_LOCAL_DIR, CONST_CS | CONST_PERSISTENT);
This option was introduced in MySQL 8.0
(https://dev.mysql.com/doc/c-api/8.0/en/mysql-options.html) so there is
a check in the previous line
(https://github.com/php/php-src/blob/php-8.1.0/ext/mysqli/mysqli.c#L599)
> #if MYSQL_VERSION_ID >= 80021 || defined(MYSQLI_USE_MYSQLND)"
Unfortunately, it appears that with libmaria packages (10.3.31)
mysql_get_client_version() returns a value of 100331 (as you can see
from the compiling and running the test script).
Test script:
---------------
#include <stdlib.h>
#include <stdio.h>
#include <mysql.h>
int main(int argc, char **argv)
{
printf("MySQL Client Version %lu\n", mysql_get_client_version());
return EXIT_SUCCESS;
}
Compile: gcc -o testscript test.c mysql_config --cflags --libs
Execute: "MySQL Client Version 100331"
Expected result:
----------------
Being able to compile PHP 8.1.0 with MySQL extensions being compiled
against the MariaDB Client Library
--
Edit bug report at https://bugs.php.net/bug.php?id=81658&edit=1
--
Fix committed: https://bugs.php.net/fix.php?id=81658&r=fixed
Fixed in release: https://bugs.php.net/fix.php?id=81658&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=81658&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=81658&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=81658&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=81658&r=support
Expected behavior: https://bugs.php.net/fix.php?id=81658&r=notwrong
Not enough info: https://bugs.php.net/fix.php?id=81658&r=notenoughinfo
Submitted twice: https://bugs.php.net/fix.php?id=81658&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=81658&r=globals
PHP version support discontinued: https://bugs.php.net/fix.php?id=81658&r=phptooold
Daylight Savings: https://bugs.php.net/fix.php?id=81658&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=81658&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=81658&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=81658&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=81658&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=81658&r=mysqlcfg
Thread (12 messages)
- yury at codescar dot eu
- cmb@php.netBug #81658 [Opn]: mysql_option MYSQL_OPT_LOAD_DATA_LOCAL_DIR not available in mariadb libraries
- yury at codescar dot euBug #81658 [Com]: mysql_option MYSQL_OPT_LOAD_DATA_LOCAL_DIR not available in mariadb libraries
- oliver at erply dot comBug #81658 [Com]: mysql_option MYSQL_OPT_LOAD_DATA_LOCAL_DIR not available in mariadb libraries
- yury at codescar dot euBug #81658 [Opn]: mysql_option MYSQL_OPT_LOAD_DATA_LOCAL_DIR not available in mariadb libraries
- cmb@php.netBug #81658 [Opn]: mysql_option MYSQL_OPT_LOAD_DATA_LOCAL_DIR not available in mariadb libraries
- bugs dot php at osxtra dot devBug #81658 [Com]: mysql_option MYSQL_OPT_LOAD_DATA_LOCAL_DIR not available in mariadb libraries
- git@php.netBug #81658 [Opn->Csd]: mysql_option MYSQL_OPT_LOAD_DATA_LOCAL_DIR not available in mariadb libraries
- php dot bugs at osxtra dot devBug #81658 [Com]: mysql_option MYSQL_OPT_LOAD_DATA_LOCAL_DIR not available in mariadb libraries
- yury at codescar dot euBug #81658 [Com]: mysql_option MYSQL_OPT_LOAD_DATA_LOCAL_DIR not available in mariadb libraries
- oliver at erply dot comBug #81658 [Com]: mysql_option MYSQL_OPT_LOAD_DATA_LOCAL_DIR not available in mariadb libraries
- bugs dot php at osxtra dot devBug #81658 [Com]: mysql_option MYSQL_OPT_LOAD_DATA_LOCAL_DIR not available in mariadb libraries