Skip to content
Snippets Groups Projects
Verified Commit 167be92e authored by Daniel Hornung's avatar Daniel Hornung
Browse files

WIP: Making database ready for MariaDB 11.2.

parent 4ea8cd91
Branches
No related tags found
1 merge request!33Fix accent sensitivity
Pipeline #60425 passed
...@@ -11,10 +11,14 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ...@@ -11,10 +11,14 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Changed ### Changed
- New version requirement: MariaDB 11.2 or later.
### Deprecated ### Deprecated
### Removed ### Removed
- MySQL support. See the deprecation in the 7.0.0 release.
### Fixed ### 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. - [SQL dump migration can now be applied twice](https://gitlab.indiscale.com/caosdb/src/caosdb-mysqlbackend/-/issues/60): Fixed an error in the regex.
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
## Welcome ## 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. LinkAhead project.
## Setup ## Setup
...@@ -43,7 +43,7 @@ Conduct](https://gitlab.com/linkahead/linkahead/-/blob/main/CODE_OF_CONDUCT.md). ...@@ -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 * Copyright (C) 2018 Research Group Biomedical Physics, Max Planck Institute
for Dynamics and Self-Organization Göttingen. 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 All files in this repository are licensed under a [GNU Affero General Public
License](LICENCE.md) (version 3 or later). License](LICENCE.md) (version 3 or later).
# Setup of the CaosDB SQL back end # Setup of the LinkAhead MariaDB back end
## Dependencies ## Dependencies
* `MariaDB Client 10.1` or later, `MySQL Client >=5.5, <=5.7.36`. * `MariaDB Client 11.2` or later.
* make * make
## Create the configuration ## Create the configuration
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
parameter that you want to change, add a corresponding line in your `.config` 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 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. 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_PASSWORD` must be provided, that is the password of the
`MYSQL_USER`. `MYSQL_USER`.
* If you are using MariaDB and the `root` database user uses pam * If you are using MariaDB and the `root` database user uses pam
...@@ -102,18 +102,6 @@ caosdb`. ...@@ -102,18 +102,6 @@ caosdb`.
### Troubleshooting ### 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 #### #### 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 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 ...@@ -121,6 +109,11 @@ incompatibilities, the necessary steps to migrate the dump are
probably described there and scripts for the migrations are provided probably described there and scripts for the migrations are provided
in the same directory. 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 # ## Documentation #
Build documentation in `build/` with `make doc`. Build documentation in `build/` with `make doc`.
......
# 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 This document specifies release guidelines in addition to the general release
guidelines of the CaosDB Project guidelines of the CaosDB Project
......
...@@ -55,9 +55,29 @@ sanityCheckBody: BEGIN ...@@ -55,9 +55,29 @@ sanityCheckBody: BEGIN
("user_roles") ("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 IF @count_missing = 0 AND @count_wrong = 0 THEN
LEAVE sanityCheckBody; LEAVE sanityCheckBody;
...@@ -66,12 +86,28 @@ END IF; ...@@ -66,12 +86,28 @@ END IF;
SELECT "--------------"; SELECT "--------------";
SELECT @count_missing AS "Number of missing tables"; 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 "--------------";
SELECT @count_wrong AS "Number of tables which should not exist"; 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 "--------------";
SELECT "ERROR" from sanity_check_failed; SELECT "ERROR" from sanity_check_failed;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment