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

FIX: Set character set and collation so accents are not ignored.

parent 167be92e
No related branches found
No related tags found
1 merge request!33Fix accent sensitivity
Pipeline #60429 passed
......@@ -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
......
# Setup of the LinkAhead MariaDB back end
# Setup of the LinkAhead MariaDB backend
## Dependencies
......
# 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
......
#!/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
......@@ -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"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment