flush_query_cache.sh: fix error if mysql distribution is not MySQL (i.e. Percona/MariaDB).
This commit is contained in:
parent
435fbfdf19
commit
a494755a15
@ -28,16 +28,30 @@ MYSQL_MAJOR_VERSION=`echo $CURRENT_VERSION | cut -d '.' -f1`
|
||||
MYSQL_MINOR_VERSION=`echo $CURRENT_VERSION | cut -d '.' -f2`
|
||||
MYSQL_PATCH_LEVEL=`echo $CURRENT_VERSION | cut -d '.' -f3`
|
||||
|
||||
if [[ "$MYSQL_MAJOR_VERSION" -gt 8 ]] \
|
||||
|| ( [[ "$MYSQL_MAJOR_VERSION" -eq 8 ]] && [[ "$MYSQL_MINOR_VERSION" -gt 0 ]] ) \
|
||||
|| ( [[ "$MYSQL_MAJOR_VERSION" -eq 8 ]] && [[ "$MYSQL_MINOR_VERSION" -eq 0 ]] \
|
||||
&& [[ $MYSQL_PATCH_LEVEL -ge 3 ]] ); then
|
||||
if [[ -z "$_MYSQLD_VERSION" ]]; then
|
||||
echo ""
|
||||
echo -e "\t[ Error ]: Query cache is no longer supported since (MySQL 8.0.3)"
|
||||
echo -e "\t[ Error ]: No installed MySQL server or distribution found!"
|
||||
echo ""
|
||||
elif [[ "$_MYSQLD_VERSION" =~ MariaDB ]]; then
|
||||
MYSQL_CUR_DISTRIBUTION="MariaDB"
|
||||
elif [[ "$(basename "$(realpath "/usr/local/mysql")")" =~ percona- ]]; then
|
||||
MYSQL_CUR_DISTRIBUTION="Percona"
|
||||
elif [[ "$(basename "$(realpath "/usr/local/mysql")")" =~ mysql- ]]; then
|
||||
MYSQL_CUR_DISTRIBUTION="MySQL"
|
||||
fi
|
||||
|
||||
if [[ "$MYSQL_CUR_DISTRIBUTION" = "MySQL" ]]; then
|
||||
if [[ "$MYSQL_MAJOR_VERSION" -gt 8 ]] \
|
||||
|| ( [[ "$MYSQL_MAJOR_VERSION" -eq 8 ]] && [[ "$MYSQL_MINOR_VERSION" -gt 0 ]] ) \
|
||||
|| ( [[ "$MYSQL_MAJOR_VERSION" -eq 8 ]] && [[ "$MYSQL_MINOR_VERSION" -eq 0 ]] \
|
||||
&& [[ $MYSQL_PATCH_LEVEL -ge 3 ]] ); then
|
||||
echo ""
|
||||
echo -e "\t[ Error ]: Query cache is no longer supported since (MySQL 8.0.3)"
|
||||
echo ""
|
||||
exit
|
||||
fi
|
||||
fi
|
||||
|
||||
exit
|
||||
|
||||
|
||||
#---------------------------------------
|
||||
|
Loading…
Reference in New Issue
Block a user