Details
-
Bug
-
Status: Closed (View Workflow)
-
Major
-
Resolution: Fixed
-
3.0.0
-
None
Description
The connector was advertised in the past as a libmysqlclient drop-in replacement.
However you seem to be renaming include files in 3.x which breaks source code compatibility with the majority of programs that was written for that.
It this intended?
Dovecot:
==
driver-mysql.c:24:20: fatal error: errmsg.h: No such file or directory
==
PHP:
==
php-7.0.9/ext/mysqli/php_mysqli_structs.h:63:23: fatal error: my_global.h: No such file or directory
compilation terminated.
==
(yes, I know I could use mysqlnd instead, but that's not the point)
Kodi:
==
mysqldataset.cpp:34:26: fatal error: mysql/errmsg.h: No such file or directory
==
Along with other include file related errors.
E.g. Qt 4, Qt 5 and poco library are missing the definition for my_ulonglong:
==
drivers/mysql/qsql_mysql.cpp:562:5: error: ‘my_ulonglong’ was not declared in this scope
my_ulonglong numRows;
==
../../../sql/drivers/mysql/qsql_mysql.cpp:553:5: error: ‘my_ulonglong’ was not declared in this scope
my_ulonglong numRows;
==
src/StatementExecutor.cpp: In member function ‘void Poco::Data::MySQL::StatementExecutor::execute()’:
src/StatementExecutor.cpp:110:2: error: ‘my_ulonglong’ was not declared in this scope
my_ulonglong affectedRows = mysql_affected_rows(_pSessionHandle);
==
mysql8 drops my_global.h so I think that's ok. Looking at PHP upstream on https://github.com/grooverdan/php-src/commit/32b6d708c93d47730ba340affaf70f10e15bec17
errmsg.h is still in 5.6, 5.7 and 8.0 and not mariadb.
my_ulonglong is in mysql.h in mariadb now, however with a differing definition.
mysql-5.6.49-linux-glibc2.12-x86_64/include/mysql.h
#ifndef MY_GLOBAL_INCLUDED
#if defined(NO_CLIENT_LONG_LONG)
typedef unsigned long my_ulonglong;
#elif defined (__WIN__)
typedef unsigned __int64 my_ulonglong;
#else
typedef unsigned long long my_ulonglong;
#endif
#endif
mariadb-10.5.6/include/mysql/mysql.h
#if !defined (_global_h) && !defined (MY_GLOBAL_INCLUDED) /* If not standard header */
#include <sys/types.h>
typedef char my_bool;
typedef unsigned long long my_ulonglong;
The right on is here however this isn't the included file:
mariadb-10.5.6/include/mysql/server/mysql.h
#ifndef MY_GLOBAL_INCLUDED
#if defined(NO_CLIENT_LONG_LONG)
typedef unsigned long my_ulonglong;
#elif defined (__WIN__)
typedef unsigned __int64 my_ulonglong;
#else
typedef unsigned long long my_ulonglong;
#endif
These differences cause the compile warning:
php-7.3 compile warning
version=mariadb-10.5.6; ../php-src/configure --enable-debug --with-mysqli=/usr/local/$version/bin/mysql_config --with-pdo-mysql=/usr/local/$version
/home/dan/repos/php-src/ext/mysqli/mysqli.c: In function ‘php_mysqli_fetch_into_hash_aux’:
/home/dan/repos/php-src/ext/mysqli/php_mysqli_structs.h:179:25: warning: format ‘%lu’ expects argument of type ‘long unsigned int’, but argument 4 has type ‘my_ulonglong’ {aka ‘long long unsigned int’} [-Wformat=]
179 | #define MYSQLI_LLU_SPEC "%" PRIu64
| ^~~
/home/dan/repos/php-src/ext/mysqli/mysqli.c:1176:94: note: in expansion of macro ‘MYSQLI_LLU_SPEC’
1176 | snprintf(tmp, sizeof(tmp), (mysql_fetch_field_direct(result, i)->flags & UNSIGNED_FLAG)? MYSQLI_LLU_SPEC : MYSQLI_LL_SPEC, llval);
| ^~~~~~~~~~~~~~~
In file included from /home/dan/repos/php-src/main/php_stdint.h:72,
from /home/dan/repos/php-src/Zend/../TSRM/TSRM.h:23,
from /home/dan/repos/php-src/Zend/zend_portability.h:47,
from /home/dan/repos/php-src/Zend/zend_types.h:25,
from /home/dan/repos/php-src/Zend/zend.h:27,
from /home/dan/repos/php-src/main/php.h:33,
from /home/dan/repos/php-src/ext/mysqli/mysqli.c:27:
/usr/include/inttypes.h:105:34: note: format string is defined here
105 | # define PRIu64 __PRI64_PREFIX "u"
In file included from /home/dan/repos/php-src/ext/mysqli/mysqli.c:32:
/home/dan/repos/php-src/ext/mysqli/php_mysqli_structs.h:180:24: warning: format ‘%ld’ expects argument of type ‘long int’, but argument 4 has type ‘my_ulonglong’ {aka ‘long long unsigned int’} [-Wformat=]
180 | #define MYSQLI_LL_SPEC "%" PRId64
| ^~~
/home/dan/repos/php-src/ext/mysqli/mysqli.c:1176:112: note: in expansion of macro ‘MYSQLI_LL_SPEC’
1176 | snprintf(tmp, sizeof(tmp), (mysql_fetch_field_direct(result, i)->flags & UNSIGNED_FLAG)? MYSQLI_LLU_SPEC : MYSQLI_LL_SPEC, llval);
| ^~~~~~~~~~~~~~
In file included from /home/dan/repos/php-src/main/php_stdint.h:72,
from /home/dan/repos/php-src/Zend/../TSRM/TSRM.h:23,
from /home/dan/repos/php-src/Zend/zend_portability.h:47,
from /home/dan/repos/php-src/Zend/zend_types.h:25,
from /home/dan/repos/php-src/Zend/zend.h:27,
from /home/dan/repos/php-src/main/php.h:33,
from /home/dan/repos/php-src/ext/mysqli/mysqli.c:27:
/usr/include/inttypes.h:57:34: note: format string is defined here