diff --git a/CHANGELOG.md b/CHANGELOG.md index b93f14a03b3cf5b75d7ef5d40bb8d8877a5b33ef..366a97cc27cbd2e0da0dfb83f431764bc75c5da2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -22,6 +22,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### 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. +- [linahead-server#264 Queries ignore accents and umlauts](https://gitlab.com/linkahead/linkahead-server/-/issues/264): Changed to more appropriate + collation and character sets. ### Security diff --git a/README_SETUP.md b/README_SETUP.md index a92db35b9cdfb10466516e916b7900a0d7fdbc24..ec01218e391ceec0573aecb30f22d0328dca90cb 100644 --- a/README_SETUP.md +++ b/README_SETUP.md @@ -1,4 +1,4 @@ -# Setup of the LinkAhead MariaDB back end +# Setup of the LinkAhead MariaDB backend ## Dependencies diff --git a/RELEASE_GUIDELINES.md b/RELEASE_GUIDELINES.md index 72f45342fd493ed78c4ac32e17b934f391c07fcc..41c47136c1ab7160578950a384ce9c6ab2182b5b 100644 --- a/RELEASE_GUIDELINES.md +++ b/RELEASE_GUIDELINES.md @@ -1,4 +1,4 @@ -# Release Guidelines for the LinkAhead MariaDB 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/patches/patch20250130-8.0.1/patch.sh b/patches/patch20250130-8.0.1/patch.sh new file mode 100755 index 0000000000000000000000000000000000000000..d274e7240d4514d28cb4e296bfb4d142209f2c75 --- /dev/null +++ b/patches/patch20250130-8.0.1/patch.sh @@ -0,0 +1,47 @@ +#!/bin/bash +# +# This file is a part of the Linkahead Project. +# +# Copyright (C) 2025 IndiScale GmbH <info@indiscale.com> +# Copyright (C) 2025 Daniel Hornung <d.hornung@indiscale.com> +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see <https://www.gnu.org/licenses/>. +# + +# Update mysql schema to version v8.1.0 +# +# Set the collation so that accents on characters become relevant. + +NEW_VERSION="v8.0.0" +OLD_VERSION="v8.0.1" + +if [ -z "$UTILSPATH" ]; then + UTILSPATH="../utils" +fi + +. $UTILSPATH/patch_header.sh $* + +check_version $OLD_VERSION + +# Update charsets and collations. + +# Get all tables, drop first line, take first column +tables=$(mysql_execute "SHOW TABLE status where Collation='utf8mb3_unicode_ci';" -B | tail +2 | awk '{print $1}') +for table in tables; do + mysql_execute "ALTER TABLE $table CONVERT TO CHARACTER SET utf8mb4 COLLATE uca1400_as_ci;" +done + +update_version $NEW_VERSION + +success diff --git a/utils/helpers.sh b/utils/helpers.sh index f335dfa179e26e0237149572168884b554ee5f91..ff4b189bffeabf467e0725de9a4b62fe72cd6bf3 100644 --- a/utils/helpers.sh +++ b/utils/helpers.sh @@ -34,7 +34,7 @@ function mysql_execute { #TODO is it meaningful that here always the database user is used??? set -e - $MYSQL_CMD $(get_db_args) -e "$1" + $MYSQL_CMD $(get_db_args) -e "$@" ret=${PIPESTATUS[0]} if [ "$ret" -ne 0 ]; then failure "MYSQL ERROR"