Skip to content
Snippets Groups Projects

Fix accent sensitivity

Merged Daniel Hornung requested to merge f-fix-accent-sensitivity into dev
All threads resolved!
Files
8
+ 74
0
#!/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.
OLD_VERSION="v8.0.0"
NEW_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
# mysql_execute "UPDATE data_type SET datatype=17 WHERE datatype=3"
# cd git/caosdb-mysqlbackend/
# UTILSPATH=utils
# . utils/patch_header.sh
# show table status where Collation='utf8mb3_unicode_ci';
# name_data
# text_data
# show table status like 'name_data';
# select * from name_data where value like 'Yield%';
# update name_data SET value='Yield-stréss' where entity_id=354;
# update name_data SET value='Yield-strés😋s' where entity_id=354;
# select * from name_data where value='Yield-stress';
# # Unicode 14.0.0
# ALTER TABLE name_data CONVERT TO CHARACTER SET utf8mb4 COLLATE uca1400_as_ci;
# FULL_COLLATION_NAME: utf8mb4_uca1400_as_ci;
# COLLATION_NAME: uca1400_as_ci;
# mariadb -h sqldb -u caosdb -prandom1234 --default-character-set=utf8mb4 caosdb
update_version $NEW_VERSION
success
Loading