[MDEV-13455] MariaDB 10.2 (Debian package) - Dangling MySQL compatibility symlinks Created: 2017-08-04  Updated: 2022-04-04  Resolved: 2022-04-04

Status: Closed
Project: MariaDB Server
Component/s: Packaging, Platform Debian
Affects Version/s: 10.2.6
Fix Version/s: N/A

Type: Bug Priority: Major
Reporter: Laurent Declercq Assignee: Tuukka Pasanen
Resolution: Incomplete Votes: 0
Labels: None
Environment:

Debian 9/Stretch



 Description   

Compatibility symlinks for MySQL are broken for both i386/amd64 builds.

For instance, after installing the MariaDB server and client library as usually, including the libmariadb-dev package we get:

root@stretch:~#  LANG=C ls -la /usr/lib/libmysqlclient.so 
lrwxrwxrwx 1 root root 20 May 15 01:20 /usr/lib/libmysqlclient.so -> libmysqlclient.so.18

root@stretch:~#  LANG=C ls -la /usr/lib/libmysqlclient.so.18
ls: cannot access '/usr/lib/libmysqlclient.so.18': No such file or directory

However:

root@stretch:~#  LANG=C ls -la /usr/lib/x86_64-linux-gnu/libmysqlclient*
lrwxrwxrwx 1 root root 15 May 15 01:20 /usr/lib/x86_64-linux-gnu/libmysqlclient.so.18 -> libmariadb.so.3
lrwxrwxrwx 1 root root 15 May 15 01:20 /usr/lib/x86_64-linux-gnu/libmysqlclient.so.19 -> libmariadb.so.3
lrwxrwxrwx 1 root root 15 May 15 01:20 /usr/lib/x86_64-linux-gnu/libmysqlclient.so.20 -> libmariadb.so.3

This pose problem for softwares that build against

Furthermore, with your changes in MariaDB 10.2 client library (you have added your own mariadb_version.h header file), there are now several FTBFS issues with historical projects such as PHP that expect the mysql_version.h header file included in to the mysql.h header file.

See also: https://i-mscp.net/index.php/Thread/17316-MariaDB-10-2-and-PhpSwitcher-3-0-6-Error-with-needed-Packages

Thank you.



 Comments   
Comment by Laurent Declercq [ 2017-08-31 ]

Elena Stepanova?

Could you clarify why you assigned that bug to Ondrey Sury? The bug is in your own MariaDB 10.2 package

Comment by Elena Stepanova [ 2017-08-31 ]

Because we work closely with Debian packagers, strive to synchronize our packaging with them as much as possible, prefer their changes over ours whenever possible, and in general appreciate their advice on Debian-packaging-related matters. oerdnj knows all of that, so he will surely understand why it was assigned to him.

In turn, could you clarify why you are asking? Do you also work on Debian packaging together with oerdnj and others?

Comment by Laurent Declercq [ 2017-08-31 ]

Elena Stepanova

I've asked simply for the following reasons:

  1. For me, the bug was in your own package, not in Debian package but I understand now with your clarifications
  2. I was aware that Ondrey Sury was working on Debian PHP packages but not on Debian MariaDB packages
  3. I had a bad experience recently with Ondry Sury that talk really bad to people when those people are not smart enough for him

About me: I'm not working for Debian directly but I provide an hosting control panel that run under Debian/Ubuntu distributions. Our control panel rely on major softwares such as MySQL/MariaDB, Nginx, Apache, PHP, Dovecot and so on....

I hope that I'm clear enough.

Comment by Laurent Declercq [ 2017-08-31 ]

Elena Stepanova See https://en.wikipedia.org/wiki/I-MSCP for more details.

Comment by Elena Stepanova [ 2017-08-31 ]

Thanks.
In the latest releases (10.1+) a considerable effort has been made, mostly by the Debian packagers, to bring MariaDB's and Debian's packages closer to each other. It simplifies packaging process and further development, ensures that our packages satisfy Debian policies, and also should eventually make it easier to switch from one set of packages to another (we are not there yet, switching from Debian's to MariaDB's and vice versa is still pain). I don't think it would be wise for us to start making changes again without consulting with Debian experts, it will again make packages to diverge.

oerdnj is currently our primary Debian contact for packaging-related issues, thus it is assigned to him. Depending on his advice, we'll either pick some changes from Debian's tree, or make them ourselves.

Comment by Laurent Declercq [ 2017-08-31 ]

Elena Stepanova

Thanks. Your efforts are much appreciated. Also, don't missunderstood me. I really like the involvement and work of Ondry Sury but since last time, I prefer stay away from him to avoid any misunderstanding. This is really sad but that the only way with him. He cannot understand that people are not bots and that as humans, they can do mistakes. I could report him all his mistakes too but I don't like play as such.

Comment by Ondřej Surý (Inactive) [ 2017-11-22 ]

JFTR you are the one who send me email with 'Are you crazy with your changes made without any tests ???' subject... Just saying...

Anyway, both MariaDB 10.2.x is Work In Progress in Debian and merging the work between Debian and MariaDB packages is work in progress... so this will get fixed.

Could you please specify what versions of PHP require mysql_version.h?

Comment by Laurent Declercq [ 2017-11-23 ]

@Ondrey Sury

You're surely referring to my report regarding courier, which I made ~ 2 years ago:
https://bugs.launchpad.net/ubuntu/+source/courier-authlib/+bug/1542174

The fact is that you pushed something without testing first, leading to broken systems. However, I gladly admit that I should not have spoken to you that way, and I apologize for it. In doing so, you are not better. You've surely forgot how you talked to me while I've reported you an issue on github (which you removed after I linked it in twitter), even if after all, the mistake was on my side... And the fact is: You're talking in such way to everyone by surely thinking that you're the best...

As I said before, I like your work, even if we crash together, either due to language barrier, either because we are too passionate. We could continue like this forever but I don't think this will help, isn't it? We are all involved here for the best. We are not here to fight.

Now about the mysql_version.h header file, I'm talking about PHP upstream versions. There are many people still using old PHP versions, or that want build their own PHP versions. You cannot just say: I don't care, there are PHP packages for Debian. For instance, for our project, we are providing a plugin which make users able to install PHP upstream versions (we provide a set of patch of course for compatibility (multi-arch support and so on...).

Regarding the mysql_version.h header, I've added the following patches to solve the issue temporarely. Those are fixing the following issues:

  • Fixed: PHP FTBFS with MariaDB 10.2: 'MYSQL {aka struct st_mysql}

    ' has no member named 'reconnect' (PHP: all versions)

  • Fixed: PHP FTBFS with MariaDB 10.2: Several undeclared identifiers; mysql/mysql_version.h not included (PHP: all versions)

nxw_mariadb_10.2_ftbfs.patch (PHP 5.3)

--- a/ext/mysqli/php_mysqli_structs.h
+++ b/ext/mysqli/php_mysqli_structs.h
@@ -76,6 +76,7 @@
 
 #include <my_sys.h>
 #include <mysql.h>
+#include <mysql_version.h>
 #include <errmsg.h>
 #include <my_list.h>
 #include <m_string.h>
--- a/ext/mysql/php_mysql_structs.h
+++ b/ext/mysql/php_mysql_structs.h
@@ -40,6 +40,7 @@
 #include "mysql_mysqlnd.h"
 #else
 #include <mysql.h>
+#include <mysql_version.h>
 #endif
 
 #ifdef PHP_MYSQL_UNIX_SOCK_ADDR
--- a/ext/pdo_mysql/php_pdo_mysql_int.h
+++ b/ext/pdo_mysql/php_pdo_mysql_int.h
@@ -29,6 +29,7 @@
 #	define PDO_MYSQL_PARAM_BIND MYSQLND_PARAM_BIND
 #else
 #	include <mysql.h>
+#	include <mysql_version.h>
 #	define PDO_MYSQL_PARAM_BIND MYSQL_BIND
 #endif
 
--- a/ext/mysqli/mysqli_nonapi.c
+++ b/ext/mysqli/mysqli_nonapi.c
@@ -258,7 +258,7 @@ void mysqli_common_connect(INTERNAL_FUNC
 	php_mysqli_set_error(mysql_errno(mysql->mysql), (char *) mysql_error(mysql->mysql) TSRMLS_CC);
 
 #if !defined(MYSQLI_USE_MYSQLND)
-	mysql->mysql->reconnect = MyG(reconnect);
+	mysql_options(mysql->mysql, MYSQL_OPT_RECONNECT, (my_bool *)&MyG(reconnect));
 
 	/* set our own local_infile handler */
 	php_set_local_infile_handler_default(mysql);

nxw_mariadb_10.2_ftbfs.patch (PHP 5.4)

--- a/ext/mysqli/php_mysqli_structs.h
+++ b/ext/mysqli/php_mysqli_structs.h
@@ -78,6 +78,7 @@
 
 #include <my_sys.h>
 #include <mysql.h>
+#include <mysql_version.h>
 #include <errmsg.h>
 #include <my_list.h>
 #include <m_string.h>
--- a/ext/mysql/php_mysql_structs.h
+++ b/ext/mysql/php_mysql_structs.h
@@ -40,6 +40,7 @@
 #include "mysql_mysqlnd.h"
 #else
 #include <mysql.h>
+#include <mysql_version.h>
 #endif
 
 #ifdef PHP_MYSQL_UNIX_SOCK_ADDR
--- a/ext/pdo_mysql/php_pdo_mysql_int.h
+++ b/ext/pdo_mysql/php_pdo_mysql_int.h
@@ -29,6 +29,7 @@
 #	define PDO_MYSQL_PARAM_BIND MYSQLND_PARAM_BIND
 #else
 #	include <mysql.h>
+#	include <mysql_version.h>
 #	define PDO_MYSQL_PARAM_BIND MYSQL_BIND
 #endif
 
--- a/ext/mysqli/mysqli_nonapi.c
+++ b/ext/mysqli/mysqli_nonapi.c
@@ -258,7 +258,7 @@ void mysqli_common_connect(INTERNAL_FUNC
 	php_mysqli_set_error(mysql_errno(mysql->mysql), (char *) mysql_error(mysql->mysql) TSRMLS_CC);
 
 #if !defined(MYSQLI_USE_MYSQLND)
-	mysql->mysql->reconnect = MyG(reconnect);
+	mysql_options(mysql->mysql, MYSQL_OPT_RECONNECT, (my_bool *)&MyG(reconnect));
 
 	/* set our own local_infile handler */
 	php_set_local_infile_handler_default(mysql);

nxw_mariadb_10.2_ftbfs.patch (PHP 5.5)

--- a/ext/mysqli/php_mysqli_structs.h
+++ b/ext/mysqli/php_mysqli_structs.h
@@ -78,6 +78,7 @@
 
 #include <my_sys.h>
 #include <mysql.h>
+#include <mysql_version.h>
 #include <errmsg.h>
 #include <my_list.h>
 #include <m_string.h>
--- a/ext/mysql/php_mysql_structs.h
+++ b/ext/mysql/php_mysql_structs.h
@@ -40,6 +40,7 @@
 #include "mysql_mysqlnd.h"
 #else
 #include <mysql.h>
+#include <mysql_version.h>
 #endif
 
 #ifdef PHP_MYSQL_UNIX_SOCK_ADDR
--- a/ext/pdo_mysql/php_pdo_mysql_int.h
+++ b/ext/pdo_mysql/php_pdo_mysql_int.h
@@ -29,6 +29,7 @@
 #	define PDO_MYSQL_PARAM_BIND MYSQLND_PARAM_BIND
 #else
 #	include <mysql.h>
+#	include <mysql_version.h>
 #	define PDO_MYSQL_PARAM_BIND MYSQL_BIND
 #endif
 
--- a/ext/mysqli/mysqli_nonapi.c
+++ b/ext/mysqli/mysqli_nonapi.c
@@ -259,7 +259,7 @@ void mysqli_common_connect(INTERNAL_FUNC
 	php_mysqli_set_error(mysql_errno(mysql->mysql), (char *) mysql_error(mysql->mysql) TSRMLS_CC);
 
 #if !defined(MYSQLI_USE_MYSQLND)
-	mysql->mysql->reconnect = MyG(reconnect);
+	mysql_options(mysql->mysql, MYSQL_OPT_RECONNECT, (my_bool *)&MyG(reconnect));
 #endif
 
 	mysql_options(mysql->mysql, MYSQL_OPT_LOCAL_INFILE, (char *)&MyG(allow_local_infile));

nxw_mariadb_10.2_ftbfs.patch (PHP 5.6)

--- a/ext/mysqli/php_mysqli_structs.h
+++ b/ext/mysqli/php_mysqli_structs.h
@@ -78,6 +78,7 @@
 
 #include <my_sys.h>
 #include <mysql.h>
+#include <mysql_version.h>
 #include <errmsg.h>
 #include <my_list.h>
 #include <m_string.h>
--- a/ext/mysql/php_mysql_structs.h
+++ b/ext/mysql/php_mysql_structs.h
@@ -40,6 +40,7 @@
 #include "mysql_mysqlnd.h"
 #else
 #include <mysql.h>
+#include <mysql_version.h>
 #endif
 
 #ifdef PHP_MYSQL_UNIX_SOCK_ADDR
--- a/ext/pdo_mysql/php_pdo_mysql_int.h
+++ b/ext/pdo_mysql/php_pdo_mysql_int.h
@@ -29,6 +29,7 @@
 #	define PDO_MYSQL_PARAM_BIND MYSQLND_PARAM_BIND
 #else
 #	include <mysql.h>
+#	include <mysql_version.h>
 #	define PDO_MYSQL_PARAM_BIND MYSQL_BIND
 #endif
 
--- a/ext/mysqli/mysqli_nonapi.c
+++ b/ext/mysqli/mysqli_nonapi.c
@@ -261,7 +261,7 @@ void mysqli_common_connect(INTERNAL_FUNC
 	php_mysqli_set_error(mysql_errno(mysql->mysql), (char *) mysql_error(mysql->mysql) TSRMLS_CC);
 
 #if !defined(MYSQLI_USE_MYSQLND)
-	mysql->mysql->reconnect = MyG(reconnect);
+	mysql_options(mysql->mysql, MYSQL_OPT_RECONNECT, (my_bool *)&MyG(reconnect));
 #endif
 
 	mysql_options(mysql->mysql, MYSQL_OPT_LOCAL_INFILE, (char *)&MyG(allow_local_infile));

nxw_mariadb_10.2_ftbfs.patch (PHP 7.0)

---
 ext/mysqli/mysqli_nonapi.c        |    2 +-
 ext/mysqli/php_mysqli_structs.h   |    1 +
 ext/pdo_mysql/php_pdo_mysql_int.h |    1 +
 3 files changed, 3 insertions(+), 1 deletion(-)
 
--- a/ext/mysqli/php_mysqli_structs.h
+++ b/ext/mysqli/php_mysqli_structs.h
@@ -78,6 +78,7 @@
 
 #include <my_sys.h>
 #include <mysql.h>
+#include <mysql_version.h>
 #include <errmsg.h>
 #include <my_list.h>
 #include <m_string.h>
--- a/ext/pdo_mysql/php_pdo_mysql_int.h
+++ b/ext/pdo_mysql/php_pdo_mysql_int.h
@@ -29,6 +29,7 @@
 #	define PDO_MYSQL_PARAM_BIND MYSQLND_PARAM_BIND
 #else
 #	include <mysql.h>
+#	include <mysql_version.h>
 #	define PDO_MYSQL_PARAM_BIND MYSQL_BIND
 #endif
 
--- a/ext/mysqli/mysqli_nonapi.c
+++ b/ext/mysqli/mysqli_nonapi.c
@@ -263,7 +263,7 @@ void mysqli_common_connect(INTERNAL_FUNC
 	php_mysqli_set_error(mysql_errno(mysql->mysql), (char *) mysql_error(mysql->mysql));
 
 #if !defined(MYSQLI_USE_MYSQLND)
-	mysql->mysql->reconnect = MyG(reconnect);
+	mysql_options(mysql->mysql, MYSQL_OPT_RECONNECT, (my_bool *)&MyG(reconnect));
 #endif
 
 	mysql_options(mysql->mysql, MYSQL_OPT_LOCAL_INFILE, (char *)&MyG(allow_local_infile));

nxw_mariadb_10.2_ftbfs.patch (PHP 7.1)

---
 ext/mysqli/mysqli_nonapi.c        |    2 +-
 ext/mysqli/php_mysqli_structs.h   |    1 +
 ext/pdo_mysql/php_pdo_mysql_int.h |    1 +
 3 files changed, 3 insertions(+), 1 deletion(-)
 
--- a/ext/mysqli/php_mysqli_structs.h
+++ b/ext/mysqli/php_mysqli_structs.h
@@ -78,6 +78,7 @@
 
 #include <my_sys.h>
 #include <mysql.h>
+#include <mysql_version.h>
 #include <errmsg.h>
 #include <my_list.h>
 #include <m_string.h>
--- a/ext/pdo_mysql/php_pdo_mysql_int.h
+++ b/ext/pdo_mysql/php_pdo_mysql_int.h
@@ -29,6 +29,7 @@
 #	define PDO_MYSQL_PARAM_BIND MYSQLND_PARAM_BIND
 #else
 #	include <mysql.h>
+#	include <mysql_version.h>
 #	define PDO_MYSQL_PARAM_BIND MYSQL_BIND
 #endif
 
--- a/ext/mysqli/mysqli_nonapi.c
+++ b/ext/mysqli/mysqli_nonapi.c
@@ -263,7 +263,7 @@ void mysqli_common_connect(INTERNAL_FUNC
 	php_mysqli_set_error(mysql_errno(mysql->mysql), (char *) mysql_error(mysql->mysql));
 
 #if !defined(MYSQLI_USE_MYSQLND)
-	mysql->mysql->reconnect = MyG(reconnect);
+	mysql_options(mysql->mysql, MYSQL_OPT_RECONNECT, (my_bool *)&MyG(reconnect));
 #endif
 
 	mysql_options(mysql->mysql, MYSQL_OPT_LOCAL_INFILE, (char *)&MyG(allow_local_infile));

Comment by Ondřej Surý (Inactive) [ 2017-11-24 ]

> We are not here to fight.

And yet, you are still the one that attacks me and spews hate.

Anyway, thanks for the detailed report on the incompatibility of the compatibility layer. I'll look at the mysql_version.h and ->reconnect problem in mariadb-connector-c library, as I am now working on uploading MariaDB 10.2 to Debian.

Comment by Laurent Declercq [ 2017-11-24 ]

@ondrey sury

> spews hate.

Really? You become ridiculous. I've not any hate against you so please stop to play like a victim. My answer was just to clarify the situation, nothing more.

Thank for your works.

Comment by Tuukka Pasanen [ 2022-03-21 ]

Is this bug problem anymore?

Generated at Thu Feb 08 08:05:43 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.