Skip to contentSkip to conversation

mariadb: deprecate mysql* names

PATCH New [email protected] 1 participant 3 messages Feb 13, 2025

lore
Share & tools
lore
#0 lore raw

PATCH 1/3 mariadb: deprecate mysql* names

From: Changqing Li <[email protected]>

Fix following warnings:
/usr/bin/mysql_install_db: Deprecated program name. It will be removed in a future release, use 'mariadb-install-db' instead

Upstream commit [1] deprecate mysql* names, use the new name to fix above warning

[1] https://github.com/MariaDB/server/commit/b30b040b733ff2045ffcd7bdd44f608c7f4912b5

---
 meta-oe/recipes-dbs/mysql/mariadb/mysql-systemd-start | 4 ++--
 meta-oe/recipes-dbs/mysql/mariadb/mysqld.service      | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)
meta-oe/recipes-dbs/mysql/mariadb/mysql-systemd-start +2 -2
index 189c02021d..b7ae09a4f7 100644
@@ -34,7 +34,7 @@ install_db () {
     [ -d "$datadir/mysql" ] && exit 0
 
     # Create initial db
-    /usr/bin/mysql_install_db --rpm --datadir="$datadir" --user=mysql
+    /usr/bin/mariadb-install-db --rpm --datadir="$datadir" --user=mysql
     exit 0
 }
 
@@ -51,7 +51,7 @@ pinger () {
 
     while /bin/true ; do
         sleep 1
-        mysqladmin --no-defaults --socket="$adminsocket" --user=UNKNOWN_MYSQL_USER ping >/dev/null 2>&1 && break
+        mariadb-admin --no-defaults --socket="$adminsocket" --user=UNKNOWN_MYSQL_USER ping >/dev/null 2>&1 && break
     done
     exit 0
 }
meta-oe/recipes-dbs/mysql/mariadb/mysqld.service +1 -1
index d88361703d..9c47fede1c 100644
@@ -13,7 +13,7 @@ Group=mysql
 PermissionsStartOnly=true
 
 # Start main service
-ExecStart=@BINDIR@/mysqld_safe --basedir=@PREFIX@
+ExecStart=@BINDIR@/mariadbd-safe --basedir=@PREFIX@
 
 # Don't signal startup success before a ping works
 ExecStartPost=@BINDIR@/mysql-systemd-start post
Signature · 1 line
2.34.1
#1 lore raw

PATCH 2/3 mariadb: move /usr/share/mysql to /usr/share/mariadb

From: Changqing Li <[email protected]>

Fix error:
$mariadb-install-db --basedir=/usr
FATAL ERROR: Could not find /usr/share/mariadb/fill_help_tables.sql

Upstream commit [1] move /usr/share/mysql to /usr/share/mariadb, this make related files split into wrong package, and not installed by default, so cause above error

[1] https://github.com/MariaDB/server/commit/320a4b52c9c73a37b3553cec6a9d170924957c36

---
 meta-oe/recipes-dbs/mysql/mariadb.inc | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
meta-oe/recipes-dbs/mysql/mariadb.inc +3 -3
index dae41d89aa..c90e17e129 100644
@@ -186,8 +186,8 @@ do_install() {
     # mini-benchmark used for Gitlab-CI to run on every commit to catch
     # if there are severe performance regressions.
     # remove it to avoid introducing bash dependency
-    if [ -f ${D}${datadir}/mysql/mini-benchmark ]; then
-        rm -rf ${D}${datadir}/mysql/mini-benchmark
+    if [ -f ${D}${datadir}/mariadb/mini-benchmark ]; then
+        rm -rf ${D}${datadir}/mariadb/mini-benchmark
     fi
     if ${@bb.utils.contains('DISTRO_FEATURES', 'pam', 'true', 'false', d)}; then
         pam_so=$(find ${D} -name pam_user_map.so)
@@ -349,7 +349,7 @@ FILES:${PN}-server = "\
     ${libdir}/plugin/*.so \
     ${base_libdir}/security/*.so \
     ${libdir}/plugin/auth_pam_tool_dir/auth_pam_tool \
-    ${datadir}/mysql/ \
+    ${datadir}/mariadb/ \
     ${localstatedir}/mysql/ \
     ${sysconfdir}/init.d/mysqld \
     ${sysconfdir}/my.cnf \
Signature · 1 line
2.34.1
#2 lore raw

PATCH 3/3 mariadb: correct STACK_DIRECTION setting

In reply to [email protected]

From: Changqing Li <[email protected]>

STACK_DIRECTION = 1 means stack grow upwards
STACK_DIRECTION = -1 means stack grow downwards

In the majority of modern architectures, stack grows downwards. So set STACK_DIRECTION = 1 is not right. But the failure is not exposed before, mysqld can start normally, and simple runtime operation like create db, table, select info, works well. But it is exposed after commit [1] is merged, mysqld will start failed with error:

2025-02-12  3:18:19 0 [ERROR] Could not open mysql.plugin table: "Thread stack overrun:  16752824 bytes used of a 299008 byte stack, and 81920 bytes needed

Since commit [2], mariadb started to determine the default STACK_DIRECTION in CMake based on the ISA, and we have set correct CMAKE_SYSTEM_PROCESSOR in cmake.bbclass, so just don't pass it.

[1] https://github.com/MariaDB/server/commit/bddbef3573349b0565c43c27beba47c89358f39f
[2] https://github.com/MariaDB/server/commit/d0abbdf56e11ccc88447c1dc80caaf355c94be3b
[3] https://jira.mariadb.org/browse/MDEV-36051

---
 meta-oe/recipes-dbs/mysql/mariadb.inc | 1 -
 1 file changed, 1 deletion(-)
meta-oe/recipes-dbs/mysql/mariadb.inc +0 -1
index c90e17e129..b620355730 100644
@@ -96,7 +96,6 @@ EXTRA_OECMAKE = "-DWITH_EMBEDDED_SERVER=ON \
                  -DINSTALL_SYSCONFDIR:PATH=${sysconfdir} \
                  -DMYSQL_DATADIR:PATH=/var/mysql \
                  -DCAT_EXECUTABLE=`which cat` \
-                 -DSTACK_DIRECTION=1 \
                  -DHAVE_SYSTEM_LIBFMT_EXITCODE=0 \
                  -DLSTAT_FOLLOWS_SLASHED_SYMLINK_EXITCODE=0 \
                  -DSTAT_EMPTY_STRING_BUG_EXITCODE=0 \
Signature · 1 line
2.34.1