From 167be92ecbce8773c2a55d20379e875787056915 Mon Sep 17 00:00:00 2001 From: Daniel <d.hornung@indiscale.com> Date: Thu, 30 Jan 2025 15:09:51 +0100 Subject: [PATCH] WIP: Making database ready for MariaDB 11.2. --- CHANGELOG.md | 4 ++++ README.md | 4 ++-- README_SETUP.md | 23 ++++++++-------------- RELEASE_GUIDELINES.md | 2 +- utils/sanity_check.sql | 44 ++++++++++++++++++++++++++++++++++++++---- 5 files changed, 55 insertions(+), 22 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5ea239a..b93f14a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,10 +11,14 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Changed +- New version requirement: MariaDB 11.2 or later. + ### Deprecated ### Removed +- MySQL support. See the deprecation in the 7.0.0 release. + ### Fixed - [SQL dump migration can now be applied twice](https://gitlab.indiscale.com/caosdb/src/caosdb-mysqlbackend/-/issues/60): Fixed an error in the regex. diff --git a/README.md b/README.md index 7094464..6b3d3a7 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,7 @@ ## Welcome -This is the **LinkAhead MySQL Backend** repository and a part of the +This is the **LinkAhead MariaDB Backend** repository and a part of the LinkAhead project. ## Setup @@ -43,7 +43,7 @@ Conduct](https://gitlab.com/linkahead/linkahead/-/blob/main/CODE_OF_CONDUCT.md). * Copyright (C) 2018 Research Group Biomedical Physics, Max Planck Institute for Dynamics and Self-Organization Göttingen. -* Copyright (C) 2020-2021 Indiscale GmbH <info@indiscale.com> +* Copyright (C) 2020-2025 Indiscale GmbH <info@indiscale.com> All files in this repository are licensed under a [GNU Affero General Public License](LICENCE.md) (version 3 or later). diff --git a/README_SETUP.md b/README_SETUP.md index 94a2e9d..a92db35 100644 --- a/README_SETUP.md +++ b/README_SETUP.md @@ -1,8 +1,8 @@ -# Setup of the CaosDB SQL back end +# Setup of the LinkAhead MariaDB back end ## Dependencies -* `MariaDB Client 10.1` or later, `MySQL Client >=5.5, <=5.7.36`. +* `MariaDB Client 11.2` or later. * make ## Create the configuration @@ -11,7 +11,7 @@ parameter that you want to change, add a corresponding line in your `.config` file. You probably want to change the passwords. As the passwords are stored unencrypted in the `.config` file, make sure nobody else can read it. - * If there is no `mysql-config-editor` (`MySQL 5.5`. and `MariaDB`) then the + * If there is no `mysql-config-editor` program, then the `MYSQL_USER_PASSWORD` must be provided, that is the password of the `MYSQL_USER`. * If you are using MariaDB and the `root` database user uses pam @@ -102,18 +102,6 @@ caosdb`. ### Troubleshooting -#### MySQL has failing tests - -Our test suite is developed with MariaDB. That is why some tests, those which -check constraints based on auto-generated names, fail because MySQL generates -other names. - -Also some test fail with the message "Expected: NULL / Was: NULL" which is -obviously what was expected. - -Please look carefully through the tests. If something more serious than that -comes up, please report a bug. - #### Failure to restore a database dump created with an older MariaDB version #### Have a look into the `dump_updates/README.md`. In cases of version @@ -121,6 +109,11 @@ incompatibilities, the necessary steps to migrate the dump are probably described there and scripts for the migrations are provided in the same directory. +#### MySQL has failing tests + +*Note: Since we switched from MySQL to MariaDB, the two DBMS projects have diverged quite far. As a +result, we no longer support MySQL. + ## Documentation # Build documentation in `build/` with `make doc`. diff --git a/RELEASE_GUIDELINES.md b/RELEASE_GUIDELINES.md index c1d7335..72f4534 100644 --- a/RELEASE_GUIDELINES.md +++ b/RELEASE_GUIDELINES.md @@ -1,4 +1,4 @@ -# Release Guidelines for the CaosDB MySQL Backend +# Release Guidelines for the LinkAhead MariaDB Backend This document specifies release guidelines in addition to the general release guidelines of the CaosDB Project diff --git a/utils/sanity_check.sql b/utils/sanity_check.sql index c29e7c8..5e3d580 100644 --- a/utils/sanity_check.sql +++ b/utils/sanity_check.sql @@ -55,9 +55,29 @@ sanityCheckBody: BEGIN ("user_roles") ; -SELECT COUNT(WRONG) INTO @count_wrong FROM ( SELECT l.table_name AS MATCHED, r.table_name AS WRONG FROM expected_tables AS l RIGHT OUTER JOIN information_schema.tables AS r ON (r.table_name COLLATE utf8_unicode_ci = l.table_name) WHERE r.table_schema = database()) AS temp WHERE temp.MATCHED IS NULL; +SELECT COUNT(WRONG) INTO @count_wrong FROM ( + SELECT l.table_name AS MATCHED, + r.table_name AS WRONG + FROM + expected_tables AS l + RIGHT OUTER JOIN + information_schema.tables AS r + ON (r.table_name COLLATE utf8_unicode_ci = l.table_name) + WHERE r.table_schema = database() AND r.table_type != 'TEMPORARY' + ) + AS temp WHERE temp.MATCHED IS NULL; -SELECT COUNT(MISSING) INTO @count_missing FROM ( SELECT l.table_name AS MISSING, r.table_name AS MATCHED FROM expected_tables AS l LEFT OUTER JOIN information_schema.tables AS r ON (r.table_name COLLATE utf8_unicode_ci = l.table_name) WHERE r.table_schema = database() OR r.table_schema IS NULL) AS temp WHERE temp.MATCHED IS NULL; +SELECT COUNT(MISSING) INTO @count_missing FROM ( + SELECT l.table_name AS MISSING, + r.table_name AS MATCHED + FROM + expected_tables AS l + LEFT OUTER JOIN + information_schema.tables AS r + ON (r.table_name COLLATE utf8_unicode_ci = l.table_name) + WHERE r.table_schema = database() OR r.table_schema IS NULL + ) + AS temp WHERE temp.MATCHED IS NULL; IF @count_missing = 0 AND @count_wrong = 0 THEN LEAVE sanityCheckBody; @@ -66,12 +86,28 @@ END IF; SELECT "--------------"; SELECT @count_missing AS "Number of missing tables"; -SELECT MISSING AS "Missing tables" FROM ( SELECT l.table_name AS MISSING, r.table_name AS MATCHED FROM expected_tables AS l LEFT OUTER JOIN information_schema.tables AS r ON (r.table_name COLLATE utf8_unicode_ci = l.table_name) WHERE r.table_schema = database() OR r.table_schema IS NULL) AS temp WHERE temp.MATCHED IS NULL; +SELECT MISSING AS "Missing tables" FROM ( + SELECT l.table_name AS MISSING, r.table_name AS MATCHED FROM + expected_tables AS l + LEFT OUTER JOIN + information_schema.tables AS r + ON (r.table_name COLLATE utf8_unicode_ci = l.table_name) + WHERE r.table_schema = database() OR r.table_schema IS NULL + ) + AS temp WHERE temp.MATCHED IS NULL; SELECT "--------------"; SELECT @count_wrong AS "Number of tables which should not exist"; -SELECT WRONG AS "Tables which should not exist" FROM ( SELECT l.table_name AS MATCHED, r.table_name AS WRONG FROM expected_tables AS l RIGHT OUTER JOIN information_schema.tables AS r ON (r.table_name COLLATE utf8_unicode_ci = l.table_name) WHERE r.table_schema = database()) AS temp WHERE temp.MATCHED IS NULL; +SELECT WRONG AS "Tables which should not exist" FROM ( + SELECT expec.table_name AS MATCHED, info.table_name AS WRONG FROM + expected_tables AS expec + RIGHT OUTER JOIN + information_schema.tables AS info + ON (info.table_name COLLATE utf8_unicode_ci = expec.table_name) + WHERE info.table_schema = database() and info.table_type != 'TEMPORARY' + ) + AS temp WHERE temp.MATCHED IS NULL; SELECT "--------------"; SELECT "ERROR" from sanity_check_failed; -- GitLab