2
0

In mysql_restoredb the decimal conversion has been forced in MySQL/MariaDB version comparison.

This commit is contained in:
2025-09-01 13:03:22 +02:00
parent 6f87a9e91a
commit 8f211002ff
2 changed files with 5 additions and 3 deletions

BIN
.metadata

Binary file not shown.

View File

@@ -24,6 +24,8 @@
# Author: Kovács Zoltán <kovacsz@marcusconsulting.hu>
# Kovács Zoltán <kovacs.zoltan@smartfront.hu>
# License: GNU/GPL v3+ (https://www.gnu.org/licenses/gpl-3.0.en.html)
# 2025-09-01 v1.2
# fix: Decimal conversion has been forced in MySQL/MariaDB version comparison.
# 2025-03-04 v1.1
# new: Works with dockerized databases but hasn't yet been tested with natives.
# mod: Database user creation and grants rewritten. Now create user @'%'
@@ -65,8 +67,8 @@ PATH="$PATH:/usr/local/sbin:/usr/sbin:/sbin"; fi
# Other initialisations.
#
LOGSTAMP="\"\$DATE\" +%Y-%m-%d\ %H:%M:%S" # Timestamp format for logs
MARIADBMIN="010001003" # MariaDB minimum version
MYSQLMIN="005007006" # MySQL minimum version
MARIADBMIN="10#010001003" # MariaDB minimum version
MYSQLMIN="10#005007006" # MySQL minimum version
vetodatabases="information_schema mysql performance_schema sys"
# Messages.
@@ -416,7 +418,7 @@ if $ISDBA; then
# Let's extract a comparable RDBMS version from the result.
dbversion=${result%%-*} # strips anyone after 1st dash (including)
dbversion=(${dbversion//./ }) # converts to an array
dbversion=$("$PRINTF" '%03d%03d%03d' ${dbversion[@]}) # 3 times 3 digits 0-padded
dbversion=$("$PRINTF" '10#%03d%03d%03d' ${dbversion[@]}) # 3 times 3 digits 0-padded decimal
if [ -n "$(echo "$result" | "$GREP" -i "mariadb")" ]; then
# MariaDB version check.
(( dbversion < MARIADBMIN )) \