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