|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2021-11-25 13:27 UTC] yury at codescar dot eu
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 PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2026 The PHP GroupAll rights reserved. |
Last updated: Thu Jan 29 18:00:01 2026 UTC |
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 […] Ah, right, thanks! Then we likely need something like: #if (MYSQL_VERSION_ID >= 80021 && !defined(MARIADB_BASE_VERSION)) || defined(MYSQLI_USE_MYSQLND)