diff --git a/0000-disable-some-unstable-testcases.patch b/0000-disable-some-unstable-testcases.patch deleted file mode 100644 index fae887c4c4f6306c0c9f50998780d0f4d91a36af..0000000000000000000000000000000000000000 --- a/0000-disable-some-unstable-testcases.patch +++ /dev/null @@ -1,81 +0,0 @@ -From ea4fbf5f164c60f736a5e987478dd1a4fc976371 Mon Sep 17 00:00:00 2001 -From: eulerstorage -Date: Mon, 13 Jan 2020 17:35:50 +0800 -Subject: [PATCH] Disable some unstable testcase - -Some testcases are unstable, they will fail if the test environment -is not suitable, for example network is broken. ---- - mysql-test/unstable-tests | 14 ++++++++++++++ - 1 file changed, 14 insertions(+) - -diff --git a/mysql-test/unstable-tests b/mysql-test/unstable-tests -index 2c28c9a..9ea0ebc 100644 ---- a/mysql-test/unstable-tests -+++ b/mysql-test/unstable-tests -@@ -262,6 +262,7 @@ innodb.truncate_purge_debug : Include fil - innodb.update_time : MDEV-14804 - Wrong result - innodb.undo_log : Include file modified in 10.2.17, 10.3.9 - innodb.xa_recovery : MDEV-15279 - mysqld got exception -+innodb.innodb_defrag_binlog : - - #----------------------------------------------------------------------- - -@@ -389,6 +390,8 @@ main.mysql_upgrade_noengine : MDEV-14355 - main.mysql_upgrade_ssl : MDEV-13492 - Unknown SSL error - main.olap : Modified in 10.3.8 - main.openssl_1 : MDEV-13492 - Unknown SSL error -+main.openssl_6975 : -+main.ssl_cipher : - main.order_by_optimizer_innodb : MDEV-10683 - Wrong result - main.partition_debug_sync : MDEV-15669 - Deadlock found when trying to get lock - main.partition_innodb_plugin : MDEV-12901 - Valgrind warnings -@@ -418,6 +421,11 @@ main.ssl_ca : MDEV-10895 - main.ssl_cert_verify : MDEV-13735 - Server crash - main.ssl_connect : MDEV-13492 - Unknown SSL error - main.ssl_timeout : MDEV-11244 - Crash -+main.ssl_7937 : -+main.ssl_crl_clients : -+main.ssl_8k_key : -+main.ssl : -+main.ssl_cipher : - main.statistics_close : Added in 10.3.8 - main.statistics : Modified in 10.3.8 - main.stat_tables : Modified in 10.1.35, 10.2.17, 10.3.9 -@@ -523,6 +531,7 @@ parts.partition_exch_qa_10 : MDEV-11765 - parts.partition_innodb_status_file : MDEV-12901 - Valgrind - parts.partition_special_innodb : MDEV-16942 - Timeout - parts.truncate_locked : Added in 10.1.35, 10.2.17, 10.3.9 -+parts.partition_alter4_innodb : - - #----------------------------------------------------------------------- - -@@ -549,6 +558,9 @@ perfschema.stage_mdl_global : MDEV-11803 - perfschema.stage_mdl_procedure : MDEV-11545 - Missing row - perfschema.stage_mdl_table : MDEV-12638 - Wrong result - perfschema.threads_mysql : MDEV-10677 - Wrong result -+perfschema.nesting : -+perfschema.socket_summary_by_instance_func : -+perfschema.cnf_option : - - #----------------------------------------------------------------------- - -@@ -716,6 +728,7 @@ rpl.rpl_temporary_error2 : MDEV-10634 - rpl.sec_behind_master-5114 : MDEV-13878 - Wrong result - - rpl/extra/rpl_tests.* : MDEV-10994 - Not maintained -+rpl.rpl_connection : - - #----------------------------------------------------------------------- - -@@ -769,6 +782,7 @@ sys_vars.slow_query_log_func : MDEV-14273 - sys_vars.sysvars_innodb : Modified in 10.3.8 - sys_vars.thread_cache_size_func : MDEV-11775 - Wrong result - sys_vars.wait_timeout_func : MDEV-12896 - Wrong result -+sys_vars.slave_parallel_threads_basic : - - #----------------------------------------------------------------------- - --- -1.8.3.1 - diff --git a/0001-add-install-db-command.patch b/0001-add-install-db-command.patch deleted file mode 100644 index 2a530493d90976e4cef2636c6bdc9b80c3c8f10c..0000000000000000000000000000000000000000 --- a/0001-add-install-db-command.patch +++ /dev/null @@ -1,25 +0,0 @@ -From 22caf578e446809de75555ec8252f09da50c8db1 Mon Sep 17 00:00:00 2001 -From: eulerstorage -Date: Sun, 19 Jan 2020 22:54:38 +0800 -Subject: [PATCH] add mysql install db command - ---- - support-files/mariadb.service.in | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/support-files/mariadb.service.in b/support-files/mariadb.service.in -index 8d43b6d..56ccb1a 100644 ---- a/support-files/mariadb.service.in -+++ b/support-files/mariadb.service.in -@@ -73,7 +73,7 @@ ExecStartPre=/bin/sh -c "[ ! -e @bindir@/galera_recovery ] && VAR= || \ - && systemctl set-environment _WSREP_START_POSITION=$VAR || exit 1" - - # Needed to create system tables etc. --# ExecStartPre=@scriptdir@/mysql_install_db -u mysql -+ExecStartPre=@scriptdir@/mysql_install_db --user="mysql" --skip-test-db - - # Start main service - # MYSQLD_OPTS here is for users to set in /etc/systemd/system/mariadb.service.d/MY_SPECIAL.conf --- -1.8.3.1 - diff --git a/0002-disable-some-unstable-testcases-2.patch b/0002-disable-some-unstable-testcases-2.patch deleted file mode 100644 index 0a2441717b2af2cc415f6d49cc1d27c0a3198a27..0000000000000000000000000000000000000000 --- a/0002-disable-some-unstable-testcases-2.patch +++ /dev/null @@ -1,38 +0,0 @@ -From bc8fd081680454b6b29cac8feb6774fd60b37eb5 Mon Sep 17 00:00:00 2001 -From: eulerstorage -Date: Tue, 3 Mar 2020 17:24:08 +0800 -Subject: [PATCH] skip some unstable test cases - ---- - mysql-test/unstable-tests | 3 +++ - 1 file changed, 3 insertions(+) - -diff --git a/mysql-test/unstable-tests b/mysql-test/unstable-tests -index 9ea0ebc..99a328b 100644 ---- a/mysql-test/unstable-tests -+++ b/mysql-test/unstable-tests -@@ -41,6 +41,7 @@ binlog.binlog_flush_binlogs_delete_domain : MDEV-14431 - binlog.binlog_killed : MDEV-12925 - Wrong result - binlog.binlog_tmp_table_row : Added in 10.1.35, 10.2.17 - binlog.binlog_xa_recover : MDEV-8517 - Extra checkpoint -+binlog.binlog_mysqlbinlog2 : Skip on ARM - binlog.load_data_stm_view : MDEV-16948 - Wrong result - binlog_tmp_table_row : Added in 10.3.9 - -@@ -346,11 +347,13 @@ main.events_2 : MDEV-13277 - main.events_bugs : MDEV-12892 - Crash - main.events_restart : MDEV-12236 - Server shutdown problem - main.events_slowlog : MDEV-12821 - Wrong result -+main.events_1 : Skip on ARM - main.explain_slowquerylog : Modified in 10.2.16 - main.func_json : Modified in 10.3.9 - main.func_misc : Modified in 10.3.8 - main.func_time_hires : Modified in 10.3.8 - main.func_time : Modified in 10.3.9 -+main.func_like : Skip on ARM - main.gis : MDEV-13411 - wrong result on P8 - main.grant2 : Modified in 10.3.8 - main.grant : Modified in 10.3.9 --- -1.8.3.1 - diff --git a/CVE-2021-27928.patch b/CVE-2021-27928.patch deleted file mode 100644 index a7be8b5e3134fc638aa397e9108d87ab92a16d44..0000000000000000000000000000000000000000 --- a/CVE-2021-27928.patch +++ /dev/null @@ -1,582 +0,0 @@ -diff --git a/mysql-test/suite/galera/disabled.def b/mysql-test/suite/galera/disabled.def -index c3b5e070158..6d9e198271c 100644 ---- a/mysql-test/suite/galera/disabled.def -+++ b/mysql-test/suite/galera/disabled.def -@@ -37,3 +37,4 @@ galera_ist_progress: MDEV-15236 galera_ist_progress fails when trying to read tr - galera_concurrent_ctas : MDEV-15845 Test failure on galera.galera_concurrent_ctas - pxc-421: Lock timeout exceeded - galera_sst_mysqldump_with_key : MDEV-16890 Galera test failure -+pxc-421: wsrep_provider is read-only for security reasons -diff --git a/mysql-test/suite/galera/include/galera_load_provider.inc b/mysql-test/suite/galera/include/galera_load_provider.inc -index aeab7e6ea19..e6ce6411193 100644 ---- a/mysql-test/suite/galera/include/galera_load_provider.inc -+++ b/mysql-test/suite/galera/include/galera_load_provider.inc -@@ -1,7 +1,6 @@ - --echo Loading wsrep provider ... - - --disable_query_log ----eval SET GLOBAL wsrep_provider = '$wsrep_provider_orig'; - --eval SET GLOBAL wsrep_cluster_address = '$wsrep_cluster_address_orig'; - --enable_query_log - -diff --git a/mysql-test/suite/galera/include/galera_unload_provider.inc b/mysql-test/suite/galera/include/galera_unload_provider.inc -index edc7eb31e0e..83438a947f0 100644 ---- a/mysql-test/suite/galera/include/galera_unload_provider.inc -+++ b/mysql-test/suite/galera/include/galera_unload_provider.inc -@@ -1,7 +1,6 @@ - --echo Unloading wsrep provider ... - - --let $wsrep_cluster_address_orig = `SELECT @@wsrep_cluster_address` ----let $wsrep_provider_orig = `SELECT @@wsrep_provider` - --let $wsrep_provider_options_orig = `SELECT @@wsrep_provider_options` - --SET GLOBAL wsrep_provider = 'none'; -+SET GLOBAL wsrep_cluster_address = ''; -diff --git a/mysql-test/suite/galera/r/galera_ist_rsync.result b/mysql-test/suite/galera/r/galera_ist_rsync.result -index 9c0d78d96e9..16d13ef261f 100644 ---- a/mysql-test/suite/galera/r/galera_ist_rsync.result -+++ b/mysql-test/suite/galera/r/galera_ist_rsync.result -@@ -21,7 +21,7 @@ INSERT INTO t1 VALUES ('node2_committed_before'); - INSERT INTO t1 VALUES ('node2_committed_before'); - COMMIT; - Unloading wsrep provider ... --SET GLOBAL wsrep_provider = 'none'; -+SET GLOBAL wsrep_cluster_address = ''; - connection node_1; - SET AUTOCOMMIT=OFF; - START TRANSACTION; -diff --git a/mysql-test/suite/galera/r/galera_sst_mysqldump.result b/mysql-test/suite/galera/r/galera_sst_mysqldump.result -index 5c530c32ce6..6bdc933a9fc 100644 ---- a/mysql-test/suite/galera/r/galera_sst_mysqldump.result -+++ b/mysql-test/suite/galera/r/galera_sst_mysqldump.result -@@ -30,7 +30,7 @@ INSERT INTO t1 VALUES ('node2_committed_before'); - INSERT INTO t1 VALUES ('node2_committed_before'); - COMMIT; - Unloading wsrep provider ... --SET GLOBAL wsrep_provider = 'none'; -+SET GLOBAL wsrep_cluster_address = ''; - connection node_1; - SET AUTOCOMMIT=OFF; - START TRANSACTION; -diff --git a/mysql-test/suite/galera/r/mysql-wsrep#33.result b/mysql-test/suite/galera/r/mysql-wsrep#33.result -index 6a5251204b9..4cc49c0cf07 100644 ---- a/mysql-test/suite/galera/r/mysql-wsrep#33.result -+++ b/mysql-test/suite/galera/r/mysql-wsrep#33.result -@@ -30,7 +30,7 @@ INSERT INTO t1 VALUES ('node2_committed_before'); - INSERT INTO t1 VALUES ('node2_committed_before'); - COMMIT; - Unloading wsrep provider ... --SET GLOBAL wsrep_provider = 'none'; -+SET GLOBAL wsrep_cluster_address = ''; - connection node_1; - SET AUTOCOMMIT=OFF; - START TRANSACTION; -diff --git a/mysql-test/suite/sys_vars/r/sysvars_wsrep.result b/mysql-test/suite/sys_vars/r/sysvars_wsrep.result -index db932ae8223..921172920f1 100644 ---- a/mysql-test/suite/sys_vars/r/sysvars_wsrep.result -+++ b/mysql-test/suite/sys_vars/r/sysvars_wsrep.result -@@ -335,7 +335,7 @@ NUMERIC_MIN_VALUE NULL - NUMERIC_MAX_VALUE NULL - NUMERIC_BLOCK_SIZE NULL - ENUM_VALUE_LIST NULL --READ_ONLY NO -+READ_ONLY YES - COMMAND_LINE_ARGUMENT REQUIRED - VARIABLE_NAME WSREP_ON - SESSION_VALUE OFF -@@ -391,7 +391,7 @@ NUMERIC_MIN_VALUE NULL - NUMERIC_MAX_VALUE NULL - NUMERIC_BLOCK_SIZE NULL - ENUM_VALUE_LIST NULL --READ_ONLY NO -+READ_ONLY YES - COMMAND_LINE_ARGUMENT REQUIRED - VARIABLE_NAME WSREP_PROVIDER_OPTIONS - SESSION_VALUE NULL -diff --git a/mysql-test/suite/sys_vars/r/wsrep_notify_cmd_basic.result b/mysql-test/suite/sys_vars/r/wsrep_notify_cmd_basic.result -deleted file mode 100644 -index 056ff8c817b..00000000000 ---- a/mysql-test/suite/sys_vars/r/wsrep_notify_cmd_basic.result -+++ /dev/null -@@ -1,47 +0,0 @@ --# --# wsrep_notify_cmd --# --call mtr.add_suppression("WSREP: Failed to get provider options"); --# save the initial value --SET @wsrep_notify_cmd_global_saved = @@global.wsrep_notify_cmd; --# default --SELECT @@global.wsrep_notify_cmd; --@@global.wsrep_notify_cmd -- -- --# scope --SELECT @@session.wsrep_notify_cmd; --ERROR HY000: Variable 'wsrep_notify_cmd' is a GLOBAL variable --SET @@global.wsrep_notify_cmd='notify_cmd'; --SELECT @@global.wsrep_notify_cmd; --@@global.wsrep_notify_cmd --notify_cmd -- --# valid values --SET @@global.wsrep_notify_cmd='command'; --SELECT @@global.wsrep_notify_cmd; --@@global.wsrep_notify_cmd --command --SET @@global.wsrep_notify_cmd='hyphenated-command'; --SELECT @@global.wsrep_notify_cmd; --@@global.wsrep_notify_cmd --hyphenated-command --SET @@global.wsrep_notify_cmd=default; --SELECT @@global.wsrep_notify_cmd; --@@global.wsrep_notify_cmd -- --SET @@global.wsrep_notify_cmd=NULL; --SELECT @@global.wsrep_notify_cmd; --@@global.wsrep_notify_cmd --NULL -- --# invalid values --SET @@global.wsrep_notify_cmd=1; --ERROR 42000: Incorrect argument type to variable 'wsrep_notify_cmd' --SELECT @@global.wsrep_notify_cmd; --@@global.wsrep_notify_cmd --NULL -- --# restore the initial value --SET @@global.wsrep_notify_cmd = @wsrep_notify_cmd_global_saved; --# End of test -diff --git a/mysql-test/suite/sys_vars/r/wsrep_provider_basic.result b/mysql-test/suite/sys_vars/r/wsrep_provider_basic.result -deleted file mode 100644 -index 3e4ac8ca883..00000000000 ---- a/mysql-test/suite/sys_vars/r/wsrep_provider_basic.result -+++ /dev/null -@@ -1,40 +0,0 @@ --# --# wsrep_provider --# --# save the initial value --SET @wsrep_provider_global_saved = @@global.wsrep_provider; --# default --SELECT @@global.wsrep_provider; --@@global.wsrep_provider --none -- --# scope --SELECT @@session.wsrep_provider; --ERROR HY000: Variable 'wsrep_provider' is a GLOBAL variable --SELECT @@global.wsrep_provider; --@@global.wsrep_provider --none -- --# valid values --SET @@global.wsrep_provider=default; --SELECT @@global.wsrep_provider; --@@global.wsrep_provider --none -- --# invalid values --SET @@global.wsrep_provider='/invalid/libgalera_smm.so'; --ERROR 42000: Variable 'wsrep_provider' can't be set to the value of '/invalid/libgalera_smm.so' --SET @@global.wsrep_provider=NULL; --ERROR 42000: Variable 'wsrep_provider' can't be set to the value of 'NULL' --SELECT @@global.wsrep_provider; --@@global.wsrep_provider --none --SET @@global.wsrep_provider=1; --ERROR 42000: Incorrect argument type to variable 'wsrep_provider' --SELECT @@global.wsrep_provider; --@@global.wsrep_provider --none -- --# restore the initial value --SET @@global.wsrep_provider = @wsrep_provider_global_saved; --# End of test -diff --git a/mysql-test/suite/sys_vars/r/wsrep_provider_options_basic.result b/mysql-test/suite/sys_vars/r/wsrep_provider_options_basic.result -deleted file mode 100644 -index b2e07c55b38..00000000000 ---- a/mysql-test/suite/sys_vars/r/wsrep_provider_options_basic.result -+++ /dev/null -@@ -1,49 +0,0 @@ --# --# wsrep_provider_options --# --call mtr.add_suppression("WSREP: Failed to get provider options"); --SET @@global.wsrep_provider = @@global.wsrep_provider; --# save the initial value --SET @wsrep_provider_options_global_saved = @@global.wsrep_provider_options; --# default --SELECT @@global.wsrep_provider_options; --@@global.wsrep_provider_options -- -- --# scope --SELECT @@session.wsrep_provider_options; --ERROR HY000: Variable 'wsrep_provider_options' is a GLOBAL variable --SET @@global.wsrep_provider_options='option1'; --SELECT @@global.wsrep_provider_options; --@@global.wsrep_provider_options --option1 -- --# valid values --SET @@global.wsrep_provider_options='name1=value1;name2=value2'; --SELECT @@global.wsrep_provider_options; --@@global.wsrep_provider_options --name1=value1;name2=value2 --SET @@global.wsrep_provider_options='hyphenated-name:value'; --SELECT @@global.wsrep_provider_options; --@@global.wsrep_provider_options --hyphenated-name:value --SET @@global.wsrep_provider_options=default; --SELECT @@global.wsrep_provider_options; --@@global.wsrep_provider_options -- -- --# invalid values --SET @@global.wsrep_provider_options=1; --ERROR 42000: Incorrect argument type to variable 'wsrep_provider_options' --SELECT @@global.wsrep_provider_options; --@@global.wsrep_provider_options -- --SET @@global.wsrep_provider_options=NULL; --Got one of the listed errors --SELECT @@global.wsrep_provider_options; --@@global.wsrep_provider_options --NULL -- --# restore the initial value --SET @@global.wsrep_provider_options = @wsrep_provider_options_global_saved; --# End of test -diff --git a/mysql-test/suite/sys_vars/t/wsrep_notify_cmd_basic.test b/mysql-test/suite/sys_vars/t/wsrep_notify_cmd_basic.test -deleted file mode 100644 -index 6d1535ba148..00000000000 ---- a/mysql-test/suite/sys_vars/t/wsrep_notify_cmd_basic.test -+++ /dev/null -@@ -1,43 +0,0 @@ ----source include/have_wsrep.inc -- ----echo # ----echo # wsrep_notify_cmd ----echo # -- --call mtr.add_suppression("WSREP: Failed to get provider options"); -- ----echo # save the initial value --SET @wsrep_notify_cmd_global_saved = @@global.wsrep_notify_cmd; -- ----echo # default --SELECT @@global.wsrep_notify_cmd; -- ----echo ----echo # scope ----error ER_INCORRECT_GLOBAL_LOCAL_VAR --SELECT @@session.wsrep_notify_cmd; --SET @@global.wsrep_notify_cmd='notify_cmd'; --SELECT @@global.wsrep_notify_cmd; -- ----echo ----echo # valid values --SET @@global.wsrep_notify_cmd='command'; --SELECT @@global.wsrep_notify_cmd; --SET @@global.wsrep_notify_cmd='hyphenated-command'; --SELECT @@global.wsrep_notify_cmd; --SET @@global.wsrep_notify_cmd=default; --SELECT @@global.wsrep_notify_cmd; --SET @@global.wsrep_notify_cmd=NULL; --SELECT @@global.wsrep_notify_cmd; -- ----echo ----echo # invalid values ----error ER_WRONG_TYPE_FOR_VAR --SET @@global.wsrep_notify_cmd=1; --SELECT @@global.wsrep_notify_cmd; -- ----echo ----echo # restore the initial value --SET @@global.wsrep_notify_cmd = @wsrep_notify_cmd_global_saved; -- ----echo # End of test -diff --git a/mysql-test/suite/sys_vars/t/wsrep_provider_basic.test b/mysql-test/suite/sys_vars/t/wsrep_provider_basic.test -deleted file mode 100644 -index 1190ab41bb0..00000000000 ---- a/mysql-test/suite/sys_vars/t/wsrep_provider_basic.test -+++ /dev/null -@@ -1,39 +0,0 @@ ----source include/have_wsrep.inc -- ----echo # ----echo # wsrep_provider ----echo # -- ----echo # save the initial value --SET @wsrep_provider_global_saved = @@global.wsrep_provider; -- ----echo # default --SELECT @@global.wsrep_provider; -- ----echo ----echo # scope ----error ER_INCORRECT_GLOBAL_LOCAL_VAR --SELECT @@session.wsrep_provider; --SELECT @@global.wsrep_provider; -- ----echo ----echo # valid values --SET @@global.wsrep_provider=default; --SELECT @@global.wsrep_provider; -- ----echo ----echo # invalid values ----error ER_WRONG_VALUE_FOR_VAR --SET @@global.wsrep_provider='/invalid/libgalera_smm.so'; ----error ER_WRONG_VALUE_FOR_VAR --SET @@global.wsrep_provider=NULL; --SELECT @@global.wsrep_provider; ----error ER_WRONG_TYPE_FOR_VAR --SET @@global.wsrep_provider=1; --SELECT @@global.wsrep_provider; -- ----echo ----echo # restore the initial value --SET @@global.wsrep_provider = @wsrep_provider_global_saved; -- ----echo # End of test -diff --git a/mysql-test/suite/sys_vars/t/wsrep_provider_options_basic.test b/mysql-test/suite/sys_vars/t/wsrep_provider_options_basic.test -deleted file mode 100644 -index d2ea32a0637..00000000000 ---- a/mysql-test/suite/sys_vars/t/wsrep_provider_options_basic.test -+++ /dev/null -@@ -1,51 +0,0 @@ ----source include/have_wsrep.inc -- ----echo # ----echo # wsrep_provider_options ----echo # -- --call mtr.add_suppression("WSREP: Failed to get provider options"); -- --SET @@global.wsrep_provider = @@global.wsrep_provider; -- ----echo # save the initial value --SET @wsrep_provider_options_global_saved = @@global.wsrep_provider_options; -- ----echo # default --SELECT @@global.wsrep_provider_options; -- ----echo ----echo # scope ----error ER_INCORRECT_GLOBAL_LOCAL_VAR --SELECT @@session.wsrep_provider_options; ----error 0,ER_WRONG_ARGUMENTS --SET @@global.wsrep_provider_options='option1'; --SELECT @@global.wsrep_provider_options; -- ----echo ----echo # valid values ----error 0,ER_WRONG_ARGUMENTS --SET @@global.wsrep_provider_options='name1=value1;name2=value2'; --SELECT @@global.wsrep_provider_options; ----error 0,ER_WRONG_ARGUMENTS --SET @@global.wsrep_provider_options='hyphenated-name:value'; --SELECT @@global.wsrep_provider_options; ----error 0,ER_WRONG_ARGUMENTS --SET @@global.wsrep_provider_options=default; --SELECT @@global.wsrep_provider_options; -- ----echo ----echo # invalid values ----error ER_WRONG_TYPE_FOR_VAR --SET @@global.wsrep_provider_options=1; --SELECT @@global.wsrep_provider_options; ----error ER_WRONG_ARGUMENTS,ER_WRONG_ARGUMENTS --SET @@global.wsrep_provider_options=NULL; --SELECT @@global.wsrep_provider_options; -- ----echo ----echo # restore the initial value ----error 0,ER_WRONG_ARGUMENTS --SET @@global.wsrep_provider_options = @wsrep_provider_options_global_saved; -- ----echo # End of test -diff --git a/mysql-test/suite/wsrep/disabled.def b/mysql-test/suite/wsrep/disabled.def -index c7c8f2c6216..b5304b1c992 100644 ---- a/mysql-test/suite/wsrep/disabled.def -+++ b/mysql-test/suite/wsrep/disabled.def -@@ -1,2 +1,4 @@ - wsrep.foreign_key : Sporadic failure "WSREP has not yet prepared node for application use" - -+ -+mdev_6832: wsrep_provider is read-only for security reasons -diff --git a/mysql-test/suite/wsrep/r/variables.result b/mysql-test/suite/wsrep/r/variables.result -index b6f22828532..c944af8c90d 100644 ---- a/mysql-test/suite/wsrep/r/variables.result -+++ b/mysql-test/suite/wsrep/r/variables.result -@@ -13,7 +13,6 @@ SET SESSION wsrep_replicate_myisam= ON; - ERROR HY000: Variable 'wsrep_replicate_myisam' is a GLOBAL variable and should be set with SET GLOBAL - SET GLOBAL wsrep_replicate_myisam= ON; - SET GLOBAL wsrep_replicate_myisam= OFF; --SET GLOBAL wsrep_provider=none; - # - # MDEV#5790: SHOW GLOBAL STATUS LIKE does not show the correct list of - # variables when using "_" -@@ -134,10 +133,6 @@ wsrep_local_state_comment # - # Should show nothing. - SHOW STATUS LIKE 'x'; - Variable_name Value --SET GLOBAL wsrep_provider=none; --# --# MDEV#6079: xtrabackup SST failing with maria-10.0-galera --# - - SHOW STATUS LIKE 'wsrep_local_state_uuid'; - Variable_name Value -@@ -146,7 +141,6 @@ wsrep_local_state_uuid # - SHOW STATUS LIKE 'wsrep_last_committed'; - Variable_name Value - wsrep_last_committed # --SET GLOBAL wsrep_provider=none; - - # - # MDEV#6206: wsrep_slave_threads subtracts from max_connections -@@ -160,30 +154,29 @@ SELECT @@global.wsrep_slave_threads; - 1 - SELECT @@global.wsrep_cluster_address; - @@global.wsrep_cluster_address -- -+gcomm:// - SHOW STATUS LIKE 'threads_connected'; - Variable_name Value - Threads_connected 1 - SHOW STATUS LIKE 'wsrep_thread_count'; - Variable_name Value --wsrep_thread_count 0 -+wsrep_thread_count 2 - - SELECT @@global.wsrep_provider; - @@global.wsrep_provider - libgalera_smm.so - SELECT @@global.wsrep_cluster_address; - @@global.wsrep_cluster_address -- -+gcomm:// - SHOW STATUS LIKE 'threads_connected'; - Variable_name Value - Threads_connected 1 - SHOW STATUS LIKE 'wsrep_thread_count'; - Variable_name Value --wsrep_thread_count 0 -+wsrep_thread_count 2 - - # Setting wsrep_cluster_address triggers the creation of - # applier/rollbacker threads. --SET GLOBAL wsrep_cluster_address= 'gcomm://'; - # Wait for applier threads to get created. - SELECT @@global.wsrep_provider; - @@global.wsrep_provider -diff --git a/mysql-test/suite/wsrep/t/variables.test b/mysql-test/suite/wsrep/t/variables.test -index 1315f090d5c..867af600817 100644 ---- a/mysql-test/suite/wsrep/t/variables.test -+++ b/mysql-test/suite/wsrep/t/variables.test -@@ -18,7 +18,7 @@ SET GLOBAL wsrep_replicate_myisam= ON; - - # Reset it back. - SET GLOBAL wsrep_replicate_myisam= OFF; --SET GLOBAL wsrep_provider=none; -+#SET GLOBAL wsrep_provider=none; - - --echo # - --echo # MDEV#5790: SHOW GLOBAL STATUS LIKE does not show the correct list of -@@ -27,11 +27,9 @@ SET GLOBAL wsrep_provider=none; - - CALL mtr.add_suppression("WSREP: Could not open saved state file for reading.*"); - ----disable_query_log --eval SET GLOBAL wsrep_provider= '$WSREP_PROVIDER'; ----let $galera_version=25.3.17 -+#evalp SET GLOBAL wsrep_provider= '$WSREP_PROVIDER'; -+--let $galera_version=25.3.24 - source include/check_galera_version.inc; ----enable_query_log - - --replace_column 2 # - SHOW GLOBAL STATUS LIKE 'wsrep%'; -@@ -47,15 +45,13 @@ SHOW GLOBAL STATUS LIKE 'wsrep_local_state_comment'; - SHOW STATUS LIKE 'x'; - - # Reset it back. --SET GLOBAL wsrep_provider=none; -+#SET GLOBAL wsrep_provider=none; - - --echo # - --echo # MDEV#6079: xtrabackup SST failing with maria-10.0-galera - --echo # - ----disable_query_log --eval SET GLOBAL wsrep_provider= '$WSREP_PROVIDER'; ----enable_query_log -+#evalp SET GLOBAL wsrep_provider= '$WSREP_PROVIDER'; - - # The following 2 variables are used in innobackupex during xtrabackup-based - # SST. -@@ -67,7 +63,7 @@ SHOW STATUS LIKE 'wsrep_local_state_uuid'; - SHOW STATUS LIKE 'wsrep_last_committed'; - - # Reset it back. --SET GLOBAL wsrep_provider=none; -+#SET GLOBAL wsrep_provider=none; - - --echo - --echo # -@@ -75,9 +71,7 @@ SET GLOBAL wsrep_provider=none; - --echo # - call mtr.add_suppression("WSREP: Failed to get provider options"); - ----disable_query_log --eval SET GLOBAL wsrep_provider= '$WSREP_PROVIDER'; ----enable_query_log -+#evalp SET GLOBAL wsrep_provider= '$WSREP_PROVIDER'; - - --replace_regex /.*libgalera_smm.*/libgalera_smm.so/ - SELECT @@global.wsrep_provider; -@@ -87,9 +81,7 @@ SHOW STATUS LIKE 'threads_connected'; - SHOW STATUS LIKE 'wsrep_thread_count'; - --echo - ----disable_query_log --eval SET GLOBAL wsrep_provider= '$WSREP_PROVIDER'; ----enable_query_log -+#evalp SET GLOBAL wsrep_provider= '$WSREP_PROVIDER'; - - --replace_regex /.*libgalera_smm.*/libgalera_smm.so/ - SELECT @@global.wsrep_provider; -@@ -100,7 +92,7 @@ SHOW STATUS LIKE 'wsrep_thread_count'; - - --echo # Setting wsrep_cluster_address triggers the creation of - --echo # applier/rollbacker threads. --SET GLOBAL wsrep_cluster_address= 'gcomm://'; -+#SET GLOBAL wsrep_cluster_address= 'gcomm://'; - --echo # Wait for applier threads to get created. - sleep 3; - -diff --git a/sql/sys_vars.cc b/sql/sys_vars.cc -index 8858259c863..90ca973052b 100644 ---- a/sql/sys_vars.cc -+++ b/sql/sys_vars.cc -@@ -5236,7 +5236,7 @@ static Sys_var_tz Sys_time_zone( - - static Sys_var_charptr Sys_wsrep_provider( - "wsrep_provider", "Path to replication provider library", -- PREALLOCATED GLOBAL_VAR(wsrep_provider), CMD_LINE(REQUIRED_ARG), -+ PREALLOCATED READ_ONLY GLOBAL_VAR(wsrep_provider), CMD_LINE(REQUIRED_ARG), - IN_FS_CHARSET, DEFAULT(WSREP_NONE), - NO_MUTEX_GUARD, NOT_IN_BINLOG, - ON_CHECK(wsrep_provider_check), ON_UPDATE(wsrep_provider_update)); -@@ -5406,7 +5406,7 @@ static Sys_var_ulong Sys_wsrep_max_ws_rows ( - - static Sys_var_charptr Sys_wsrep_notify_cmd( - "wsrep_notify_cmd", "", -- GLOBAL_VAR(wsrep_notify_cmd),CMD_LINE(REQUIRED_ARG), -+ READ_ONLY GLOBAL_VAR(wsrep_notify_cmd), CMD_LINE(REQUIRED_ARG), - IN_SYSTEM_CHARSET, DEFAULT("")); - - static Sys_var_mybool Sys_wsrep_certify_nonPK( diff --git a/LICENSE.clustercheck b/LICENSE.clustercheck new file mode 100644 index 0000000000000000000000000000000000000000..609015d07c38f49eb46f97475dbf595240d669ef --- /dev/null +++ b/LICENSE.clustercheck @@ -0,0 +1,27 @@ +Copyright (c) 2012-2014, Olaf van Zandwijk +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + +3. Neither the name of the copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/README.mariadb-docs b/README.mariadb-docs new file mode 100644 index 0000000000000000000000000000000000000000..bff53eb8dc53efff6ccd6e3789ef6d36b7616134 --- /dev/null +++ b/README.mariadb-docs @@ -0,0 +1,9 @@ +MariaDB haven't yet made a document package available for offline. + +You can create your own copy with the instructions here: + +https://mariadb.com/kb/en/meta/mirroring-the-mariadb-knowledge-base/ + +You can find view the on-line documentation at: + +https://mariadb.com/kb/en/documentation/ diff --git a/clustercheck.sh b/clustercheck.sh new file mode 100644 index 0000000000000000000000000000000000000000..782dbb6f1eb781098741040bbf725760fc19b6c5 --- /dev/null +++ b/clustercheck.sh @@ -0,0 +1,89 @@ +#!/bin/bash +# +# Script to make a proxy (ie HAProxy) capable of monitoring Galera cluster nodes properly +# +# Author: Olaf van Zandwijk +# Author: Raghavendra Prabhu +# Author: Ryan O'Hara +# +# Documentation and download: https://github.com/olafz/percona-clustercheck +# +# Based on the original script from Unai Rodriguez +# + +if [ -f @INSTALL_SYSCONFDIR@/sysconfig/clustercheck ]; then + . @INSTALL_SYSCONFDIR@/sysconfig/clustercheck +fi + +MYSQL_USERNAME="${MYSQL_USERNAME-clustercheckuser}" +MYSQL_PASSWORD="${MYSQL_PASSWORD-clustercheckpassword!}" +MYSQL_HOST="${MYSQL_HOST:-127.0.0.1}" +MYSQL_PORT="${MYSQL_PORT:-3306}" +ERR_FILE="${ERR_FILE:-/dev/null}" +AVAILABLE_WHEN_DONOR=${AVAILABLE_WHEN_DONOR:-0} +AVAILABLE_WHEN_READONLY=${AVAILABLE_WHEN_READONLY:-1} +DEFAULTS_EXTRA_FILE=${DEFAULTS_EXTRA_FILE:-@INSTALL_SYSCONFDIR@/my.cnf} + +#Timeout exists for instances where mysqld may be hung +TIMEOUT=10 + +if [[ -r $DEFAULTS_EXTRA_FILE ]];then + MYSQL_CMDLINE="mysql --defaults-extra-file=$DEFAULTS_EXTRA_FILE -nNE \ + --connect-timeout=$TIMEOUT \ + --user=${MYSQL_USERNAME} --password=${MYSQL_PASSWORD} \ + --host=${MYSQL_HOST} --port=${MYSQL_PORT}" +else + MYSQL_CMDLINE="mysql -nNE --connect-timeout=$TIMEOUT \ + --user=${MYSQL_USERNAME} --password=${MYSQL_PASSWORD} \ + --host=${MYSQL_HOST} --port=${MYSQL_PORT}" +fi +# +# Perform the query to check the wsrep_local_state +# +WSREP_STATUS=$($MYSQL_CMDLINE -e "SHOW STATUS LIKE 'wsrep_local_state';" \ + 2>${ERR_FILE} | tail -1 2>>${ERR_FILE}) + +if [[ "${WSREP_STATUS}" == "4" ]] || [[ "${WSREP_STATUS}" == "2" && ${AVAILABLE_WHEN_DONOR} == 1 ]] +then + # Check only when set to 0 to avoid latency in response. + if [[ $AVAILABLE_WHEN_READONLY -eq 0 ]];then + READ_ONLY=$($MYSQL_CMDLINE -e "SHOW GLOBAL VARIABLES LIKE 'read_only';" \ + 2>${ERR_FILE} | tail -1 2>>${ERR_FILE}) + + if [[ "${READ_ONLY}" == "ON" ]];then + # Galera cluster node local state is 'Synced', but it is in + # read-only mode. The variable AVAILABLE_WHEN_READONLY is set to 0. + # => return HTTP 503 + # Shell return-code is 1 + echo -en "HTTP/1.1 503 Service Unavailable\r\n" + echo -en "Content-Type: text/plain\r\n" + echo -en "Connection: close\r\n" + echo -en "Content-Length: 35\r\n" + echo -en "\r\n" + echo -en "Galera cluster node is read-only.\r\n" + sleep 0.1 + exit 1 + fi + fi + # Galera cluster node local state is 'Synced' => return HTTP 200 + # Shell return-code is 0 + echo -en "HTTP/1.1 200 OK\r\n" + echo -en "Content-Type: text/plain\r\n" + echo -en "Connection: close\r\n" + echo -en "Content-Length: 32\r\n" + echo -en "\r\n" + echo -en "Galera cluster node is synced.\r\n" + sleep 0.1 + exit 0 +else + # Galera cluster node local state is not 'Synced' => return HTTP 503 + # Shell return-code is 1 + echo -en "HTTP/1.1 503 Service Unavailable\r\n" + echo -en "Content-Type: text/plain\r\n" + echo -en "Connection: close\r\n" + echo -en "Content-Length: 36\r\n" + echo -en "\r\n" + echo -en "Galera cluster node is not synced.\r\n" + sleep 0.1 + exit 1 +fi diff --git a/mariadb-10.3.9.tar.gz b/mariadb-10.5.10.tar.gz similarity index 68% rename from mariadb-10.3.9.tar.gz rename to mariadb-10.5.10.tar.gz index d12c13bcc252ffdf442ebf0c2ec5dcdfed803559..d043a5d631c10fcb2bb792d7523bcc823ecb827b 100644 Binary files a/mariadb-10.3.9.tar.gz and b/mariadb-10.5.10.tar.gz differ diff --git a/mariadb-check-socket.sh b/mariadb-check-socket.sh new file mode 100644 index 0000000000000000000000000000000000000000..51a7e431078d8058125439f4b19d5c53dd19e45f --- /dev/null +++ b/mariadb-check-socket.sh @@ -0,0 +1,39 @@ +#!/bin/sh + +# We check if there is already a process using the socket file, +# since otherwise the systemd service file could report false +# positive result when starting and mysqld_safe could remove +# a socket file, which is actually being used by a different daemon. + +source "`dirname ${BASH_SOURCE[0]}`/mariadb-scripts-common" + +if test -e "$socketfile" ; then + echo "Socket file $socketfile exists." >&2 + + # no write permissions + if ! test -w "$socketfile" ; then + echo "Not enough permission to write to the socket file $socketfile, which is suspicious." >&2 + echo "Please, remove $socketfile manually to start the service." >&2 + exit 1 + fi + + # not a socket file + if ! test -S "$socketfile" ; then + echo "The file $socketfile is not a socket file, which is suspicious." >&2 + echo "Please, remove $socketfile manually to start the service." >&2 + exit 1 + fi + + # some process uses the socket file + response=`@bindir@/mariadb-admin --no-defaults --socket="$socketfile" --user=UNKNOWN_MYSQL_USER --connect-timeout="${CHECKSOCKETTIMEOUT:-10}" ping 2>&1` + if [ $? -eq 0 ] || echo "$response" | grep -q "Access denied for user" ; then + echo "Is another MariaDB daemon already running with the same unix socket?" >&2 + echo "Please, stop the process using the socket $socketfile or remove the file manually to start the service." >&2 + exit 1 + fi + + # socket file is a garbage + echo "No process is using $socketfile, which means it is a garbage, so it will be removed automatically." >&2 +fi + +exit 0 diff --git a/mariadb-check-upgrade.sh b/mariadb-check-upgrade.sh new file mode 100644 index 0000000000000000000000000000000000000000..fe9554420ce8f6e70aed009a93362907851d4f16 --- /dev/null +++ b/mariadb-check-upgrade.sh @@ -0,0 +1,39 @@ +#!/bin/sh + +source "`dirname ${BASH_SOURCE[0]}`/mariadb-scripts-common" + +upgrade_info_file="$datadir/mysql_upgrade_info" +version=0 +# get version as integer from mysql_upgrade_info file +if [ -f "$upgrade_info_file" ] && [ -r "$upgrade_info_file" ] ; then + version_major=$(cat "$upgrade_info_file" | head -n 1 | sed -e 's/\([0-9]*\)\.\([0-9]*\)\..*$/\1/') + version_minor=$(cat "$upgrade_info_file" | head -n 1 | sed -e 's/\([0-9]*\)\.\([0-9]*\)\..*$/\2/') + if [[ $version_major =~ ^[0-9]+$ ]] && [[ $version_minor =~ ^[0-9]+$ ]] ; then + version=$((version_major*100+version_minor)) + fi +fi + +# compute current version as integer +thisversion=$((@MAJOR_VERSION@*100+@MINOR_VERSION@)) + +# provide warning in cases we should run mysql_upgrade +if [ $version -ne $thisversion ] ; then + + # give extra warning if some version seems to be skipped + if [ $version -gt 0 ] && [ $version -lt 505 ] ; then + echo "The datadir located at $datadir seems to be older than of a version 5.5. Please, mind that as a general rule, to upgrade from one release series to another, go to the next series rather than skipping a series." >&2 + fi + + cat <&2 +The datadir located at $datadir needs to be upgraded using 'mariadb-upgrade' tool. This can be done using the following steps: + + 1. Back-up your data before with 'mariadb-upgrade' + 2. Start the database daemon using 'systemctl start @DAEMON_NAME@.service' + 3. Run 'mariadb-upgrade' with a database user that has sufficient privileges + +Read more about 'mariadb-upgrade' usage at: +https://mariadb.com/kb/en/mysql_upgrade/ +EOF +fi + +exit 0 diff --git a/mariadb-groonga.patch b/mariadb-groonga.patch new file mode 100644 index 0000000000000000000000000000000000000000..3a0e74c08d5641bdf484d60fed1b957b4fc2d3f7 --- /dev/null +++ b/mariadb-groonga.patch @@ -0,0 +1,30 @@ +# Fixing conflict with groonga package +# https://bugzilla.redhat.com/show_bug.cgi?id=1763287 + +--- mariadb-10.3.18/storage/mroonga/vendor/groonga/CMakeLists.txt.withoutoption 2019-11-11 14:01:07.762595716 +0100 ++++ mariadb-10.3.18/storage/mroonga/vendor/groonga/CMakeLists.txt 2019-11-11 14:33:05.224012458 +0100 +@@ -86,7 +86,9 @@ + set(INCLUDE_DIR "include") + set(GRN_INCLUDE_DIR "include/groonga") + set(DATA_DIR "share") +-set(GRN_DATA_DIR "${DATA_DIR}/${GRN_PROJECT_NAME}") ++if(NOT DEFINED GRN_DATA_DIR) ++ set(GRN_DATA_DIR "${DATA_DIR}/${GRN_PROJECT_NAME}") ++endif() + set(CONFIG_DIR "etc") + set(GRN_CONFIG_DIR "${CONFIG_DIR}/${GRN_PROJECT_NAME}") + set(GRN_CONFIG_PATH "${CMAKE_INSTALL_PREFIX}/${GRN_CONFIG_DIR}/groonga.conf") + +--- mariadb-10.3.18/storage/mroonga/vendor/groonga/vendor/plugins/groonga-normalizer-mysql/CMakeLists.txt.withoutoption 2019-11-11 14:34:22.661005715 +0100 ++++ mariadb-10.3.18/storage/mroonga/vendor/groonga/vendor/plugins/groonga-normalizer-mysql/CMakeLists.txt 2019-11-11 14:35:59.962244120 +0100 +@@ -16,7 +16,9 @@ + # MA 02110-1335 USA + + cmake_minimum_required(VERSION 2.6) +-set(GROONGA_NORMALIZER_MYSQL_PROJECT_NAME "groonga-normalizer-mysql") ++if (NOT DEFINED GROONGA_NORMALIZER_MYSQL_PROJECT_NAME) ++ set(GROONGA_NORMALIZER_MYSQL_PROJECT_NAME "groonga-normalizer-mysql") ++endif() + project("${GROONGA_NORMALIZER_MYSQL_PROJECT_NAME}") + + if(DEFINED GROONGA_NORMALIZER_MYSQL_EMBED) diff --git a/mariadb-logrotate.patch b/mariadb-logrotate.patch new file mode 100644 index 0000000000000000000000000000000000000000..aa46e592fec7ced4753bac83c5d5f1714f45d0ac --- /dev/null +++ b/mariadb-logrotate.patch @@ -0,0 +1,81 @@ +Adjust the mysql-log-rotate script in several ways: + +* Use the correct log file pathname for Red Hat installations. +* Enable creation of the log file by logrotate (needed since + /var/log/ isn't writable by mysql user); and set the same 640 + permissions we normally use. +* Comment out the actual rotation commands, so that user must edit + the file to enable rotation. This is unfortunate, but the fact + that the script will probably fail without manual configuration + (to set a root password) means that we can't really have it turned + on by default. Fortunately, in most configurations the log file + is low-volume and so rotation is not critical functionality. + +See discussions at RH bugs 799735, 547007 +* Note they are from Fedora 15 / 16 + +Update 3/2017 +* it would be big unexpected change for anyone upgrading, if we start shipping it now. + Maybe it is good candidate for shipping with MariaDB 10.2 ? +* the 'mysqladmin flush logs' doesn´t guarantee, no entries are lost + during flushing, the operation is not atomic. + We should not ship it in that state + +Update 6/2018 +* the SIGHUP causes server to flush all logs. No password admin needed, the only constraint is + beeing able to send the SIGHUP to the process and read the mysqld pid file, which root can. +* Submited as PR: https://github.com/MariaDB/server/pull/807 + +Update 02/2021 +* Enhance the script as proposed in: + https://mariadb.com/kb/en/rotating-logs-on-unix-and-linux/ +* Discussion continues in: + https://jira.mariadb.org/browse/MDEV-16621 + +--- mariadb-10.5.8/support-files/mysql-log-rotate.sh 2021-02-12 08:37:47.857289694 +0100 ++++ mariadb-10.5.8/support-files/mysql-log-rotate.sh_pacthed 2021-02-12 08:40:26.420372325 +0100 +@@ -3,35 +3,22 @@ + # in the [mysqld] section as follows: + # + # [mysqld] +-# log-error=@localstatedir@/mysqld.log +-# +-# If the root user has a password you have to create a +-# /root/.my.cnf configuration file with the following +-# content: +-# +-# [mysqladmin] +-# password = +-# user= root +-# +-# where "" is the password. +-# +-# ATTENTION: This /root/.my.cnf should be readable ONLY +-# for root ! ++# log-error=@LOG_LOCATION@ + +-@localstatedir@/mysqld.log { +- # create 600 mysql mysql ++@LOG_LOCATION@ { ++ create 600 mysql mysql + notifempty + daily + rotate 3 + missingok + compress ++ delaycompress ++ sharedscripts + postrotate + # just if mariadbd is really running +- if test -x @bindir@/mysqladmin && \ +- @bindir@/mysqladmin ping &>/dev/null +- then +- @bindir@/mysqladmin --local flush-error-log \ +- flush-engine-log flush-general-log flush-slow-log +- fi ++ if [ -e @PID_FILE_DIR@/@DAEMON_NO_PREFIX@.pid ] ++ then ++ kill -1 $(<@PID_FILE_DIR@/@DAEMON_NO_PREFIX@.pid) ++ fi + endscript + } diff --git a/mariadb-ownsetup.patch b/mariadb-ownsetup.patch new file mode 100644 index 0000000000000000000000000000000000000000..7728cf1a62d9994ec9f6b08297176b93817d06fc --- /dev/null +++ b/mariadb-ownsetup.patch @@ -0,0 +1,31 @@ +--- mariadb-10.4.14/support-files/CMakeLists.txt 2020-08-06 17:28:28.000000000 +0200 ++++ mariadb-10.4.14/support-files/CMakeLists.txt_patched 2020-09-03 13:21:07.826658279 +0200 +@@ -187,6 +187,7 @@ IF(UNIX) + COMPONENT SharedLibraries) + INSTALL(FILES rpm/mysql-clients.cnf DESTINATION ${INSTALL_SYSCONF2DIR} + COMPONENT Client) ++ CONFIGURE_FILE(rpm/server.cnf ${CMAKE_CURRENT_SOURCE_DIR}/rpm/server.cnf @ONLY) + INSTALL(FILES rpm/server.cnf DESTINATION ${INSTALL_SYSCONF2DIR} + COMPONENT IniFiles) + INSTALL(FILES rpm/enable_encryption.preset DESTINATION ${INSTALL_SYSCONF2DIR} + +diff -up mariadb-10.0.15/support-files/rpm/server.cnf.ownsetup mariadb-10.0.15/support-files/rpm/server.cnf +--- mariadb-10.0.15/support-files/rpm/server.cnf.ownsetup 2015-01-24 23:55:55.110063592 +0100 ++++ mariadb-10.0.15/support-files/rpm/server.cnf 2015-01-24 23:57:42.308114387 +0100 +@@ -9,7 +9,16 @@ + [server] + + # this is only for the mysqld standalone daemon ++# Settings user and group are ignored when systemd is used. ++# If you need to run mysqld under a different user or group, ++# customize your systemd unit file for mysqld/mariadb according to the ++# instructions in http://fedoraproject.org/wiki/Systemd + [mysqld] ++datadir=@MYSQL_DATADIR@ ++socket=@MYSQL_UNIX_ADDR@ ++log-error=@LOG_LOCATION@ ++pid-file=@PID_FILE_DIR@/@DAEMON_NO_PREFIX@.pid ++ + + # + # * Galera-related settings diff --git a/mariadb-pcdir.patch b/mariadb-pcdir.patch new file mode 100644 index 0000000000000000000000000000000000000000..117273a09580a97c0bcf09a3d0352acdd2f61356 --- /dev/null +++ b/mariadb-pcdir.patch @@ -0,0 +1,19 @@ +Use PCDIR CMake option, if configured + +Upstream install the server pkgconfig file into arch-independent directory +Reported to upstream as: https://jira.mariadb.org/browse/MDEV-14340 + +--- mariadb-10.5.5/support-files/CMakeLists.txt.old 2020-09-30 10:36:08.582490318 +0200 ++++ mariadb-10.5.5/support-files/CMakeLists.txt 2020-09-30 10:38:58.079710848 +0200 +@@ -91,7 +91,11 @@ + ENDIF() + + CONFIGURE_FILE(mariadb.pc.in ${CMAKE_CURRENT_BINARY_DIR}/mariadb.pc @ONLY) ++IF(INSTALL_PCDIR) ++ INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/mariadb.pc DESTINATION ${INSTALL_PCDIR} COMPONENT Development) ++ELSE() + INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/mariadb.pc DESTINATION ${INSTALL_LIBDIR}/pkgconfig COMPONENT Development) ++ENDIF() + + INSTALL(FILES mysql.m4 DESTINATION ${INSTALL_SHAREDIR}/aclocal COMPONENT Development) + diff --git a/mariadb-prepare-db-dir.sh b/mariadb-prepare-db-dir.sh new file mode 100644 index 0000000000000000000000000000000000000000..cccfe96e802325c17a898519c5bea9f294cdb190 --- /dev/null +++ b/mariadb-prepare-db-dir.sh @@ -0,0 +1,137 @@ +#!/bin/sh + +# This script creates the MariaDB data directory during first service start. +# In subsequent starts, it does nothing much. + +source "`dirname ${BASH_SOURCE[0]}`/mariadb-scripts-common" + +export LC_ALL=C + +# Returns content of the specified directory +# If listing files fails, fake-file is returned so which means +# we'll behave like there was some data initialized +# Some files or directories are fine to be there, so those are +# explicitly removed from the listing +# @param datadir +list_datadir () +{ + ( ls -1A "$1" 2>/dev/null || echo "fake-file" ) | grep -v \ + -e '^lost+found$' \ + -e '\.err$' \ + -e '^.bash_history$' +} + +# Checks whether datadir should be initialized +# @param datadir +should_initialize () +{ + test -z "$(list_datadir "$1")" +} + +# If two args given first is user, second is group +# otherwise the arg is the systemd service file +if [ "$#" -eq 2 ] +then + myuser="$1" + mygroup="$2" +else + # Absorb configuration settings from the specified systemd service file, + # or the default service if not specified + SERVICE_NAME="$1" + if [ x"$SERVICE_NAME" = x ] + then + SERVICE_NAME=@DAEMON_NAME@.service + fi + + myuser=`systemctl show -p User "${SERVICE_NAME}" | + sed 's/^User=//'` + if [ x"$myuser" = x ] + then + myuser=mysql + fi + + mygroup=`systemctl show -p Group "${SERVICE_NAME}" | + sed 's/^Group=//'` + if [ x"$mygroup" = x ] + then + mygroup=mysql + fi +fi + +# Set up the errlogfile with appropriate permissions +if [ ! -e "$errlogfile" -a ! -h "$errlogfile" -a x$(dirname "$errlogfile") = "x/var/log" ]; then + case $(basename "$errlogfile") in + mysql*.log|mariadb*.log) install /dev/null -m0640 -o$myuser -g$mygroup "$errlogfile" ;; + *) ;; + esac +else + # Provide some advice if the log file cannot be created by this script + errlogdir=$(dirname "$errlogfile") + if ! [ -d "$errlogdir" ] ; then + echo "The directory $errlogdir does not exist." >&2 + exit 1 + elif [ -e "$errlogfile" -a ! -w "$errlogfile" ] ; then + echo "The log file $errlogfile cannot be written, please, fix its permissions." >&2 + echo "The daemon will be run under $myuser:$mygroup" >&2 + exit 1 + fi +fi + +# Make the data directory if doesn't exist or empty +if should_initialize "$datadir" ; then + # First, make sure $datadir is there with correct permissions + # (note: if it's not, and we're not root, this'll fail ...) + if [ ! -e "$datadir" -a ! -h "$datadir" ] + then + mkdir -p "$datadir" || exit 1 + fi + chown "$myuser:$mygroup" "$datadir" + chmod 0755 "$datadir" + [ -x /sbin/restorecon ] && /sbin/restorecon "$datadir" + + # Now create the database + echo "Initializing @NICE_PROJECT_NAME@ database" >&2 + # Avoiding deletion of files not created by mysql_install_db is + # guarded by time check and sleep should help work-arounded + # potential issues on systems with 1 second resolution timestamps + # https://bugzilla.redhat.com/show_bug.cgi?id=1335849#c19 + INITDB_TIMESTAMP=`LANG=C date -u` + sleep 1 + @bindir@/mariadb-install-db --rpm --datadir="$datadir" --user="$myuser" --skip-test-db >&2 + ret=$? + if [ $ret -ne 0 ] ; then + echo "Initialization of @NICE_PROJECT_NAME@ database failed." >&2 + echo "Perhaps @sysconfdir@/my.cnf is misconfigured or there is some problem with permissions of $datadir." >&2 + # Clean up any partially-created database files + if [ ! -e "$datadir/mysql/user.frm" ] && [ -d "$datadir" ] ; then + echo "Initialization of @NICE_PROJECT_NAME@ database was not finished successfully." >&2 + echo "Files created so far will be removed." >&2 + find "$datadir" -mindepth 1 -maxdepth 1 -newermt "$INITDB_TIMESTAMP" \ + -not -name "lost+found" -exec rm -rf {} + + if [ $? -ne 0 ] ; then + echo "Removing of created files was not successfull." >&2 + echo "Please, clean directory $datadir manually." >&2 + fi + else + echo "However, part of data has been initialized and those will not be removed." >&2 + echo "Please, clean directory $datadir manually." >&2 + fi + exit $ret + fi + # upgrade does not need to be run on a fresh datadir + echo "@VERSION@-MariaDB" >"$datadir/mysql_upgrade_info" +else + if [ -d "$datadir/mysql/" ] ; then + # mysql dir exists, it seems data are initialized properly + echo "Database @NICE_PROJECT_NAME@ is probably initialized in $datadir already, nothing is done." + echo "If this is not the case, make sure the $datadir is empty before running `basename $0`." + else + # if the directory is not empty but mysql/ directory is missing, then + # print error and let user to initialize manually or empty the directory + echo "Database @NICE_PROJECT_NAME@ is not initialized, but the directory $datadir is not empty, so initialization cannot be done." >&2 + echo "Make sure the $datadir is empty before running `basename $0`." >&2 + exit 1 + fi +fi + +exit 0 diff --git a/mariadb-scripts-common.sh b/mariadb-scripts-common.sh new file mode 100644 index 0000000000000000000000000000000000000000..e603a9e1d935f3b1f407de8a6cd418fae0db5250 --- /dev/null +++ b/mariadb-scripts-common.sh @@ -0,0 +1,68 @@ +#!/bin/sh + +# Some useful functions used in other MariaDB helper scripts +# This scripts defines variables datadir, errlogfile, socketfile + +export LC_ALL=C + +# extract value of a MariaDB option from config files +# Usage: get_mysql_option VARNAME DEFAULT SECTION [ SECTION, ... ] +# result is returned in $result +# We use my_print_defaults which prints all options from multiple files, +# with the more specific ones later; hence take the last match. +get_mysql_option(){ + if [ $# -ne 3 ] ; then + echo "get_mysql_option requires 3 arguments: section option default_value" + return + fi + sections="$1" + option_name="$2" + default_value="$3" + result=`@bindir@/my_print_defaults $my_print_defaults_extra_args $sections | sed -n "s/^--${option_name}=//p" | tail -n 1` + if [ -z "$result" ]; then + # not found, use default + result="${default_value}" + fi +} + +# For the case of running more instances via systemd, scripts that source +# this file can get --default-group-suffix or similar option as the first +# argument. The utility my_print_defaults needs to use it as well, so the +# scripts sourcing this file work with the same options as the daemon. +my_print_defaults_extra_args='' +while echo "$1" | grep -q '^--defaults' ; do + my_print_defaults_extra_args="${my_print_defaults_extra_args} $1" + shift +done + +# Defaults here had better match what mariadbd-safe will default to +# The option values are generally defined on three important places +# on the default installation: +# 1) default values are hardcoded in the code of mariadbd daemon or +# mariadbd-safe script +# 2) configurable values are defined in @sysconfdir@/my.cnf +# 3) default values for helper scripts are specified bellow +# So, in case values are defined in my.cnf, we need to get that value. +# In case they are not defined in my.cnf, we need to get the same value +# in the daemon, as in the helper scripts. Thus, default values here +# must correspond with values defined in mariadbd-safe script and source +# code itself. + +server_sections="mysqld_safe mysqld server mysqld-@MAJOR_VERSION@.@MINOR_VERSION@ mariadb mariadb-@MAJOR_VERSION@.@MINOR_VERSION@ mariadbd mariadbd-@MAJOR_VERSION@.@MINOR_VERSION@ client-server galera" + +get_mysql_option "$server_sections" datadir "@MYSQL_DATADIR@" +datadir="$result" + +# if there is log_error in the my.cnf, my_print_defaults still +# returns log-error +# log-error might be defined in mysqld_safe and mysqld sections, +# the former has bigger priority +get_mysql_option "$server_sections" log-error "$datadir/`uname -n`.err" +errlogfile="$result" + +get_mysql_option "$server_sections" socket "@MYSQL_UNIX_ADDR@" +socketfile="$result" + +get_mysql_option "$server_sections" pid-file "$datadir/`uname -n`.pid" +pidfile="$result" + diff --git a/mariadb-scripts.patch b/mariadb-scripts.patch new file mode 100644 index 0000000000000000000000000000000000000000..3b6dc1689cb03bf71dfdcf74862888200915b10a --- /dev/null +++ b/mariadb-scripts.patch @@ -0,0 +1,41 @@ +We have some downstream patches and other scripts that include variables to +be expanded by cmake. Cmake needs to know about them, so adding them manually. + + # Install libgcc as mylibgcc.a +--- mariadb-10.5.5/scripts/CMakeLists.txt.old 2020-09-24 10:13:35.272589689 +0200 ++++ mariadb-10.5.5/scripts/CMakeLists.txt 2020-09-24 10:17:31.428985798 +0200 +@@ -377,6 +377,34 @@ + INSTALL_LINK(${file} ${binname} ${INSTALL_BINDIR} ${${file}_COMPONENT}) + ENDIF() + ENDFOREACH() ++ ++ # files for systemd ++ SET(SYSTEMD_SCRIPTS ++ mariadb.tmpfiles.d ++ mysql.service ++ mysql@.service ++ mariadb-prepare-db-dir ++ mariadb-check-socket ++ mariadb-check-upgrade ++ mariadb-scripts-common ++ mysql_config_multilib ++ clustercheck ++ galera_new_cluster ++ my.cnf ++ ) ++ FOREACH(file ${SYSTEMD_SCRIPTS}) ++ IF(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/${file}.sh) ++ CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/${file}.sh ++ ${CMAKE_CURRENT_BINARY_DIR}/${file} ESCAPE_QUOTES @ONLY) ++ ELSEIF(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/${file}.in) ++ CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/${file}.in ++ ${CMAKE_CURRENT_BINARY_DIR}/${file} ESCAPE_QUOTES @ONLY) ++ ELSE() ++ MESSAGE(FATAL_ERROR "Can not find ${file}.sh or ${file}.in in " ++ "${CMAKE_CURRENT_SOURCE_DIR}" ) ++ ENDIF() ++ ENDFOREACH() ++ + ENDIF() + + # Install libgcc as mylibgcc.a diff --git a/mariadb-server-galera.te b/mariadb-server-galera.te new file mode 100644 index 0000000000000000000000000000000000000000..bdce127cfa563899b581cd13ded36fd068026bd4 --- /dev/null +++ b/mariadb-server-galera.te @@ -0,0 +1,23 @@ + +module mariadb-server-galera 1.0; + +require { + type mysqld_t; + type rsync_exec_t; + type anon_inodefs_t; + type proc_net_t; + type kerberos_port_t; + class file { read execute execute_no_trans getattr open }; + class tcp_socket { name_bind name_connect }; + class process { setpgid siginh rlimitinh noatsecure }; +} + +# allow mysqld to run rsyncd +allow mysqld_t self:process setpgid; +allow mysqld_t rsync_exec_t:file { read execute execute_no_trans getattr open }; +allow mysqld_t anon_inodefs_t:file getattr; +allow mysqld_t proc_net_t:file { read open }; + +# allow rsyncd to listen on port 4444 +allow mysqld_t kerberos_port_t:tcp_socket { name_bind name_connect }; + diff --git a/mariadb-ssl-cipher-tests.patch b/mariadb-ssl-cipher-tests.patch new file mode 100644 index 0000000000000000000000000000000000000000..567e43307f3423277f261cb916ac4015aae96b8b --- /dev/null +++ b/mariadb-ssl-cipher-tests.patch @@ -0,0 +1,13 @@ +diff -up mariadb-10.3.9/mysql-test/main/ssl_cipher.test.fixtest mariadb-10.3.9/mysql-test/main/ssl_cipher.test +--- mariadb-10.3.13/mysql-test/main/ssl_cipher.test 2019-02-20 08:59:09.000000000 +0100 ++++ mariadb-10.3.13/mysql-test/main/ssl_cipher.test_patched 2019-02-22 11:22:01.250256060 +0100 +@@ -97,7 +97,9 @@ drop user mysqltest_1@localhost; + let $restart_parameters=--ssl-cipher=AES128-SHA; + source include/restart_mysqld.inc; + connect (ssl_con,localhost,root,,,,,SSL); ++--replace_regex /TLS_AES_.*/AES128-SHA/ + SHOW STATUS LIKE 'Ssl_cipher'; ++--replace_regex /TLS_AES_.*/AES128-SHA/ + SHOW STATUS LIKE 'Ssl_cipher_list'; + disconnect ssl_con; + connection default; diff --git a/mariadb-ssl-cypher.patch b/mariadb-ssl-cypher.patch new file mode 100644 index 0000000000000000000000000000000000000000..a1a9dcfded54202c883947b6defca8fc01203cb4 --- /dev/null +++ b/mariadb-ssl-cypher.patch @@ -0,0 +1,21 @@ +diff -up mariadb-10.1.19/mysql-test/r/ssl_8k_key.result.sslbak mariadb-10.1.19/mysql-test/r/ssl_8k_key.result +--- mariadb-10.1.19/mysql-test/r/ssl_8k_key.result.sslbak 2016-11-24 08:55:21.637000000 -0500 ++++ mariadb-10.1.19/mysql-test/r/ssl_8k_key.result 2016-11-24 08:55:55.853000000 -0500 +@@ -1,2 +1,2 @@ +-Variable_name Value +-Ssl_cipher DHE-RSA-AES256-SHA ++have_ssl ++1 +diff -up mariadb-10.1.19/mysql-test/t/ssl_8k_key.test.sslbak mariadb-10.1.19/mysql-test/t/ssl_8k_key.test +--- mariadb-10.1.19/mysql-test/t/ssl_8k_key.test.sslbak 2016-11-24 08:54:10.485000000 -0500 ++++ mariadb-10.1.19/mysql-test/t/ssl_8k_key.test 2016-11-24 08:54:35.724000000 -0500 +@@ -5,7 +5,7 @@ + # + # Bug#29784 YaSSL assertion failure when reading 8k key. + # +---exec $MYSQL --ssl --ssl-key=$MYSQL_TEST_DIR/std_data/client-key.pem --ssl-cert=$MYSQL_TEST_DIR/std_data/client-cert.pem -e "SHOW STATUS LIKE 'ssl_Cipher'" 2>&1 ++--exec $MYSQL --ssl --ssl-key=$MYSQL_TEST_DIR/std_data/client-key.pem --ssl-cert=$MYSQL_TEST_DIR/std_data/client-cert.pem -e "SELECT (VARIABLE_VALUE <> '') AS have_ssl FROM INFORMATION_SCHEMA.SESSION_STATUS WHERE VARIABLE_NAME='Ssl_cipher'" 2>&1 + + ## This test file is for testing encrypted communication only, not other + ## encryption routines that the SSL library happens to provide! + diff --git a/mariadb.rpmlintrc b/mariadb.rpmlintrc new file mode 100644 index 0000000000000000000000000000000000000000..ff69b0e486dd94dc982319c7e7995ab5bceff6b3 --- /dev/null +++ b/mariadb.rpmlintrc @@ -0,0 +1,79 @@ +# THIS FILE SERVES FOR WHITELISTING RPMLINT ERRORS AND WARNINGS IN TASKOTRON +# https://fedoraproject.org/wiki/Taskotron/Tasks/dist.rpmlint#Whitelisting_errors + +# (same file in python3 package served as a great example) + + + +# Spelling errors +addFilter(r'spelling-error .* en_US (cnf|mysqld|benchmarking|pam|passwordless|subpackage|libmariadb|mariadbd) ') + +# Debugsource +addFilter(r'^mariadb.*debugsource\.[^:]+: (E|W): no-documentation') +# Debuginfo +addFilter(r'^mariadb.*debuginfo\.[^:]+: (E|W): useless-provides debuginfo\(build-id\)') +# Debug symlinks +addFilter(r'dangling-relative-symlink /usr/lib/.build-id') + +# Testsuite +# Some expected tests results are zero-length files +addFilter(r'(zero-length|pem-certificate) /usr/share/mysql-test/*') + +# Chroot function +# False positive; checked by upstream +addFilter(r'missing-call-to-chdir-with-chroot') + +# Missing documentation +# I don't think that's on the upstream priority list +addFilter(r'no-documentation') +addFilter(r'no-manual-page-for-binary') + +# Obsoleted not provided +# Obsoleting upstream packages, not providing them is expected to not mix them up +addFilter(r'obsolete-not-provided MySQL') +# Provided by mariadb-connector-c +addFilter(r'obsolete-not-provided mariadb-libs') +# Upstream dropped support +addFilter(r'obsolete-not-provided mariadb-bench') +addFilter(r'obsolete-not-provided mariadb-tokudb-engine') + +# Config file without noreplace flag +# Don't replace logs that may contain old entries +addFilter(r'conffile-without-noreplace-flag /var/log/mariadb/mariadb.log') + +# Log rotation +# MariaDB log rotation script is commented out, because it is still not ready for big industry usage. +# Let the user decide, if they want to enable it (uncomment it) +addFilter(r'incoherent-logrotate-file /etc/logrotate.d/mariadb') + +# Permissions +# wsrep_sst_common +# It contains a parser of arguments for other sst scripts. +# It is meant to be sourced, not to be executed alone. +# So it correctly does not have shebang nor executable bit. +addFilter(r'non-executable-in-bin /usr/bin/wsrep_sst_common 644') +addFilter(r'script-without-shebang /usr/bin/wsrep_sst_common') +addFilter(r'non-executable-script /usr/bin/wsrep_sst_common 644 None') +# mariadb-scripts-common has a similar issue +addFilter(r'non-executable-script /usr/libexec/mariadb-scripts-common 644 /bin/sh') +# Seems pretty standard to me ... +addFilter(r'non-standard-dir-perm /var/log/mariadb 750') +# 640 is IMO also prety OK +addFilter(r'non-readable /etc/sysconfig/clustercheck 640') + +# Unversioned bundles +# RocksDB has so rapid developement, it it not compatible through versions. +# That means we need to stick to the exact verison upstream use. +addFilter(r'unversioned-explicit-provides bundled\(rocksdb\)') + +# Testsuite errors +addFilter(r'non-executable-script /usr/share/mysql-test') +addFilter(r'arch-dependent-file-in-usr-share /usr/share/mysql-test') + +# Comments at the end of RPM %endif tags +addFilter(r'extra tokens at the end of %endif directive') + +# PAM plugin specialities - all expected +addFilter(r'non-conffile-in-etc /etc/security/user_map.conf') +addFilter(r'setuid-binary /usr/lib64/mariadb/plugin/auth_pam_tool_dir/auth_pam_tool') +addFilter(r'non-standard-executable-perm /usr/lib64/mariadb/plugin/auth_pam_tool_dir/auth_pam_tool') diff --git a/mariadb.spec b/mariadb.spec index 4eed761f572f1c2ca70aa4611218a5e712b9b2f3..6875270f964b1ecea938c83ebf89b3ada8947ded 100644 --- a/mariadb.spec +++ b/mariadb.spec @@ -1,633 +1,1479 @@ -%global runtest 1 +%global pkg_name %{name} +%global pkgnamepatch mariadb +%{!?runselftest:%global runselftest 1} +%global ignore_testsuite_result 0 +%global last_tested_version 10.5.10 +%global force_run_testsuite 0 +%global require_mysql_selinux 1 + +%global _pkgdocdirname %{pkg_name}%{!?_pkgdocdir:-%{version}} +%{!?_pkgdocdir: %global _pkgdocdir %{_docdir}/%{pkg_name}-%{version}} + +%global _default_patch_flags --no-backup-if-mismatch + +%ifarch x86_64 +%bcond_with mroonga +%bcond_with rocksdb +%endif +%ifarch aarch64 +%bcond_without mroonga +%bcond_without rocksdb +%endif -Name: mariadb -Version: 10.3.9 -Release: 12 -Epoch: 3 -Summary: One of the most popular database servers -License: GPLv2 with exceptions and LGPLv2 and BSD -URL: http://mariadb.org +%bcond_without oqgraph +%bcond_without pam + +# S3 storage engine +%bcond_with cracklib +%bcond_with connect +%bcond_with sphinx +%bcond_with s3 +%bcond_with clibrary + +%bcond_without gssapi +%bcond_without embedded +%bcond_without devel +%bcond_without client +%bcond_without common +%bcond_without errmsg +%bcond_without test +%bcond_without galera +%bcond_without backup + +%bcond_without config + +%bcond_with debug +%bcond_without lz4 + +%bcond_without unbundled_pcre + +%global python_path /usr/bin/python3 -Source0: https://downloads.mariadb.com/MariaDB/mariadb-%{version}/source/mariadb-%{version}.tar.gz +# Include systemd files +%global daemon_name %{name} +%global daemon_no_prefix %{pkg_name} +%global mysqld_pid_dir mariadb -Patch0: 0000-disable-some-unstable-testcases.patch -Patch1: 0001-add-install-db-command.patch -Patch2: 0002-disable-some-unstable-testcases-2.patch -Patch3: CVE-2021-27928.patch +# We define some system's well known locations here so we can use them easily +# later when building to another location (like SCL) +%global logrotateddir %{_sysconfdir}/logrotate.d +%global logfiledir %{_localstatedir}/log/%{daemon_name} +%global logfile %{logfiledir}/%{daemon_name}.log +# Directory for storing pid file +%global pidfiledir %{_rundir}/%{mysqld_pid_dir} +# Defining where database data live +%global dbdatadir %{_localstatedir}/lib/mysql +# Home directory of mysql user should be same for all packages that create it +%global mysqluserhome /var/lib/mysql -BuildRequires: selinux-policy-devel, cmake, gcc-c++ -BuildRequires: systemd, systemd-devel -BuildRequires: zlib-devel, lz4-devel, libaio-devel, libedit-devel, ncurses-devel -BuildRequires: systemtap-sdt-devel, bison, bison-devel, pam-devel -BuildRequires: pcre-devel >= 8.35 pkgconf -BuildRequires: perl-interpreter, perl-generators -BuildRequires: python3, time, procps +%bcond_with mysql_names + + +# Make long macros shorter +%global sameevr %{epoch}:%{version}-%{release} + +Name: mariadb +Version: 10.5.10 +Release: 1 +Epoch: 4 + +Summary: A very fast and robust SQL database server +URL: http://mariadb.org +License: GPLv2 and LGPLv2 + +Source0: https://downloads.mariadb.org/interstitial/mariadb-%{version}/source/mariadb-%{version}.tar.gz + +Source2: mysql_config_multilib.sh +Source3: my.cnf.in +Source6: README.mariadb-docs +Source10: mariadb.tmpfiles.d.in +Source11: mysql.service.in +Source12: mariadb-prepare-db-dir.sh +Source14: mariadb-check-socket.sh +Source15: mariadb-scripts-common.sh +Source16: mariadb-check-upgrade.sh +Source18: mysql@.service.in +Source50: skipped-tests-base.list +Source51: skipped-tests-arm.list + +Source70: clustercheck.sh +Source71: LICENSE.clustercheck + +Source72: mariadb-server-galera.te +# Patch4: yum distributions specific logrotate fix +# it would be big unexpected change, if we start shipping it now. Better wait for MariaDB 10.2 +Patch4: %{pkgnamepatch}-logrotate.patch +# Patch7: add to the CMake file all files where we want macros to be expanded +Patch7: %{pkgnamepatch}-scripts.patch +# Patch9: pre-configure to comply with guidelines +Patch9: %{pkgnamepatch}-ownsetup.patch +# Patch10: Fix cipher name in the SSL Cipher name test +Patch10: %{pkgnamepatch}-ssl-cipher-tests.patch +# Patch11: Use PCDIR CMake option, if configured +Patch11: %{pkgnamepatch}-pcdir.patch +# Patch15: Add option to edit groonga's and groonga-normalizer-mysql install path +Patch15: %{pkgnamepatch}-groonga.patch + +BuildRequires: make +BuildRequires: cmake gcc-c++ +BuildRequires: multilib-rpm-config +BuildRequires: selinux-policy-devel +BuildRequires: systemd systemd-devel + +# Page compression algorithms for InnoDB & XtraDB +BuildRequires: zlib-devel +%{?with_lz4:BuildRequires: lz4-devel} + +# asynchornous operations stuff; needed also for wsrep API +BuildRequires: libaio-devel +# commands history features +BuildRequires: libedit-devel +# CLI graphic; needed also for wsrep API +BuildRequires: ncurses-devel +# debugging stuff +BuildRequires: systemtap-sdt-devel +# Bison SQL parser; needed also for wsrep API +BuildRequires: bison bison-devel + +%{?with_debug:BuildRequires: valgrind-devel} + +# use either new enough version of pcre2 or provide bundles(pcre2) +%{?with_unbundled_pcre:BuildRequires: pcre2-devel pkgconf} +%{!?with_unbundled_pcre:Provides: bundled(pcre2) = %{pcre_bundled_version}} +# Few utilities needs Perl +BuildRequires: perl-interpreter +BuildRequires: perl-generators +# Some tests requires python +BuildRequires: python3 +# Tests requires time and ps and some perl modules +BuildRequires: procps +BuildRequires: time +BuildRequires: perl(base) +BuildRequires: perl(Cwd) +BuildRequires: perl(Data::Dumper) +BuildRequires: perl(English) +BuildRequires: perl(Env) +BuildRequires: perl(Errno) +BuildRequires: perl(Exporter) +BuildRequires: perl(Fcntl) +BuildRequires: perl(File::Basename) +BuildRequires: perl(File::Copy) +BuildRequires: perl(File::Find) +BuildRequires: perl(File::Spec) +BuildRequires: perl(File::Spec::Functions) +BuildRequires: perl(File::Temp) +BuildRequires: perl(Getopt::Long) +BuildRequires: perl(IO::File) +BuildRequires: perl(IO::Handle) +BuildRequires: perl(IO::Select) +BuildRequires: perl(IO::Socket) +BuildRequires: perl(IO::Socket::INET) +BuildRequires: perl(IPC::Open3) +BuildRequires: perl(lib) +BuildRequires: perl(Memoize) +BuildRequires: perl(POSIX) +BuildRequires: perl(Socket) +BuildRequires: perl(strict) +BuildRequires: perl(Symbol) +BuildRequires: perl(Sys::Hostname) +BuildRequires: perl(Term::ANSIColor) +BuildRequires: perl(Test::More) +BuildRequires: perl(Time::HiRes) +BuildRequires: perl(Time::localtime) +BuildRequires: perl(warnings) +# for running some openssl tests rhbz#1189180 BuildRequires: openssl openssl-devel -BuildRequires: perl(File::Temp), perl(Data::Dumper), perl(Getopt::Long) -BuildRequires: perl(Env), perl(Exporter), perl(Fcntl) -BuildRequires: perl(IPC::Open3), perl(Memoize), perl(Socket) -BuildRequires: perl(Sys::Hostname), perl(Test::More), perl(Time::HiRes), perl(Symbol) +%if %{with debug} +BuildRequires: valgrind-devel +%endif +BuildRequires: gdb + +Requires: bash coreutils grep -Requires: grep, bash, coreutils -Requires: %{name}-common%{?_isa} = %{epoch}:%{version}-%{release} +Requires: %{name}-common%{?_isa} = %{sameevr} + +%if %{with clibrary} +# Explicit EVR requirement for -libs is needed for RHBZ#1406320 +Requires: %{name}-libs%{?_isa} = %{sameevr} +%else +# If not built with client library in this package, use connector-c Requires: mariadb-connector-c >= 3.0 -Conflicts: mysql -Suggests: %{name}-server%{?_isa} = %{epoch}:%{version}-%{release} -Provides: mariadb-galera = %{epoch}:%{version}-%{release} +%endif -%global __requires_exclude ^perl\\((hostnames|lib::mtr|lib::v1|mtr_|My::) +%if %{with mysql_names} +Provides: mysql = %{sameevr} +Provides: mysql%{?_isa} = %{sameevr} +Provides: mysql-compat-client = %{sameevr} +Provides: mysql-compat-client%{?_isa} = %{sameevr} +%endif -%description -MariaDB turns data into structured information in a wide array of applications, -ranging from banking to websites. It is an enhanced, drop-in replacement for MySQL. -MariaDB is used because it is fast, scalable and robust, with a rich ecosystem of storage -engines, plugins and many other tools make it very versatile for a wide variety of use cases. +Suggests: %{name}-server%{?_isa} = %{sameevr} -%package common -Summary: It including share config files used by client and server -Provides: mariadb-galera-common = %{epoch}:%{version}-%{release} -Obsoletes: %{name}-libs <= %{epoch}:%{version}-%{release} +Conflicts: community-mysql -%description common -It including share config files used by client and server, -It must install first. +%global __requires_exclude ^perl\\((hostnames|lib::mtr|lib::v1|mtr_|My::|wsrep) +%global __provides_exclude_from ^(%{_datadir}/(mysql|mysql-test)/.*|%{_libdir}/%{pkg_name}/plugin/.*\\.so)$ + +%{!?_licensedir:%global license %doc} -%package errmessage -Summary: It including the error messages files -Requires: %{name}-common%{?_isa} = %{epoch}:%{version}-%{release} -Provides: errmsg errmsg%{?_isa} -Obsoletes: errmsg +%description +MariaDB is a community developed fork from MySQL - a multi-user, multi-threaded +SQL database server. It is a client/server implementation consisting of +a server daemon (mariadbd) and many different client programs and libraries. +The base package contains the standard MariaDB/MySQL client programs and +utilities. + + +%if %{with clibrary} +%package libs +Summary: The shared libraries required for MariaDB/MySQL clients +Requires: %{name}-common%{?_isa} = %{sameevr} +%if %{with mysql_names} +Provides: mysql-libs = %{sameevr} +Provides: mysql-libs%{?_isa} = %{sameevr} +%endif -%description errmessage -The package provides error messages files for other packages. +%description libs +The mariadb-libs package provides the essential shared libraries for any +MariaDB/MySQL client program or interface. You will need to install this +package to use any other MariaDB package or any clients that need to connect +to a MariaDB/MySQL server. +%endif -%package server -Summary: The MariaDB server -Requires: %{name}%{?_isa} -Requires: %{name}-common%{?_isa} = %{epoch}:%{version}-%{release} -Requires: %{name}-errmessage%{?_isa} = %{epoch}:%{version}-%{release} -Requires: perl(DBI) perl(DBD::mysql) -Recommends: %{name}-backup%{?_isa} = %{epoch}:%{version}-%{release} -Recommends: %{name}-gssapi-server%{?_isa} = %{epoch}:%{version}-%{release} -Provides: server_utils server_utils%{?_isa} -Obsoletes: server-utils +# At least main config file /etc/my.cnf is shared for client and server part +# Since we want to support combination of different client and server +# implementations (e.g. mariadb library and community-mysql server), +# we need the config file(s) to be in a separate package, so no extra packages +# are pulled, because these would likely conflict. +# More specifically, the dependency on the main configuration file (/etc/my.cnf) +# is supposed to be defined as Requires: /etc/my.cnf rather than requiring +# a specific package, so installer app can choose whatever package fits to +# the transaction. +%if %{with config} +%package config +Summary: The config files required by server and client + +%description config +The package provides the config file my.cnf and my.cnf.d directory used by any +MariaDB or MySQL program. You will need to install this package to use any +other MariaDB or MySQL package if the config files are not provided in the +package itself. +%endif + +%if %{with common} +%package common +Summary: The shared files required by server and client Requires: %{_sysconfdir}/my.cnf -Requires: %{_sysconfdir}/my.cnf.d -Requires: coreutils, iproute, psmisc -Suggests: logrotate -Requires: systemd -Requires(pre): /usr/sbin/useradd -Requires(post): systemd -Requires(preun): systemd -Requires(postun): systemd -%description server -MariaDB Server is one of the most popular database servers in the world. + +%if %{without clibrary} +Obsoletes: %{name}-libs <= %{sameevr} +%endif + +%description common +The package provides the essential shared files for any MariaDB program. +You will need to install this package to use any other MariaDB package. +%endif + + +%if %{with errmsg} +%package errmsg +Summary: The error messages files required by server and embedded +Requires: %{name}-common%{?_isa} = %{sameevr} + +%description errmsg +The package provides error messages files for the MariaDB daemon and the +embedded server. You will need to install this package to use any of those +MariaDB packages. +%endif +%if %{with galera} %package server-galera -Summary: MariaDB Galera Cluster is a synchronous multi-master cluster for MariaDB -Requires: %{name}-common%{?_isa} = %{epoch}:%{version}-%{release} -Requires: %{name}-server%{?_isa} = %{epoch}:%{version}-%{release} +Summary: The configuration files and scripts for galera replication +Requires: %{name}-common%{?_isa} = %{sameevr} +Requires: %{name}-server%{?_isa} = %{sameevr} Requires: galera >= 25.3.3 Requires(post): libselinux-utils Requires(post): policycoreutils-python-utils -Requires: lsof, rsync -Provides: mariadb-galera-server = %{epoch}:%{version}-%{release} +# wsrep requirements +Requires: lsof +# Default wsrep_sst_method +Requires: rsync %description server-galera -MariaDB Galera Cluster is a synchronous multi-master cluster for MariaDB. +MariaDB is a multi-user, multi-threaded SQL database server. It is a +client/server implementation consisting of a server daemon (mariadbd) +and many different client programs and libraries. This package contains +added files to allow MariaDB server to operate as a Galera cluster +member. MariaDB is a community developed fork originally from MySQL. +%endif -%package gssapi-server -Summary: The gssapi authentication plugin -BuildRequires: krb5-devel -Requires: %{name}-server%{?_isa} = %{epoch}:%{version}-%{release} +%package server +Summary: The MariaDB server and related files + +# note: no version here = %%{version}-%%{release} +%if %{with mysql_names} +Requires: mysql-compat-client%{?_isa} +Requires: mysql%{?_isa} +Recommends: %{name}%{?_isa} +%else +Requires: %{name}%{?_isa} +%endif +Requires: %{name}-common%{?_isa} = %{sameevr} +Requires: %{name}-errmsg%{?_isa} = %{sameevr} +Recommends: %{name}-server-utils%{?_isa} = %{sameevr} +Recommends: %{name}-backup%{?_isa} = %{sameevr} +%{?with_cracklib:Recommends: %{name}-cracklib-password-check%{?_isa} = %{sameevr}} +%{?with_gssapi:Recommends: %{name}-gssapi-server%{?_isa} = %{sameevr}} +%{?with_rocksdb:Suggests: %{name}-rocksdb-engine%{?_isa} = %{sameevr}} +%{?with_sphinx:Suggests: %{name}-sphinx-engine%{?_isa} = %{sameevr}} +%{?with_oqgraph:Suggests: %{name}-oqgraph-engine%{?_isa} = %{sameevr}} +%{?with_connect:Suggests: %{name}-connect-engine%{?_isa} = %{sameevr}} +%{?with_pam:Suggests: %{name}-pam%{?_isa} = %{sameevr}} + +Suggests: mytop +Suggests: logrotate -%description gssapi-server -The gssapi authentication plugin allows the user to authenticate with services. +Requires: %{_sysconfdir}/my.cnf +Requires: %{_sysconfdir}/my.cnf.d +%if %require_mysql_selinux +Requires: (mysql-selinux if selinux-policy-targeted) +%endif -%package devel -Summary: Including header files and library for the developing of mariadb -Requires: openssl-devel -Requires: mariadb-connector-c-devel >= 3.0 +# for fuser in mysql-check-socket +Requires: psmisc -%description devel -This contains dynamic libraries and header files for the developing of mariadb. +Requires: coreutils +Requires(pre): /usr/sbin/useradd +# We require this to be present for %%{_tmpfilesdir} +Requires: systemd +# Make sure it's there when scriptlets run, too +%{?systemd_requires} +# RHBZ#1496131; use 'iproute' instead of 'net-tools' +Requires: iproute +%if %{with mysql_names} +Provides: mysql-server = %{sameevr} +Provides: mysql-server%{?_isa} = %{sameevr} +Provides: mysql-compat-server = %{sameevr} +Provides: mysql-compat-server%{?_isa} = %{sameevr} +%endif +Conflicts: community-mysql-server +# Bench subpackage has been deprecated in F32 +Obsoletes: %{name}-bench <= %{sameevr} +Obsoletes: %{name}-tokudb-engine <= %{sameevr} + +%description server +MariaDB is a multi-user, multi-threaded SQL database server. It is a +client/server implementation consisting of a server daemon (mariadbd) +and many different client programs and libraries. This package contains +the MariaDB server and some accompanying files and directories. +MariaDB is a community developed fork from MySQL. + + +%if %{with oqgraph} %package oqgraph-engine -Summary: The Open Query GRAPH computation engine +Summary: The Open Query GRAPH engine for MariaDB +Requires: %{name}-server%{?_isa} = %{sameevr} +# boost and Judy required for oograph BuildRequires: boost-devel Judy-devel -Requires: %{name}-server%{?_isa} = %{epoch}:%{version}-%{release} %description oqgraph-engine -The Open Query GRAPH computation engine, or OQGRAPH as the engine itself is called, -allows you to handle hierarchies (tree structures) and complex graphs (nodes having -many connections in several directions). +The package provides Open Query GRAPH engine (OQGRAPH) as plugin for MariaDB +database server. OQGRAPH is a computation engine allowing hierarchies and more +complex graph structures to be handled in a relational fashion. In a nutshell, +tree structures and friend-of-a-friend style searches can now be done using +standard SQL syntax, and results joined onto other tables. +%endif +%if %{with connect} +%package connect-engine +Summary: The CONNECT storage engine for MariaDB +Requires: %{name}-server%{?_isa} = %{sameevr} + +# As per https://jira.mariadb.org/browse/MDEV-21450 +BuildRequires: libxml2-devel + +%description connect-engine +The CONNECT storage engine enables MariaDB to access external local or +remote data (MED). This is done by defining tables based on different data +types, in particular files in various formats, data extracted from other DBMS +or products (such as Excel), or data retrieved from the environment +(for example DIR, WMI, and MAC tables). +%endif + + +%if %{with backup} %package backup -Summary: MariaDB physical online backups of InnoDB, Aria and MyISAM tables +Summary: The mariabackup tool for physical online backups +Requires: %{name}-server%{?_isa} = %{sameevr} BuildRequires: libarchive-devel -Requires: %{name}-server%{?_isa} = %{epoch}:%{version}-%{release} %description backup -Mariabackup is an open source tool provided by MariaDB for performing physical -online backups of InnoDB, Aria and MyISAM tables. For InnoDB, “hot online” backups -are possible. It was originally forked from Percona XtraBackup 2.3.8. It is available -on Linux and Windows. +MariaDB Backup is an open source tool provided by MariaDB for performing +physical online backups of InnoDB, Aria and MyISAM tables. +For InnoDB, "hot online" backups are possible. +%endif + + +%if %{with rocksdb} +%package rocksdb-engine +Summary: The RocksDB storage engine for MariaDB +Requires: %{name}-server%{?_isa} = %{sameevr} +Provides: bundled(rocksdb) + +%description rocksdb-engine +The RocksDB storage engine is used for high performance servers on SSD drives. +%endif -%package cracklib -Summary: A password validation plugin +%if %{with cracklib} +%package cracklib-password-check +Summary: The password strength checking plugin +Requires: %{name}-server%{?_isa} = %{sameevr} BuildRequires: cracklib-dicts cracklib-devel -Requires: %{name}-server%{?_isa} = %{epoch}:%{version}-%{release} Requires: cracklib-dicts -Provides: cracklib-password-check cracklib-password-check%{?_isa} -Obsoletes: cracklib-password-check -%description cracklib -cracklib_password_check is a password validation plugin. It uses the CrackLib library -to check the strength of new passwords. CrackLib is installed by default in many Linux -distributions, since the system's Pluggable Authentication Module (PAM) authentication -framework is usually configured to check the strength of new passwords with the pam_cracklib -PAM module. +%description cracklib-password-check +CrackLib is a password strength checking library. It is installed by default +in many Linux distributions and is invoked automatically (by pam_cracklib.so) +whenever the user login password is modified. +Now, with the cracklib_password_check password validation plugin, one can +also use it to check MariaDB account passwords. +%endif + + +%if %{with gssapi} +%package gssapi-server +Summary: GSSAPI authentication plugin for server +Requires: %{name}-server%{?_isa} = %{sameevr} +BuildRequires: krb5-devel + +%description gssapi-server +GSSAPI authentication server-side plugin for MariaDB for passwordless login. +This plugin includes support for Kerberos on Unix. +%endif + + +%if %{with pam} +%package pam +Summary: PAM authentication plugin for the MariaDB server + +Requires: %{name}-server%{?_isa} = %{sameevr} +# This subpackage NEED the 'mysql' user/group (created during mariadb-server %%pre) to be available prior installation +Requires(pre): %{name}-server%{?_isa} = %{sameevr} + +BuildRequires: pam-devel + +%description pam +PAM authentication server-side plugin for MariaDB. +%endif + + +%if %{with sphinx} +%package sphinx-engine +Summary: The Sphinx storage engine for MariaDB +Requires: %{name}-server%{?_isa} = %{sameevr} +BuildRequires: sphinx libsphinxclient libsphinxclient-devel +Requires: sphinx libsphinxclient + +%description sphinx-engine +The Sphinx storage engine for MariaDB. +%endif + + +%if %{with s3} +%package s3-engine +Summary: The S3 storage engine for MariaDB +Requires: %{name}-server%{?_isa} = %{sameevr} +BuildRequires: curl-devel +%description s3-engine +The S3 read only storage engine allows archiving MariaDB tables in Amazon S3, +or any third-party public or private cloud that implements S3 API, +but still have them accessible for reading in MariaDB. +%endif + + +%package server-utils +Summary: Non-essential server utilities for MariaDB/MySQL applications +Requires: %{name}-server%{?_isa} = %{sameevr} +%if %{with mysql_names} +Provides: mysql-perl = %{sameevr} +%endif +Conflicts: community-mysql-server +# mysqlhotcopy needs DBI/DBD support +Requires: perl(DBI) perl(DBD::MariaDB) + +%description server-utils +This package contains all non-essential server utilities and scripts for +managing databases. It also contains all utilities requiring Perl and it is +the only MariaDB sub-package, except test subpackage, that depends on Perl. + + +%if %{with devel} +%package devel +Summary: Files for development of MariaDB/MySQL applications +%{?with_clibrary:Requires: %{name}-libs%{?_isa} = %{sameevr}} +Requires: openssl-devel +%if %{without clibrary} +Requires: mariadb-connector-c-devel >= 3.0 +%endif +%if %{with mysql_names} +Provides: mysql-devel = %{sameevr} +Provides: mysql-devel%{?_isa} = %{sameevr} +%endif +Conflicts: community-mysql-devel + +%description devel +MariaDB is a multi-user, multi-threaded SQL database server. +MariaDB is a community developed branch of MySQL. +%if %{with clibrary} +This package contains everything needed for developing MariaDB/MySQL client +and server plugins and applications. +%else +This package contains everything needed for developing MariaDB/MySQL server +plugins and applications. For developing client applications, use +mariadb-connector-c package. +%endif +%endif + + +%if %{with embedded} %package embedded -Summary: The embedded MariaDB server -Requires: %{name}-common%{?_isa} = %{epoch}:%{version}-%{release} -Requires: %{name}-errmessage%{?_isa} = %{epoch}:%{version}-%{release} +Summary: MariaDB as an embeddable library +Requires: %{name}-common%{?_isa} = %{sameevr} +Requires: %{name}-errmsg%{?_isa} = %{sameevr} +%if %{with mysql_names} +Provides: mysql-embedded = %{sameevr} +Provides: mysql-embedded%{?_isa} = %{sameevr} +%endif %description embedded -The embedded MariaDB server, libmysqld has the identical interface as the C client -librarylibmysqclient. +MariaDB is a multi-user, multi-threaded SQL database server. This +package contains a version of the MariaDB server that can be embedded +into a client application instead of running as a separate process. +MariaDB is a community developed fork from MySQL. + %package embedded-devel -Summary: Including header files and library for the developing of embedded MariaDB -Requires: %{name}-embedded%{?_isa} = %{epoch}:%{version}-%{release} -Requires: %{name}-devel%{?_isa} = %{epoch}:%{version}-%{release} +Summary: Development files for MariaDB as an embeddable library +Requires: %{name}-embedded%{?_isa} = %{sameevr} +Requires: %{name}-devel%{?_isa} = %{sameevr} +# embedded-devel should require libaio-devel (rhbz#1290517) Requires: libaio-devel +%if %{with mysql_names} +Provides: mysql-embedded-devel = %{sameevr} +Provides: mysql-embedded-devel%{?_isa} = %{sameevr} +%endif +Conflicts: community-mysql-embedded-devel %description embedded-devel -This contains dynamic libraries and header files for the developing of embedded MariaDB. +MariaDB is a multi-user, multi-threaded SQL database server. +MariaDB is a community developed fork from MySQL. +This package contains files needed for developing and testing with +the embedded version of the MariaDB server. +%endif +%if %{with test} %package test -Summary: The test suite of MariaDB -Requires: %{name}%{?_isa} = %{epoch}:%{version}-%{release} -Requires: %{name}-common%{?_isa} = %{epoch}:%{version}-%{release} -Requires: %{name}-server%{?_isa} = %{epoch}:%{version}-%{release} -Requires: perl(Env), perl(Fcntl), perl(Exporter) -Requires: perl(File::Temp), perl(Data::Dumper), perl(Getopt::Long) -Requires: perl(IPC::Open3), perl(Socket), perl(Sys::Hostname) -Requires: perl(Test::More), perl(Time::HiRes) +Summary: The test suite distributed with MariaDB +Requires: %{name}%{?_isa} = %{sameevr} +Requires: %{name}-common%{?_isa} = %{sameevr} +Requires: %{name}-server%{?_isa} = %{sameevr} +Requires: patch +Requires: perl(Env) +Requires: perl(Exporter) +Requires: perl(Fcntl) +Requires: perl(File::Temp) +Requires: perl(Data::Dumper) +Requires: perl(Getopt::Long) +Requires: perl(IPC::Open3) +Requires: perl(Socket) +Requires: perl(Sys::Hostname) +Requires: perl(Test::More) +Requires: perl(Time::HiRes) +Conflicts: %{?fedora:community-}mysql-test +%if %{with mysql_names} +Provides: mysql-test = %{sameevr} +Provides: mysql-test%{?_isa} = %{sameevr} +%endif %description test -This contains test suitte for the developing of MariaDB. +MariaDB is a multi-user, multi-threaded SQL database server. +MariaDB is a community developed fork from MySQL. +This package contains the regression test suite distributed with the MariaDB +sources. +%endif %prep -%autosetup -n %{name}-%{version} -p1 +%setup -q -n mariadb-%{version} + +# Remove JAR files that upstream puts into tarball find . -name "*.jar" -type f -exec rm --verbose -f {} \; +# Remove testsuite for the mariadb-connector-c +rm -rf libmariadb/unittest +%if %{without rocksdb} +rm -r storage/rocksdb/ +%endif -pcre_maj=`grep '^m4_define(pcre_major' pcre/configure.ac | sed -r 's/^m4_define\(pcre_major, \[([0-9]+)\]\)/\1/'` -pcre_min=`grep '^m4_define(pcre_minor' pcre/configure.ac | sed -r 's/^m4_define\(pcre_minor, \[([0-9]+)\]\)/\1/'` +%patch4 -p1 +%patch7 -p1 +%patch9 -p1 +%patch10 -p1 +%patch11 -p1 +%patch15 -p1 -pcre_system_version=`pkgconf %{_libdir}/pkgconfig/libpcre.pc --modversion 2>/dev/null ` -if [ "$pcre_system_version" != "$pcre_maj.$pcre_min" ] -then - echo "\n Warning: Error: Bundled PCRE version is not correct. \n\tSystem version number:$pcre_system_version \n\tUpstream version number: $pcre_maj.$pcre_min\n" -fi +# generate a list of tests that fail, but are not disabled by upstream +cat %{SOURCE50} | tee -a mysql-test/unstable-tests + +# disable some tests failing on different architectures +%ifarch %{arm} aarch64 +cat %{SOURCE51} | tee -a mysql-test/unstable-tests +%endif +cp %{SOURCE2} %{SOURCE3} %{SOURCE10} %{SOURCE11} %{SOURCE12} \ + %{SOURCE14} %{SOURCE15} %{SOURCE16} %{SOURCE18} %{SOURCE70} scripts -rm -r storage/rocksdb/ +%if %{with galera} +mkdir selinux +sed 's/mariadb-server-galera/%{name}-server-galera/' %{SOURCE72} > selinux/%{name}-server-galera.te +%endif + + +# Get version of PCRE, that upstream use +pcre_version=`grep -e "ftp.pcre.org/pub/pcre/pcre2" cmake/pcre.cmake | sed -r "s;[^0123456789]*2-([[:digit:]]+\.[[:digit:]]+)\.[^0123456789]*;\1;"` -rm -r storage/tokudb/mysql-test/tokudb/t/*.py +# Check if the PCRE version in macro 'pcre_bundled_version', used in Provides: bundled(...), is the same version as upstream actually bundles +%if %{without unbundled_pcre} +if [ %{pcre_bundled_version} != "$pcre_version" ] ; then + echo "\n Error: Bundled PCRE version is not correct. \n\tBundled version number:%{pcre_bundled_version} \n\tUpstream version number: $pcre_version\n" + exit 1 +fi +%else +# Check if the PCRE version that upstream use, is the same as the one present in system +pcre_system_version=`pkgconf %{_libdir}/pkgconfig/libpcre2-*.pc --modversion 2>/dev/null | head -n 1` + +if [ "$pcre_system_version" != "$pcre_version" ] ; then + echo "\n Warning: Error: Bundled PCRE version is not correct. \n\tSystem version number:$pcre_system_version \n\tUpstream version number: $pcre_version\n" +fi +%endif %build +# This package has static probe points which do not currently +# work with LTO and result in undefined symbols at link time. +# This is being worked on in upstream GCC +%define _lto_cflags %{nil} -%if %runtest +# fail quickly and obviously if user tries to build as root +%if %runselftest if [ x"$(id -u)" = "x0" ]; then - echo "mysql can't run test as root" + echo "mysql's regression tests fail if run as root." + echo "If you really need to build the RPM as root, use" + echo "--nocheck to skip the regression tests." exit 1 fi %endif -CFLAGS="%{optflags} -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE" -CFLAGS="$CFLAGS -fPIC" -CXXFLAGS="$CFLAGS" -export CFLAGS CXXFLAGS - +# The INSTALL_xxx macros have to be specified relative to CMAKE_INSTALL_PREFIX +# so we can't use %%{_datadir} and so forth here. %cmake . \ -DBUILD_CONFIG=mysql_release \ -DFEATURE_SET="community" \ -DINSTALL_LAYOUT=RPM \ - -DDAEMON_NAME="%{name}" \ - -DDAEMON_NO_PREFIX="%{name}" \ - -DLOG_LOCATION="%{_localstatedir}/log/%{name}/%{name}.log" \ - -DPID_FILE_DIR="%{_rundir}/%{name}" \ + -DDAEMON_NAME="%{daemon_name}" \ + -DDAEMON_NO_PREFIX="%{daemon_no_prefix}" \ + -DLOG_LOCATION="%{logfile}" \ + -DPID_FILE_DIR="%{pidfiledir}" \ -DNICE_PROJECT_NAME="MariaDB" \ -DRPM="openeuler1" \ -DCMAKE_INSTALL_PREFIX="%{_prefix}" \ - -DMYSQL_DATADIR="%{_localstatedir}/lib/mysql" \ - -DMYSQL_UNIX_ADDR="%{_sharedstatedir}/mysql/mysql.sock" \ - -DTMPDIR=%{_tmppath} \ + -DINSTALL_SYSCONFDIR="%{_sysconfdir}" \ + -DINSTALL_SYSCONF2DIR="%{_sysconfdir}/my.cnf.d" \ + -DINSTALL_DOCDIR="share/doc/%{_pkgdocdirname}" \ + -DINSTALL_DOCREADMEDIR="share/doc/%{_pkgdocdirname}" \ + -DINSTALL_INCLUDEDIR=include/mysql \ + -DINSTALL_INFODIR=share/info \ + -DINSTALL_LIBDIR="%{_lib}" \ + -DINSTALL_MANDIR=share/man \ + -DINSTALL_MYSQLSHAREDIR=share/%{pkg_name} \ + -DINSTALL_MYSQLTESTDIR=%{?with_test:share/mysql-test}%{!?with_test:} \ + -DINSTALL_PLUGINDIR="%{_lib}/%{pkg_name}/plugin" \ + -DINSTALL_SBINDIR=libexec \ + -DINSTALL_SCRIPTDIR=bin \ + -DINSTALL_SUPPORTFILESDIR=share/%{pkg_name} \ + -DINSTALL_PCDIR=%{_lib}/pkgconfig \ + -DMYSQL_DATADIR="%{dbdatadir}" \ + -DMYSQL_UNIX_ADDR="/var/lib/mysql/mysql.sock" \ + -DTMPDIR=/var/tmp \ + -DGRN_DATA_DIR=share/%{name}-server/groonga \ + -DGROONGA_NORMALIZER_MYSQL_PROJECT_NAME=%{name}-server/groonga-normalizer-mysql \ -DENABLED_LOCAL_INFILE=ON \ -DENABLE_DTRACE=ON \ -DSECURITY_HARDENED=ON \ - -DWITH_EMBEDDED_SERVER=ON \ - -DWITH_MARIABACKUP=ON \ - -DWITH_UNIT_TESTS=ON \ - -DCONC_WITH_SSL=NO \ + -DWITH_WSREP=%{?with_galera:ON}%{!?with_galera:OFF} \ + -DWITH_INNODB_DISALLOW_WRITES=%{?with_galera:ON}%{!?with_galera:OFF} \ + -DWITH_EMBEDDED_SERVER=%{?with_embedded:ON}%{!?with_embedded:OFF} \ + -DWITH_MARIABACKUP=%{?with_backup:ON}%{!?with_backup:NO} \ + -DWITH_UNIT_TESTS=%{?with_test:ON}%{!?with_test:NO} \ + -DCONC_WITH_SSL=%{?with_clibrary:ON}%{!?with_clibrary:NO} \ -DWITH_SSL=system \ -DWITH_ZLIB=system \ - -DWITH_JEMALLOC=NO \ -DLZ4_LIBS=%{_libdir}/liblz4.so \ - -DWITH_INNODB_LZ4=ON \ - -DPLUGIN_MROONGA=NO \ - -DPLUGIN_OQGRAPH=DYNAMIC \ - -DPLUGIN_CRACKLIB_PASSWORD_CHECK=DYNAMIC \ - -DPLUGIN_ROCKSDB=NO \ - -DPLUGIN_SPHINX=NO \ - -DPLUGIN_TOKUDB=NO \ - -DPLUGIN_CONNECT=NO \ - -DWITH_CASSANDRA=FALSE \ + -DLZ4_LIBS=%{?with_lz4:%{_libdir}/liblz4.so}%{!?with_lz4:} \ + -DWITH_INNODB_LZ4=%{?with_lz4:ON}%{!?with_lz4:OFF} \ + -DWITH_ROCKSDB_LZ4=%{?with_lz4:ON}%{!?with_lz4:OFF} \ + -DPLUGIN_MROONGA=%{?with_mroonga:DYNAMIC}%{!?with_mroonga:NO} \ + -DPLUGIN_OQGRAPH=%{?with_oqgraph:DYNAMIC}%{!?with_oqgraph:NO} \ + -DPLUGIN_CRACKLIB_PASSWORD_CHECK=%{?with_cracklib:DYNAMIC}%{!?with_cracklib:NO} \ + -DPLUGIN_ROCKSDB=%{?with_rocksdb:DYNAMIC}%{!?with_rocksdb:NO} \ + -DPLUGIN_SPHINX=%{?with_sphinx:DYNAMIC}%{!?with_sphinx:NO} \ + -DPLUGIN_CONNECT=%{?with_connect:DYNAMIC}%{!?with_connect:NO} \ + -DPLUGIN_S3=%{?with_s3:DYNAMIC}%{!?with_s3:NO} \ + -DPLUGIN_COLUMNSTORE=NO \ + -DPLUGIN_CLIENT_ED25519=OFF \ + -DPYTHON_SHEBANG=%{python_path} \ + -DPLUGIN_CACHING_SHA2_PASSWORD=%{?with_clibrary:DYNAMIC}%{!?with_clibrary:OFF} \ -DPLUGIN_AWS_KEY_MANAGEMENT=NO \ -DCONNECT_WITH_MONGO=OFF \ -DCONNECT_WITH_JDBC=OFF \ - -DINSTALL_SYSCONFDIR="%{_sysconfdir}" \ - -DINSTALL_SYSCONF2DIR="%{_sysconfdir}/my.cnf.d" \ - -DINSTALL_DOCDIR="share/doc/%{name}" \ - -DINSTALL_DOCREADMEDIR="share/doc/%{name}" \ - -DINSTALL_INCLUDEDIR=include/mysql \ - -DINSTALL_INFODIR=share/info \ - -DINSTALL_LIBDIR="%{_lib}" \ - -DINSTALL_MANDIR=share/man \ - -DINSTALL_MYSQLSHAREDIR=share/%{name} \ - -DINSTALL_MYSQLTESTDIR=share/mysql-test \ - -DINSTALL_PLUGINDIR="%{_lib}/%{name}/plugin" \ - -DINSTALL_SBINDIR=libexec \ - -DINSTALL_SCRIPTDIR=bin \ - -DINSTALL_SQLBENCHDIR=share \ - -DINSTALL_SUPPORTFILESDIR=share/%{name} \ +%{?with_debug: -DCMAKE_BUILD_TYPE=Debug -DWITH_ASAN=OFF -DWITH_INNODB_EXTRA_DEBUG=ON -DWITH_VALGRIND=ON} -cmake -L -%make_build VERBOSE=1 +CFLAGS="$CFLAGS -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE" +# force PIC mode so that we can build libmysqld.so +CFLAGS="$CFLAGS -fPIC" + +%if %{with debug} +# Override all optimization flags when making a debug build +# -D_FORTIFY_SOURCE requires optimizations enabled. Disable the fortify. +CFLAGS=`echo "$CFLAGS" | sed -r 's/-D_FORTIFY_SOURCE=[012]/-D_FORTIFY_SOURCE=0/'` +CFLAGS=`echo "$CFLAGS" | sed -r 's/-O[0123]//'` + +CFLAGS="$CFLAGS -O0 -g -D_FORTIFY_SOURCE=0" +%endif # debug + +CXXFLAGS="$CFLAGS" +CPPFLAGS="$CFLAGS" +export CFLAGS CXXFLAGS CPPFLAGS + +%make_build -j7 + +# build selinux policy +%if %{with galera} +pushd selinux +make -f /usr/share/selinux/devel/Makefile %{name}-server-galera.pp +%endif + %install %make_install -ln -s mysql_config.1.gz %{buildroot}%{_mandir}/man1/mariadb_config.1.gz +# multilib header support #1625157 +for header in mysql/server/my_config.h mysql/server/private/config.h; do +%multilib_fix_c_header --file %{_includedir}/$header +done -mkdir -p %{buildroot}/%{_libdir}/pkgconfig -mv %{buildroot}/%{_datadir}/pkgconfig/*.pc %{buildroot}/%{_libdir}/pkgconfig +ln -s mysql_config.1.gz %{buildroot}%{_mandir}/man1/mariadb_config.1.gz -install -p -m 644 Docs/INFO_SRC %{buildroot}%{_libdir}/%{name}/ -install -p -m 644 Docs/INFO_BIN %{buildroot}%{_libdir}/%{name}/ -rm -r %{buildroot}%{_datadir}/doc/%{name}/MariaDB-server-%{version}/ +# multilib support for shell scripts +# we only apply this to known Red Hat multilib arches, per bug #181335 +if [ %multilib_capable ] +then +mv %{buildroot}%{_bindir}/mysql_config %{buildroot}%{_bindir}/mysql_config-%{__isa_bits} +install -p -m 0755 %{_builddir}/mariadb-%{version}/scripts/mysql_config_multilib %{buildroot}%{_bindir}/mysql_config +# Copy manual page for multilib mysql_config; https://jira.mariadb.org/browse/MDEV-11961 +ln -s mysql_config.1 %{buildroot}%{_mandir}/man1/mysql_config-%{__isa_bits}.1 +fi -mkdir -p %{buildroot}%{_localstatedir}/log/%{name} -chmod 0750 %{buildroot}%{_localstatedir}/log/%{name} -touch %{buildroot}%{_localstatedir}/log/%{name} +%if %{without clibrary} +# Client part should be included in package 'mariadb-connector-c' +rm %{buildroot}%{_libdir}/pkgconfig/libmariadb.pc +%endif -mkdir -p %{buildroot}%{_rundir}/%{name} -install -p -m 0755 -d %{buildroot}%{_localstatedir}/lib/mysql +# install INFO_SRC, INFO_BIN into libdir (upstream thinks these are doc files, +# but that's pretty wacko --- see also %%{name}-file-contents.patch) +install -p -m 644 %{_builddir}/mariadb-%{version}/Docs/INFO_SRC %{buildroot}%{_libdir}/%{pkg_name}/ +install -p -m 644 %{_builddir}/mariadb-%{version}/Docs/INFO_BIN %{buildroot}%{_libdir}/%{pkg_name}/ +rm -r %{buildroot}%{_datadir}/doc/%{_pkgdocdirname}/MariaDB-server-%{version}/ + +# Logfile creation +mkdir -p %{buildroot}%{logfiledir} +chmod 0750 %{buildroot}%{logfiledir} +touch %{buildroot}%{logfile} + +# current setting in my.cnf is to use /var/run/mariadb for creating pid file, +# however since my.cnf is not updated by RPM if changed, we need to create mysqld +# as well because users can have odd settings in their /etc/my.cnf +mkdir -p %{buildroot}%{pidfiledir} +install -p -m 0755 -d %{buildroot}%{dbdatadir} + +%if %{with config} +install -D -p -m 0644 %{_builddir}/mariadb-%{version}/scripts/my.cnf %{buildroot}%{_sysconfdir}/my.cnf +%else +rm %{_builddir}/mariadb-%{version}/scripts/my.cnf +%endif -mv %{buildroot}%{_sysconfdir}/my.cnf.d/server.cnf %{buildroot}%{_sysconfdir}/my.cnf.d/%{name}-server.cnf -mv %{buildroot}%{_sysusersdir}/sysusers.conf %{buildroot}%{_sysusersdir}/%{name}.conf +# use different config file name for each variant of server (mariadb / mysql) +mv %{buildroot}%{_sysconfdir}/my.cnf.d/server.cnf %{buildroot}%{_sysconfdir}/my.cnf.d/%{pkg_name}-server.cnf -rm %{buildroot}%{_sysconfdir}/init.d/mysql +# Remove upstream SysV init script and a symlink to that, we use systemd rm %{buildroot}%{_libexecdir}/rcmysql -rm %{buildroot}%{_tmpfilesdir}/tmpfiles.conf -echo "d %{_rundir}/%{name} 0755 mysql mysql -" >>%{buildroot}%{_tmpfilesdir}/%{name}.conf +# Remove upstream Systemd service files +rm -r %{buildroot}%{_datadir}/%{pkg_name}/systemd +# Our downstream Systemd service file have set aliases to the "mysql" names in the [Install] section. +# They can be enabled / disabled by "systemctl enable / diable " +rm %{buildroot}%{_unitdir}/{mysql,mysqld}.service + +# install systemd unit files and scripts for handling server startup +install -D -p -m 644 %{_builddir}/mariadb-%{version}/scripts/mysql.service %{buildroot}%{_unitdir}/%{daemon_name}.service +install -D -p -m 644 %{_builddir}/mariadb-%{version}/scripts/mysql@.service %{buildroot}%{_unitdir}/%{daemon_name}@.service + +# helper scripts for service starting +install -p -m 755 %{_builddir}/mariadb-%{version}/scripts/mariadb-prepare-db-dir %{buildroot}%{_libexecdir}/mariadb-prepare-db-dir +install -p -m 755 %{_builddir}/mariadb-%{version}/scripts/mariadb-check-socket %{buildroot}%{_libexecdir}/mariadb-check-socket +install -p -m 755 %{_builddir}/mariadb-%{version}/scripts/mariadb-check-upgrade %{buildroot}%{_libexecdir}/mariadb-check-upgrade +install -p -m 644 %{_builddir}/mariadb-%{version}/scripts/mariadb-scripts-common %{buildroot}%{_libexecdir}/mariadb-scripts-common + +# Install downstream version of tmpfiles +install -D -p -m 0644 %{_builddir}/mariadb-%{version}/scripts/mariadb.tmpfiles.d %{buildroot}%{_tmpfilesdir}/%{name}.conf +%if 0%{?mysqld_pid_dir:1} +echo "d %{pidfiledir} 0755 mysql mysql -" >>%{buildroot}%{_tmpfilesdir}/%{name}.conf +%endif +# install additional galera selinux policy +%if %{with galera} +install -p -m 644 -D selinux/%{name}-server-galera.pp %{buildroot}%{_datadir}/selinux/packages/%{name}/%{name}-server-galera.pp +%endif + +%if %{with test} +# mysql-test includes one executable that doesn't belong under /usr/share, so move it and provide a symlink mv %{buildroot}%{_datadir}/mysql-test/lib/My/SafeProcess/my_safe_process %{buildroot}%{_bindir} ln -s ../../../../../bin/my_safe_process %{buildroot}%{_datadir}/mysql-test/lib/My/SafeProcess/my_safe_process +# Provide symlink expected by RH QA tests +ln -s unstable-tests %{buildroot}%{_datadir}/mysql-test/rh-skipped-tests.list +%endif -rm %{buildroot}%{_bindir}/mysql_embedded -rm %{buildroot}%{_libdir}/*.a -rm %{buildroot}%{_datadir}/%{name}/{magic,binary-configure} -rm %{buildroot}%{_datadir}/%{name}/{mysql.server,mysqld_multi.server} +# Client that uses libmysqld embedded server. +# Pretty much like normal mysql command line client, but it doesn't require a running mariadb server. +%{?with_embedded:rm %{buildroot}%{_bindir}/{mariadb-,mysql_}embedded} +rm %{buildroot}%{_mandir}/man1/{mysql_,mariadb-}embedded.1* +# Static libraries +rm %{buildroot}%{_libdir}/*.a +rm %{buildroot}%{_datadir}/%{pkg_name}/binary-configure +rm %{buildroot}%{_datadir}/%{pkg_name}/magic +rm %{buildroot}%{_datadir}/%{pkg_name}/mysql.server +rm %{buildroot}%{_datadir}/%{pkg_name}/mysqld_multi.server +# Binary for monitoring MySQL performance +# Shipped as a standalone package in Fedora rm %{buildroot}%{_bindir}/mytop +rm %{buildroot}%{_mandir}/man1/mytop.1* + +# Should be shipped with mariadb-connector-c +rm %{buildroot}%{_mandir}/man1/mariadb_config.1* + +# put logrotate script where it needs to be +mkdir -p %{buildroot}%{logrotateddir} +mv %{buildroot}%{_datadir}/%{pkg_name}/mysql-log-rotate %{buildroot}%{logrotateddir}/%{daemon_name} +chmod 644 %{buildroot}%{logrotateddir}/%{daemon_name} + +# for compatibility with upstream RPMs, create mysqld symlink in sbin +mkdir -p %{buildroot}%{_sbindir} +ln -s %{_libexecdir}/mysqld %{buildroot}%{_sbindir}/mysqld +ln -s %{_libexecdir}/mariadbd %{buildroot}%{_sbindir}/mariadbd + +# copy additional docs into build tree so %%doc will find them +install -p -m 0644 %{SOURCE6} %{basename:%{SOURCE6}} +install -p -m 0644 %{SOURCE16} %{basename:%{SOURCE16}} +install -p -m 0644 %{SOURCE71} %{basename:%{SOURCE71}} + +# install galera config file +%if %{with galera} +sed -i -r 's|^wsrep_provider=none|wsrep_provider=%{_libdir}/galera/libgalera_smm.so|' %{_builddir}/mariadb-%{version}/support-files/wsrep.cnf +install -p -m 0644 %{_builddir}/mariadb-%{version}/support-files/wsrep.cnf %{buildroot}%{_sysconfdir}/my.cnf.d/galera.cnf +%endif +# install the clustercheck script +mkdir -p %{buildroot}%{_sysconfdir}/sysconfig +touch %{buildroot}%{_sysconfdir}/sysconfig/clustercheck +install -p -m 0755 %{_builddir}/mariadb-%{version}/scripts/clustercheck %{buildroot}%{_bindir}/clustercheck -mkdir -p %{buildroot}%{_sysconfdir}/logrotate.d -mv %{buildroot}%{_datadir}/%{name}/mysql-log-rotate %{buildroot}%{_sysconfdir}/logrotate.d/%{name} -chmod 644 %{buildroot}%{_sysconfdir}/logrotate.d/%{name} +# remove duplicate logrotate script +rm %{buildroot}%{logrotateddir}/mysql +# Remove AppArmor files +rm -r %{buildroot}%{_datadir}/%{pkg_name}/policy/apparmor +# Buildroot does not have symlink /lib64 --> /usr/lib64 +mv %{buildroot}/%{_lib}/security %{buildroot}%{_libdir} -sed -i -r 's|^wsrep_provider=none|wsrep_provider=%{_libdir}/galera/libgalera_smm.so|' support-files/wsrep.cnf -install -p -m 0644 support-files/wsrep.cnf %{buildroot}%{_sysconfdir}/my.cnf.d/galera.cnf -install -D -p -m 0644 support-files/rpm/my.cnf %{buildroot}%{_sysconfdir}/my.cnf -mkdir -p %{buildroot}%{_sysconfdir}/sysconfig -touch %{buildroot}%{_sysconfdir}/sysconfig/clustercheck +# Disable plugins +%if %{with gssapi} +sed -i 's/^plugin-load-add/#plugin-load-add/' %{buildroot}%{_sysconfdir}/my.cnf.d/auth_gssapi.cnf +%endif +%if %{with cracklib} +sed -i 's/^plugin-load-add/#plugin-load-add/' %{buildroot}%{_sysconfdir}/my.cnf.d/cracklib_password_check.cnf +%endif -rm %{buildroot}%{_sysconfdir}/logrotate.d/mysql -rm -r %{buildroot}%{_datadir}/%{name}/policy/apparmor +# Fix Galera Replication config file +# The replication requires cluster address upon startup (which is end-user specific). +# Disable it entirely, rather than have it failing out-of-the-box. +%if %{with galera} +sed -i 's/^wsrep_on=1/wsrep_on=0/' %{buildroot}%{_sysconfdir}/my.cnf.d/galera.cnf +%endif -chmod -x %{buildroot}%{_datadir}/sql-bench/myisam.cnf +%if %{without embedded} +rm %{buildroot}%{_mandir}/man1/{mysql_client_test_embedded,mysqltest_embedded}.1* +rm %{buildroot}%{_mandir}/man1/{mariadb-client-test-embedded,mariadb-test-embedded}.1* +%endif +%if %{without clibrary} rm %{buildroot}%{_sysconfdir}/my.cnf.d/client.cnf +# Client library and links rm %{buildroot}%{_libdir}/libmariadb.so.* unlink %{buildroot}%{_libdir}/libmysqlclient.so unlink %{buildroot}%{_libdir}/libmysqlclient_r.so unlink %{buildroot}%{_libdir}/libmariadb.so -rm %{buildroot}%{_libdir}/%{name}/plugin/{dialog.so,mysql_clear_password.so,sha256_password.so,auth_gssapi_client.so} +# Client plugins +rm %{buildroot}%{_libdir}/%{pkg_name}/plugin/{dialog.so,mysql_clear_password.so,sha256_password.so} +%if %{with gssapi} +rm %{buildroot}%{_libdir}/%{pkg_name}/plugin/auth_gssapi_client.so +%endif +%endif -rm %{buildroot}%{_bindir}/{mariadb_config,mysql_config*} +%if %{without clibrary} || %{without devel} +rm %{buildroot}%{_bindir}/mysql_config* +rm %{buildroot}%{_bindir}/mariadb_config +rm %{buildroot}%{_bindir}/mariadb-config rm %{buildroot}%{_mandir}/man1/mysql_config*.1* -unlink %{buildroot}%{_mandir}/man1/mariadb_config.1* +%endif -rm %{buildroot}%{_includedir}/mysql/{mysql_version.h,errmsg.h,ma_list.h,ma_pvio.h,mariadb_com.h,\ -mariadb_ctype.h,mariadb_dyncol.h,mariadb_stmt.h,mariadb_version.h,ma_tls.h,mysqld_error.h,mysql.h} +%if %{without clibrary} && %{with devel} +# This files are already included in mariadb-connector-c +rm %{buildroot}%{_includedir}/mysql/mysql_version.h +rm %{buildroot}%{_includedir}/mysql/{errmsg.h,ma_list.h,ma_pvio.h,mariadb_com.h,\ +mariadb_ctype.h,mariadb_dyncol.h,mariadb_stmt.h,mariadb_version.h,ma_tls.h,mysqld_error.h,mysql.h,mariadb_rpl.h} rm -r %{buildroot}%{_includedir}/mysql/{mariadb,mysql} +%endif +%if %{without devel} +rm -r %{buildroot}%{_includedir}/mysql +rm %{buildroot}%{_datadir}/aclocal/mysql.m4 +rm %{buildroot}%{_libdir}/pkgconfig/mariadb.pc +%if %{with clibrary} +rm %{buildroot}%{_libdir}/libmariadb*.so +unlink %{buildroot}%{_libdir}/libmysqlclient.so +unlink %{buildroot}%{_libdir}/libmysqlclient_r.so +%endif +%endif -rm %{buildroot}%{_mandir}/man1/tokuft* -rm -r %{buildroot}%{_datadir}/sql-bench +%if %{without client} +rm %{buildroot}%{_bindir}/msql2mysql +rm %{buildroot}%{_bindir}/{mysql,mariadb} +rm %{buildroot}%{_bindir}/mysql{access,admin,binlog,check,dump,_find_rows,import,_plugin,show,slap,_waitpid} +rm %{buildroot}%{_bindir}/mariadb-{access,admin,binlog,check,dump,find-rows,import,plugin,show,slap,waitpid} +rm %{buildroot}%{_mandir}/man1/msql2mysql.1* +rm %{buildroot}%{_mandir}/man1/{mysql,mariadb}.1* +rm %{buildroot}%{_mandir}/man1/mysql{access,admin,binlog,check,dump,_find_rows,import,_plugin,show,slap,_waitpid}.1* +rm %{buildroot}%{_mandir}/man1/mariadb-{access,admin,binlog,check,dump,find-rows,import,plugin,show,slap,waitpid}.1* +%endif +%if %{without config} +rm %{buildroot}%{_sysconfdir}/my.cnf +%endif + +%if %{without common} +rm -r %{buildroot}%{_datadir}/%{pkg_name}/charsets +%endif + +%if %{without errmsg} +rm %{buildroot}%{_datadir}/%{pkg_name}/errmsg-utf8.txt +rm -r %{buildroot}%{_datadir}/%{pkg_name}/{english,czech,danish,dutch,estonian,\ +french,german,greek,hungarian,italian,japanese,korean,norwegian,norwegian-ny,\ +polish,portuguese,romanian,russian,serbian,slovak,spanish,swedish,ukrainian,hindi} +%endif + +%if %{without test} +%if %{with embedded} +rm %{buildroot}%{_bindir}/{mysql_client_test_embedded,mysqltest_embedded} +rm %{buildroot}%{_bindir}/{mariadb-client-test-embedded,mariadb-test-embedded} +rm %{buildroot}%{_mandir}/man1/{mysql_client_test_embedded,mysqltest_embedded}.1* +rm %{buildroot}%{_mandir}/man1/{mariadb-client-test-embedded,mariadb-test-embedded}.1* +%endif # embedded +rm %{buildroot}%{_bindir}/{mysql_client_test,mysqltest} +rm %{buildroot}%{_bindir}/{mariadb-client-test,mariadb-test} +rm %{buildroot}%{_mandir}/man1/{mysql_client_test,mysqltest,my_safe_process}.1* +rm %{buildroot}%{_mandir}/man1/{mariadb-client-test,mariadb-test}.1* +rm %{buildroot}%{_mandir}/man1/{mysql-test-run,mysql-stress-test}.pl.1* +rm %{buildroot}/suite/plugins/pam/mariadb_mtr +rm %{buildroot}/suite/plugins/pam/pam_mariadb_mtr.so +%endif + +%if %{without galera} +rm %{buildroot}%{_sysconfdir}/sysconfig/clustercheck +rm %{buildroot}%{_bindir}/{clustercheck,galera_new_cluster} +rm %{buildroot}%{_bindir}/galera_recovery +rm %{buildroot}%{_datadir}/%{pkg_name}/systemd/use_galera_new_cluster.conf +%endif + +%if %{without rocksdb} +rm %{buildroot}%{_mandir}/man1/{mysql_,mariadb-}ldb.1* +rm %{buildroot}%{_mandir}/man1/myrocks_hotbackup.1* +%endif + +%if %{without backup} +rm %{buildroot}%{_mandir}/man1/maria{,db-}backup.1* +rm %{buildroot}%{_mandir}/man1/mbstream.1* +%endif + +%if %{without s3} +rm %{buildroot}%{_mandir}/man1/aria_s3_copy.1* +%endif %check -%if %runtest +%if %{with test} +%if %runselftest +# hack to let 32- and 64-bit tests run concurrently on same build machine export MTR_PARALLEL=1 -export MTR_BUILD_THREAD=%{__isa_bits} - +export MTR_BUILD_THREAD=$(( $(date +%s) % 1100 )) ( set -ex - - cd mysql-test - perl ./mysql-test-run.pl --parallel=auto --force --retry=1 --ssl \ - --suite-timeout=900 --testcase-timeout=30 \ - --mysqld=--binlog-format=mixed --force-restart \ - --shutdown-timeout=60 --max-test-fail=5 --big-test \ - --skip-test=spider \ - --skip-test-list=unstable-tests - - perl ./mysql-test-run.pl --parallel=auto --force --retry=1 \ - --suite-timeout=60 --testcase-timeout=10 \ - --mysqld=--binlog-format=mixed --force-restart \ - --shutdown-timeout=60 --max-test-fail=0 --big-test \ - --skip-ssl --suite=spider,spider/bg \ + cd %{buildroot}%{_datadir}/mysql-test + + export common_testsuite_arguments=" --parallel=auto --force --retry=2 --suite-timeout=900 --testcase-timeout=30 --mysqld=--binlog-format=mixed --force-restart --shutdown-timeout=60 --max-test-fail=5 " + + # If full testsuite has already been run on this version and we don't explicitly want the full testsuite to be run + if [[ "%{last_tested_version}" == "%{version}" ]] && [[ %{force_run_testsuite} -eq 0 ]] + then + # in further rebuilds only run the basic "main" suite (~800 tests) + echo "running only base testsuite" + perl ./mysql-test-run.pl $common_testsuite_arguments --ssl --suite=main --mem --skip-test-list=unstable-tests + fi + + # If either this version wasn't marked as tested yet or I explicitly want to run the testsuite, run everything we have (~4000 test) + if [[ "%{last_tested_version}" != "%{version}" ]] || [[ %{force_run_testsuite} -ne 0 ]] + then + echo "running advanced testsuite" + perl ./mysql-test-run.pl $common_testsuite_arguments --ssl --big-test --skip-test=spider \ + %if %{ignore_testsuite_result} + --max-test-fail=9999 || : + %else + --skip-test-list=unstable-tests + %endif + # Second run for the SPIDER suites that fail with SCA (ssl self signed certificate) + perl ./mysql-test-run.pl $common_testsuite_arguments --skip-ssl --big-test --mem --suite=spider,spider/bg,spider/bugfix,spider/handler \ + %if %{ignore_testsuite_result} + --max-test-fail=999 || : + %endif + # blank line + fi + + # There might be a dangling symlink left from the testing, remove it to not be installed + rm -rf ./var ) +# NOTE: the Spider SE has 2 more hidden testsuites "oracle" and "oracle2". +# however, all of the tests fail with: "failed: 12521: Can't use wrapper 'oracle' for SQL connection" + +%endif %endif %pre server -/usr/sbin/groupadd -g 27 -o -r mysql &> /dev/null || : -/usr/sbin/useradd -M -N -g mysql -o -r -d /var/lib/mysql -s /sbin/nologin \ - -c "MySQL Server" -u 27 mysql &> /dev/null || : - - -%ldconfig_scriptlets embedded +/usr/sbin/groupadd -g 27 -o -r mysql >/dev/null 2>&1 || : +/usr/sbin/useradd -M -N -g mysql -o -r -d %{mysqluserhome} -s /sbin/nologin \ + -c "MySQL Server" -u 27 mysql >/dev/null 2>&1 || : +%if %{with galera} %post server-galera -semanage port -a -t mysqld_port_t -p tcp 4568 &> /dev/null || : -semanage port -a -t mysqld_port_t -p tcp 4567 &> /dev/null || : -semanage port -a -t mysqld_port_t -p udp 4567 &> /dev/null || : +# Allow ports needed for the replication: +# https://mariadb.com/kb/en/library/configuring-mariadb-galera-cluster/#network-ports +# Galera Replication Port +semanage port -a -t mysqld_port_t -p tcp 4567 >/dev/null 2>&1 || : +semanage port -a -t mysqld_port_t -p udp 4567 >/dev/null 2>&1 || : +# IST Port +semanage port -a -t mysqld_port_t -p tcp 4568 >/dev/null 2>&1 || : +# SST Port +semanage port -a -t mysqld_port_t -p tcp 4444 >/dev/null 2>&1 || : + +semodule -i %{_datadir}/selinux/packages/%{name}/%{name}-server-galera.pp >/dev/null 2>&1 || : +%endif %post server -%systemd_post %{name}.service +%systemd_post %{daemon_name}.service %preun server -%systemd_preun %{name}.service +%systemd_preun %{daemon_name}.service +%if %{with galera} %postun server-galera if [ $1 -eq 0 ]; then semodule -r %{name}-server-galera 2>/dev/null || : fi +%endif %postun server -%systemd_postun_with_restart %{name}.service +%systemd_postun_with_restart %{daemon_name}.service +%if %{with client} %files -%config(noreplace) %{_sysconfdir}/my.cnf.d/mysql-clients.cnf -%{_bindir}/mysql -%{_bindir}/mysql_find_rows -%{_bindir}/mysqlbinlog -%{_bindir}/mysqlcheck -%{_bindir}/mysqldump - -%{_bindir}/mysql_waitpid -%{_bindir}/mysqlaccess -%{_bindir}/mysqladmin - -%{_bindir}/mysqlimport -%{_bindir}/mysql_plugin - -%{_bindir}/mysqlshow -%{_bindir}/mysqlslap %{_bindir}/msql2mysql +%{_bindir}/{mysql,mariadb} +%{_bindir}/mysql{access,admin,binlog,check,dump,_find_rows,import,_plugin,show,slap,_waitpid} +%{_bindir}/mariadb-{access,admin,binlog,check,dump,find-rows,import,plugin,show,slap,waitpid} -%{_mandir}/man1/mysql.1* -%{_mandir}/man1/mysqlaccess.1* -%{_mandir}/man1/mysqladmin.1* -%{_mandir}/man1/mysqlbinlog.1* -%{_mandir}/man1/mysqlcheck.1* -%{_mandir}/man1/mysqldump.1* -%{_mandir}/man1/mysqlimport.1* -%{_mandir}/man1/mysqlshow.1* -%{_mandir}/man1/mysqlslap.1* %{_mandir}/man1/msql2mysql.1* -%{_mandir}/man1/mysql_find_rows.1* -%{_mandir}/man1/mysql_plugin.1* -%{_mandir}/man1/mysql_waitpid.1* +%{_mandir}/man1/{mysql,mariadb}.1* +%{_mandir}/man1/mysql{access,admin,binlog,check,dump,_find_rows,import,_plugin,show,slap,_waitpid}.1* +%{_mandir}/man1/mariadb-{access,admin,binlog,check,dump,find-rows,import,plugin,show,slap,waitpid}.1* +%config(noreplace) %{_sysconfdir}/my.cnf.d/mysql-clients.cnf +%endif +%if %{with clibrary} +%files libs +%exclude %{_libdir}/{libmysqlclient.so.18,libmariadb.so,libmysqlclient.so,libmysqlclient_r.so} +%{_libdir}/libmariadb.so* +%config(noreplace) %{_sysconfdir}/my.cnf.d/client.cnf +%endif -%files common -%doc %{_defaultdocdir}/%{name} -%dir %{_datadir}/%{name} +%if %{with config} +%files config +# although the default my.cnf contains only server settings, we put it in the +# common package because it can be used for client settings too. +%dir %{_sysconfdir}/my.cnf.d %config(noreplace) %{_sysconfdir}/my.cnf -%{_datadir}/%{name}/charsets +%endif -%files errmessage -%{_datadir}/%{name}/errmsg-utf8.txt -%{_datadir}/%{name}/*/errmsg.sys +%if %{with common} +%files common +%doc %{_datadir}/doc/%{_pkgdocdirname} +%dir %{_datadir}/%{pkg_name} +%{_datadir}/%{pkg_name}/charsets +%if %{with clibrary} +%{_libdir}/%{pkg_name}/plugin/dialog.so +%{_libdir}/%{pkg_name}/plugin/mysql_clear_password.so +%endif +%endif + +%if %{with errmsg} +%files errmsg +%{_datadir}/%{pkg_name}/errmsg-utf8.txt +%{_datadir}/%{pkg_name}/english +%lang(cs) %{_datadir}/%{pkg_name}/czech +%lang(da) %{_datadir}/%{pkg_name}/danish +%lang(nl) %{_datadir}/%{pkg_name}/dutch +%lang(et) %{_datadir}/%{pkg_name}/estonian +%lang(fr) %{_datadir}/%{pkg_name}/french +%lang(de) %{_datadir}/%{pkg_name}/german +%lang(el) %{_datadir}/%{pkg_name}/greek +%lang(hi) %{_datadir}/%{pkg_name}/hindi +%lang(hu) %{_datadir}/%{pkg_name}/hungarian +%lang(it) %{_datadir}/%{pkg_name}/italian +%lang(ja) %{_datadir}/%{pkg_name}/japanese +%lang(ko) %{_datadir}/%{pkg_name}/korean +%lang(no) %{_datadir}/%{pkg_name}/norwegian +%lang(no) %{_datadir}/%{pkg_name}/norwegian-ny +%lang(pl) %{_datadir}/%{pkg_name}/polish +%lang(pt) %{_datadir}/%{pkg_name}/portuguese +%lang(ro) %{_datadir}/%{pkg_name}/romanian +%lang(ru) %{_datadir}/%{pkg_name}/russian +%lang(sr) %{_datadir}/%{pkg_name}/serbian +%lang(sk) %{_datadir}/%{pkg_name}/slovak +%lang(es) %{_datadir}/%{pkg_name}/spanish +%lang(sv) %{_datadir}/%{pkg_name}/swedish +%lang(uk) %{_datadir}/%{pkg_name}/ukrainian +%endif +%if %{with galera} +%files server-galera +%doc Docs/README-wsrep +%license LICENSE.clustercheck +%{_bindir}/clustercheck +%{_bindir}/galera_new_cluster +%{_bindir}/galera_recovery +%config(noreplace) %{_sysconfdir}/my.cnf.d/galera.cnf +%attr(0640,root,root) %ghost %config(noreplace) %{_sysconfdir}/sysconfig/clustercheck +%{_datadir}/selinux/packages/%{name}/%{name}-server-galera.pp +%endif %files server -%{_tmpfilesdir}/%{name}.conf -%{_sysusersdir}/%{name}.conf -%config(noreplace) %{_sysconfdir}/my.cnf.d/%{name}-server.cnf -%config(noreplace) %{_sysconfdir}/my.cnf.d/enable_encryption.preset -%{_bindir}/aria* +%{_bindir}/aria_{chk,dump_log,ftdump,pack,read_log} %{_bindir}/mariadb-service-convert -%{_bindir}/myisam* +%{_bindir}/myisamchk +%{_bindir}/myisam_ftdump +%{_bindir}/myisamlog +%{_bindir}/myisampack %{_bindir}/my_print_defaults -%{_bindir}/mysql_install_db -%{_bindir}/mysql_secure_installation -%{_bindir}/mysql_tzinfo_to_sql -%{_bindir}/mysqld_safe -%{_bindir}/mysql_convert_table_format -%{_bindir}/mysql_fix_extensions -%{_bindir}/mysql_setpermission -%{_bindir}/mysqldumpslow -%{_bindir}/mysqld_multi -%{_bindir}/mysqlhotcopy -%{_bindir}/mysql_upgrade -%{_bindir}/mysqld_safe_helper -%{_bindir}/perror + +%{_bindir}/mariadb-conv + +%{_bindir}/mysql_{install_db,secure_installation,tzinfo_to_sql} +%{_bindir}/mariadb-{install-db,secure-installation,tzinfo-to-sql} +%{_bindir}/{mysqld_,mariadbd-}safe +%{_bindir}/{mysqld_safe_helper,mariadbd-safe-helper} + %{_bindir}/innochecksum %{_bindir}/replace -%{_bindir}/resolve* +%{_bindir}/resolve_stack_dump +%{_bindir}/resolveip +%if %{with galera} +# wsrep_sst_common should be moved to /usr/share/mariadb: https://jira.mariadb.org/browse/MDEV-14296 %{_bindir}/wsrep_* +%endif + +%config(noreplace) %{_sysconfdir}/my.cnf.d/%{pkg_name}-server.cnf +%config(noreplace) %{_sysconfdir}/my.cnf.d/enable_encryption.preset +%config(noreplace) %{_sysconfdir}/my.cnf.d/spider.cnf + +%{_sbindir}/mysqld +%{_sbindir}/mariadbd +%{_libexecdir}/{mysqld,mariadbd} + +%{_libdir}/%{pkg_name}/INFO_SRC +%{_libdir}/%{pkg_name}/INFO_BIN +%if %{without common} +%dir %{_datadir}/%{pkg_name} +%endif + +%dir %{_libdir}/%{pkg_name} +%dir %{_libdir}/%{pkg_name}/plugin + +%{_libdir}/%{pkg_name}/plugin/* +%{?with_oqgraph:%exclude %{_libdir}/%{pkg_name}/plugin/ha_oqgraph.so} +%{?with_connect:%exclude %{_libdir}/%{pkg_name}/plugin/ha_connect.so} +%{?with_cracklib:%exclude %{_libdir}/%{pkg_name}/plugin/cracklib_password_check.so} +%{?with_rocksdb:%exclude %{_libdir}/%{pkg_name}/plugin/ha_rocksdb.so} +%{?with_gssapi:%exclude %{_libdir}/%{pkg_name}/plugin/auth_gssapi.so} +%{?with_sphinx:%exclude %{_libdir}/%{pkg_name}/plugin/ha_sphinx.so} +%{?with_s3:%exclude %{_libdir}/%{pkg_name}/plugin/ha_s3.so} +%if %{with clibrary} +%exclude %{_libdir}/%{pkg_name}/plugin/dialog.so +%exclude %{_libdir}/%{pkg_name}/plugin/mysql_clear_password.so +%endif -%{_libexecdir}/mysqld -%dir %{_libdir}/%{name} -%dir %{_libdir}/%{name}/plugin -%{_libdir}/%{name}/plugin/* -%{_libdir}/%{name}/INFO_* -%exclude %{_libdir}/%{name}/plugin/ha_oqgraph.so +# PAM plugin; moved to a standalone sub-package +%exclude %{_libdir}/%{pkg_name}/plugin/{auth_pam_v1.so,auth_pam.so} +%exclude %dir %{_libdir}/%{pkg_name}/plugin/auth_pam_tool_dir +%exclude %{_libdir}/%{pkg_name}/plugin/auth_pam_tool_dir/auth_pam_tool -%{_mandir}/man1/aria* -%{_mandir}/man1/galera* +%{_mandir}/man1/aria_{chk,dump_log,ftdump,pack,read_log}.1* +%{_mandir}/man1/galera_new_cluster.1* +%{_mandir}/man1/galera_recovery.1* %{_mandir}/man1/mariadb-service-convert.1* -%{_mandir}/man1/myisam* +%{_mandir}/man1/myisamchk.1* +%{_mandir}/man1/myisamlog.1* +%{_mandir}/man1/myisampack.1* +%{_mandir}/man1/myisam_ftdump.1* %{_mandir}/man1/my_print_defaults.1* -%{_mandir}/man1/mysql.server.1* -%{_mandir}/man1/mysql_install_db.1* -%{_mandir}/man1/mysql_secure_installation.1* -%{_mandir}/man1/mysql_tzinfo_to_sql.1* -%{_mandir}/man1/mysqld_safe.1* -%{_mandir}/man1/mysqld_safe_helper.1* -%{_mandir}/man1/mysql_convert_table_format.1* -%{_mandir}/man1/mysql_fix_extensions.1* -%{_mandir}/man1/mysqldumpslow.1* -%{_mandir}/man1/mysqld_multi.1* -%{_mandir}/man1/mysqlhotcopy.1* -%{_mandir}/man1/mysql_setpermission.1* -%{_mandir}/man1/mysql_upgrade.1* -%{_mandir}/man1/perror.1* + +%{_mandir}/man1/mariadb-conv.1* + +%{_mandir}/man1/mysql_{install_db,secure_installation,tzinfo_to_sql}.1* +%{_mandir}/man1/mariadb-{install-db,secure-installation,tzinfo-to-sql}.1* +%{_mandir}/man1/{mysqld_,mariadbd-}safe.1* +%{_mandir}/man1/{mysqld_safe_helper,mariadbd-safe-helper}.1* + %{_mandir}/man1/innochecksum.1* %{_mandir}/man1/replace.1* -%{_mandir}/man1/resolve* +%{_mandir}/man1/resolveip.1* +%{_mandir}/man1/resolve_stack_dump.1* +%{_mandir}/man8/{mysqld,mariadbd}.8* %{_mandir}/man1/wsrep_*.1* -%{_mandir}/man8/mysqld.8* -%{_datadir}/%{name}/*.sql -%{_datadir}/%{name}/wsrep.cnf -%{_datadir}/%{name}/wsrep_notify -%dir %{_datadir}/%{name}/policy -%dir %{_datadir}/%{name}/policy/selinux -%{_datadir}/%{name}/policy/selinux/* -%{_datadir}/%{name}/systemd/*.service +%{_mandir}/man1/mysql.server.1* -%{_unitdir}/%{name}* +%{_datadir}/%{pkg_name}/fill_help_tables.sql +%{_datadir}/%{pkg_name}/maria_add_gis_sp.sql +%{_datadir}/%{pkg_name}/maria_add_gis_sp_bootstrap.sql +%{_datadir}/%{pkg_name}/mysql_system_tables.sql +%{_datadir}/%{pkg_name}/mysql_system_tables_data.sql +%{_datadir}/%{pkg_name}/mysql_test_data_timezone.sql +%{_datadir}/%{pkg_name}/mysql_performance_tables.sql +%{_datadir}/%{pkg_name}/mysql_test_db.sql +%if %{with mroonga} +%{_datadir}/%{pkg_name}/mroonga/install.sql +%{_datadir}/%{pkg_name}/mroonga/uninstall.sql +%license %{_datadir}/%{pkg_name}/mroonga/COPYING +%license %{_datadir}/%{pkg_name}/mroonga/AUTHORS +%license %{_datadir}/%{name}-server/groonga-normalizer-mysql/lgpl-2.0.txt +%license %{_datadir}/%{name}-server/groonga/COPYING +%doc %{_datadir}/%{name}-server/groonga-normalizer-mysql/README.md +%doc %{_datadir}/%{name}-server/groonga/README.md +%endif +%if %{with galera} +%{_datadir}/%{pkg_name}/wsrep.cnf +%endif +%{_datadir}/%{pkg_name}/wsrep_notify +%dir %{_datadir}/%{pkg_name}/policy +%dir %{_datadir}/%{pkg_name}/policy/selinux +%{_datadir}/%{pkg_name}/policy/selinux/README +%{_datadir}/%{pkg_name}/policy/selinux/mariadb-server.* +%{_datadir}/%{pkg_name}/policy/selinux/mariadb.* + +%{_unitdir}/%{daemon_name}* + +%{_libexecdir}/mariadb-prepare-db-dir +%{_libexecdir}/mariadb-check-socket +%{_libexecdir}/mariadb-check-upgrade +%{_libexecdir}/mariadb-scripts-common + +%attr(0755,mysql,mysql) %dir %{pidfiledir} +%attr(0755,mysql,mysql) %dir %{dbdatadir} +%attr(0750,mysql,mysql) %dir %{logfiledir} +%attr(0660,mysql,mysql) %config %ghost %verify(not md5 size mtime) %{logfile} +%config(noreplace) %{logrotateddir}/%{daemon_name} -%attr(0755,mysql,mysql) %dir %{_rundir}/%{name} -%attr(0755,mysql,mysql) %dir %{_localstatedir}/lib/mysql -%attr(0750,mysql,mysql) %dir %{_localstatedir}/log/%{name} -%attr(0640,mysql,mysql) %config %ghost %verify(not md5 size mtime) %{_localstatedir}/log/%{name}/%{name}.log -%config(noreplace) %{_sysconfdir}/logrotate.d/%{name} +%{_tmpfilesdir}/%{name}.conf +%{_sysusersdir}/%{name}.conf +%if %{with cracklib} +%files cracklib-password-check +%config(noreplace) %{_sysconfdir}/my.cnf.d/cracklib_password_check.cnf +%{_libdir}/%{pkg_name}/plugin/cracklib_password_check.so +%endif -%files server-galera -%doc Docs/README-wsrep -%config(noreplace) %{_sysconfdir}/my.cnf.d/galera.cnf -%attr(0640,root,root) %ghost %config(noreplace) %{_sysconfdir}/sysconfig/clustercheck -%{_bindir}/galera_new_cluster -%{_bindir}/galera_recovery -%{_datadir}/%{name}/systemd/use_galera_new_cluster.conf +%if %{with backup} +%files backup +%{_bindir}/maria{,db-}backup +%{_bindir}/mbstream +%{_mandir}/man1/maria{,db-}backup.1* +%{_mandir}/man1/mbstream.1* +%endif +%if %{with rocksdb} +%files rocksdb-engine +%config(noreplace) %{_sysconfdir}/my.cnf.d/rocksdb.cnf +%{_bindir}/myrocks_hotbackup +%{_bindir}/{mysql_,mariadb-}ldb +%{_bindir}/sst_dump +%{_libdir}/%{pkg_name}/plugin/ha_rocksdb.so +%{_mandir}/man1/{mysql_,mariadb-}ldb.1* +%{_mandir}/man1/myrocks_hotbackup.1* +%endif + +%if %{with gssapi} %files gssapi-server +%{_libdir}/%{pkg_name}/plugin/auth_gssapi.so %config(noreplace) %{_sysconfdir}/my.cnf.d/auth_gssapi.cnf -%{_libdir}/%{name}/plugin/auth_gssapi.so - +%endif -%files devel -%{_includedir}/* -%{_datadir}/aclocal/mysql.m4 -%{_libdir}/pkgconfig/mariadb.pc +%if %{with pam} +%files pam +%{_libdir}/%{pkg_name}/plugin/{auth_pam_v1.so,auth_pam.so} +%attr(0755,root,root) %dir %{_libdir}/%{pkg_name}/plugin/auth_pam_tool_dir +# SUID-to-root binary. Access MUST be restricted (https://jira.mariadb.org/browse/MDEV-25126) +%attr(4750,root,mysql) %{_libdir}/%{pkg_name}/plugin/auth_pam_tool_dir/auth_pam_tool +%{_libdir}/security/pam_user_map.so +%{_sysconfdir}/security/user_map.conf +%endif +%if %{with sphinx} +%files sphinx-engine +%{_libdir}/%{pkg_name}/plugin/ha_sphinx.so +%endif +%if %{with oqgraph} %files oqgraph-engine %config(noreplace) %{_sysconfdir}/my.cnf.d/oqgraph.cnf -%{_libdir}/%{name}/plugin/ha_oqgraph.so - +%{_libdir}/%{pkg_name}/plugin/ha_oqgraph.so +%endif -%files backup -%{_bindir}/mariabackup -%{_bindir}/mbstream +%if %{with connect} +%files connect-engine +%config(noreplace) %{_sysconfdir}/my.cnf.d/connect.cnf +%{_libdir}/%{pkg_name}/plugin/ha_connect.so +%endif +%if %{with s3} +%files s3-engine +%{_bindir}/aria_s3_copy +%{_mandir}/man1/aria_s3_copy.1* +%config(noreplace) %{_sysconfdir}/my.cnf.d/s3.cnf +%{_libdir}/%{pkg_name}/plugin/ha_s3.so +%endif -%files cracklib -%config(noreplace) %{_sysconfdir}/my.cnf.d/cracklib_password_check.cnf -%{_libdir}/%{name}/plugin/cracklib_password_check.so +%files server-utils +# Perl utilities +%{_bindir}/mysql{_convert_table_format,dumpslow,_fix_extensions,hotcopy,_setpermission} +%{_bindir}/mariadb-{convert-table-format,dumpslow,fix-extensions,hotcopy,setpermission} +%{_bindir}/{mysqld_,mariadbd-}multi + +%{_mandir}/man1/mysql{_convert_table_format,dumpslow,_fix_extensions,hotcopy,_setpermission}.1* +%{_mandir}/man1/mariadb-{convert-table-format,dumpslow,fix-extensions,hotcopy,setpermission}.1* +%{_mandir}/man1/{mysqld_,mariadbd-}multi.1* +# Utilities that can be used remotely +%{_bindir}/{mysql_,mariadb-}upgrade +%{_bindir}/perror +%{_mandir}/man1/{mysql_,mariadb-}upgrade.1* +%{_mandir}/man1/perror.1* +%if %{with devel} +%files devel +%{_includedir}/* +%{_datadir}/aclocal/mysql.m4 +%{_libdir}/pkgconfig/*mariadb.pc +%if %{with clibrary} +%{_libdir}/{libmysqlclient.so.18,libmariadb.so,libmysqlclient.so,libmysqlclient_r.so} +%{_bindir}/mysql_config* +%{_bindir}/mariadb_config* +%{_bindir}/mariadb-config +%{_libdir}/libmariadb.so +%{_libdir}/libmysqlclient.so +%{_libdir}/libmysqlclient_r.so +%{_mandir}/man1/mysql_config* +%endif +%endif +%if %{with embedded} %files embedded %{_libdir}/libmariadbd.so.* - %files embedded-devel %{_libdir}/libmysqld.so %{_libdir}/libmariadbd.so +%endif - +%if %{with test} %files test -%{_bindir}/mysqltest -%{_bindir}/mysql_client_test +%if %{with embedded} %{_bindir}/test-connect-t -%{_bindir}/mysql_client_test_embedded -%{_bindir}/mysqltest_embedded +%{_bindir}/{mysql_client_test_embedded,mysqltest_embedded} +%{_bindir}/{mariadb-client-test-embedded,mariadb-test-embedded} +%{_mandir}/man1/{mysql_client_test_embedded,mysqltest_embedded}.1* +%{_mandir}/man1/{mariadb-client-test-embedded,mariadb-test-embedded}.1* +%endif +%{_bindir}/{mysql_client_test,mysqltest,mariadb-client-test,mariadb-test} %{_bindir}/my_safe_process -%{_mandir}/man1/mysql_client_test.1* +%attr(-,mysql,mysql) %{_datadir}/mysql-test +%{_mandir}/man1/{mysql_client_test,mysqltest,mariadb-client-test,mariadb-test}.1* %{_mandir}/man1/my_safe_process.1* -%{_mandir}/man1/mysqltest.1* -%{_mandir}/man1/mysql_client_test_embedded.1* -%{_mandir}/man1/mysqltest_embedded.1* %{_mandir}/man1/mysql-stress-test.pl.1* %{_mandir}/man1/mysql-test-run.pl.1* -%attr(-,mysql,mysql) %{_datadir}/mysql-test - +%endif %changelog -* Mon Apr 26 2021 bzhaoop -3:10.3.9-12 -- Fix CVE-2021-27928 - -* Tue Sep 8 2020 lihaotian -3:10.3.9-11 -- Update the source0 url - -* Fri Jul 10 2020 volcanodragon -3:10.3.9-10 -- Rename patch names - -* Fri Jul 3 2020 jinzhimin -3:10.3.9-9 -- Add conflict between mysql - -* Mon Mar 2 2020 steven - 3:10.3.9-8 -- Add requires exclude for perls and skip some test cases - -* Sun Jan 19 2020 openEuler Buildteam - 3:10.3.9-7 -- Add mysql_install_db command in service file - -* Wed Jan 15 2020 openEuler Buildteam - 3:10.3.9-6 -- Add my.cnf file - -* Wed Jan 8 2020 openEuler Buildteam - 3:10.3.9-5 -- Repackaged - -* Tue Dec 31 2019 openEuler Buildteam - 3:10.3.9-4 -- Package rewrap and update the release number - -* Wed Sep 11 2019 openEuler Buildteam - 3:10.3.9-3 -- Package init +* Wed Jun 16 2021 bzhaoop -4:10.5.10-1 +- Package init for new version 10.5.10 diff --git a/mariadb.tmpfiles.d.in b/mariadb.tmpfiles.d.in new file mode 100644 index 0000000000000000000000000000000000000000..9e6b6e8bf58dc532bbd1c3d8280fd591d292f46a --- /dev/null +++ b/mariadb.tmpfiles.d.in @@ -0,0 +1,3 @@ +# Do not edit this file. +# To override this, put /etc/tmpfiles.d/mariadb.conf instead. +d @PID_FILE_DIR@ 0755 mysql mysql - diff --git a/my.cnf.in b/my.cnf.in new file mode 100644 index 0000000000000000000000000000000000000000..247e12d8e31678188fe96495defbfe99a0464aef --- /dev/null +++ b/my.cnf.in @@ -0,0 +1,18 @@ +# +# This group is read both both by the client and the server +# use it for options that affect everything +# +[client-server] + +# +# This group is read by the server +# +[mysqld] +# Disabling symbolic-links is recommended to prevent assorted security risks +symbolic-links=0 + +# +# include all files from the config directory +# +!includedir @INSTALL_SYSCONF2DIR@ + diff --git a/mysql.service.in b/mysql.service.in new file mode 100644 index 0000000000000000000000000000000000000000..91dfecadc24536a154b13ec47cbf6a0d80af2ff8 --- /dev/null +++ b/mysql.service.in @@ -0,0 +1,64 @@ +# It's not recommended to modify this file in-place, because it will be +# overwritten during package upgrades. If you want to customize, the +# best way is to: +# +# root> systemctl edit @DAEMON_NAME@.service +# +# Then add additonal directives under a section (probably [Service]). +# +# For more info about custom unit files, see systemd.unit(5) or +# http://fedoraproject.org/wiki/Systemd#How_do_I_customize_a_unit_file.2F_add_a_custom_unit_file.3F +# +# For example, if you want to increase MariaDB's open-files-limit to 10000, +# you need to increase systemd's LimitNOFILE setting, use the contents below: +# +# [Service] +# LimitNOFILE=10000 +# + +[Unit] +Description=@NICE_PROJECT_NAME@ @MAJOR_VERSION@.@MINOR_VERSION@ database server +Documentation=man:mariadbd(8) +Documentation=https://mariadb.com/kb/en/library/systemd/ +After=network.target + +[Install] +WantedBy=multi-user.target +Alias=mysql.service +Alias=mysqld.service + +[Service] +Type=notify +User=mysql +Group=mysql + +ExecStartPre=@libexecdir@/mariadb-check-socket +# '%n' expands to 'Full unit name'; man systemd.unit +ExecStartPre=@libexecdir@/mariadb-prepare-db-dir %n +# MYSQLD_OPTS here is for users to set in /etc/systemd/system/@DAEMON_NAME@@.service.d/MY_SPECIAL.conf +# Note: we set --basedir to prevent probes that might trigger SELinux alarms, +# per bug #547485 +ExecStart=@libexecdir@/mariadbd --basedir=@prefix@ $MYSQLD_OPTS $_WSREP_NEW_CLUSTER +ExecStartPost=@libexecdir@/mariadb-check-upgrade + +# Setting this to true can break replication and the Type=notify settings +# See also bind-address MariaDB option. +PrivateNetwork=false + +KillSignal=SIGTERM + +# Don't want to see an automated SIGKILL ever +SendSIGKILL=no + +# Restart crashed server only, on-failure would also restart, for example, when +# my.cnf contains unknown option +Restart=on-abort +RestartSec=5s + +UMask=007 + +# Give a reasonable amount of time for the server to start up/shut down +TimeoutSec=300 + +# Place temp files in a secure directory, not /tmp +PrivateTmp=true diff --git a/mysql@.service.in b/mysql@.service.in new file mode 100644 index 0000000000000000000000000000000000000000..acb2c57c147fe25dce579ce47d6a40415c2b980b --- /dev/null +++ b/mysql@.service.in @@ -0,0 +1,85 @@ +# Multi instance version of MariaDB. For if you run mutiple verions at once. +# Also used for @DAEMON_NAME@@bootstrap to bootstrap Galera. +# +# To use multi instance variant, use [mariadbd.INSTANCENAME] as sections in +# @sysconfdir@/@my.cnf to change per instance settings. A minimumal necessary +# configuration items to change to avoid conflicts between instances is: +# +# [mariadbd.instancename] +# # TCP port to make available for clients +# port=3306 +# # Socket to make available for clients +# socket=/tmp/mariadb-instancename.sock +# # Where MariaDB should store all its data +# datadir=/usr/local/mariadb-instancename/data +# +# and start the service via: +# +# root> systemctl start @DAEMON_NAME@@{instancename}.server +# +# It's not recommended to modify this file in-place, because it will be +# overwritten during package upgrades. If you want to customize, for +# all instances, the best way is: +# +# root> systemctl edit @DAEMON_NAME@@.service +# +# Then add additonal directives under a section (probably [Service]). +# +# If you only want to change a specific instance: +# +# root> systemctl edit @DAEMON_NAME@@{instancename}.server +# +# For more info about custom unit files, see systemd.unit(5) or +# http://fedoraproject.org/wiki/Systemd#How_do_I_customize_a_unit_file.2F_add_a_custom_unit_file.3F +# +# For example, if you want to increase MariaDB's open-files-limit to 10000, +# you need to increase systemd's LimitNOFILE setting, use the contents below: +# +# [Service] +# LimitNOFILE=10000 + +[Unit] +Description=@NICE_PROJECT_NAME@ @MAJOR_VERSION@.@MINOR_VERSION@ database server +Documentation=man:mariadbd(8) +Documentation=https://mariadb.com/kb/en/library/systemd/ +After=network.target + +[Install] +WantedBy=multi-user.target +Alias=mysql.service +Alias=mysqld.service + +[Service] +Type=notify +User=mysql +Group=mysql + +ExecStartPre=@libexecdir@/mariadb-check-socket --defaults-group-suffix=.%I +ExecStartPre=@libexecdir@/mariadb-prepare-db-dir --defaults-group-suffix=.%I %n +# MYSQLD_OPTS here is for users to set in /etc/systemd/system/@DAEMON_NAME@@.service.d/MY_SPECIAL.conf +# Note: we set --basedir to prevent probes that might trigger SELinux alarms, +# per bug #547485 +ExecStart=@libexecdir@/mariadbd --defaults-group-suffix=.%I --basedir=@prefix@ $MYSQLD_OPTS $_WSREP_NEW_CLUSTER +ExecStartPost=@libexecdir@/mariadb-check-upgrade --defaults-group-suffix=.%I + +# Setting this to true can break replication and the Type=notify settings +# See also bind-address MariaDB option. +PrivateNetwork=false + +KillSignal=SIGTERM + +# Don't want to see an automated SIGKILL ever +SendSIGKILL=no + +# Restart crashed server only, on-failure would also restart, for example, when +# my.cnf contains unknown option +Restart=on-abort +RestartSec=5s + +UMask=007 + +# Give a reasonable amount of time for the server to start up/shut down +TimeoutSec=300 + +# Place temp files in a secure directory, not /tmp +PrivateTmp=true diff --git a/mysql_config_multilib.sh b/mysql_config_multilib.sh new file mode 100644 index 0000000000000000000000000000000000000000..06c2a2b45dc2cd3ec4c58a5fad43543873954bfa --- /dev/null +++ b/mysql_config_multilib.sh @@ -0,0 +1,26 @@ +#! /bin/sh +# +# Wrapper script for mysql_config to support multilib +# +# This command respects setarch + +bits=$(rpm --eval %__isa_bits) + +case $bits in + 32|64) status=known ;; + *) status=unknown ;; +esac + +if [ "$status" = "unknown" ] ; then + echo "$0: error: command 'rpm --eval %__isa_bits' returned unknown value: $bits" + exit 1 +fi + + +if [ -x @bindir@/mysql_config-$bits ] ; then + @bindir@/mysql_config-$bits "$@" +else + echo "$0: error: needed binary: @bindir@/mysql_config-$bits is missing" + exit 1 +fi + diff --git a/skipped-tests-arm.list b/skipped-tests-arm.list new file mode 100644 index 0000000000000000000000000000000000000000..ec2e9208545c111bf22afdcabc576724a7f90725 --- /dev/null +++ b/skipped-tests-arm.list @@ -0,0 +1,5 @@ +# Fails since 10.3.17, only on armv7hl +versioning.partition : + +# Fail since 10.4.16 only on armv7hl +versioning.partition_rotation : diff --git a/skipped-tests-base.list b/skipped-tests-base.list new file mode 100644 index 0000000000000000000000000000000000000000..a0bb6a896d6d2ae91bfaf04768df36cd53482733 --- /dev/null +++ b/skipped-tests-base.list @@ -0,0 +1,54 @@ +# The SSL test are failing correctly. Fro more explanation, see: +# https://jira.mariadb.org/browse/MDEV-8404?focusedCommentId=84275&page=com.atlassian.jira.plugin.system.issuetabpanels%3Acomment-tabpanel#comment-84275 +main.ssl_7937 : #1399847 +main.ssl_8k_key : +main.ssl_crl : #1399847 + +# ------------------------------ +# Tests that fails because of 'Self Signed Certificate in the Certificate Chain' +perfschema.cnf_option : + +rpl.rpl_row_img_blobs : +rpl.rpl_row_img_eng_min : +rpl.rpl_row_img_eng_noblob : + +sys_vars.slave_parallel_threads_basic : + +# ------------------------------ +# Expected to fail, the plugin is not build with server, but 'mariadb-connector-c' instead +plugins.auth_ed25519 : +plugins.multiauth : + +# ------------------------------ +perfschema.nesting : #1399847 +perfschema.socket_summary_by_instance_func : #1399847 +perfschema.socket_summary_by_event_name_func : + +# ------------------------------ +# Fails since 10.1.12 +innodb.innodb_defrag_binlog : + +# Fails everywhere since 10.2.15 +main.userstat : + +# Fails everywhere since 10.4.11 +main.events_bugs : +sys_vars.tcp_nodelay : + +# Fails on i686 +encryption.innodb-redo-badkey : + +# Fails since 10.5.2 +main.mysqld--help2 : +disks.disks : +disks.disks_notembedded : + +# Fails since 10.5.3 +main.mysqld--help-aria : + +# Fails since 10.5.4 +main.ssl_system_ca : + +# Fails since 10.5.7 +innodb.innodb_wl6326_big : +plugins.feedback_plugin_load :