flush_query_cache.sh: query cache is no longer supported since version '8.0.3'.

This commit is contained in:
Christoph 2018-12-03 14:01:16 +01:00
parent 3baebe1300
commit 435fbfdf19

View File

@ -18,6 +18,27 @@ if [ -z "$mysql" ]; then
fi
fi
# Get current version
#
_MYSQLD_VERSION="$(mysqld -V 2>/dev/null)"
CURRENT_VERSION="$(echo $_MYSQLD_VERSION | grep -o -E "[0-9]+\.[0-9]+\.[0-9]+(-[0-9]+)?" | head -n 1)"
MYSQL_MAIN_VERSION=`echo $CURRENT_VERSION | cut -d '.' -f1,2`
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
echo ""
echo -e "\t[ Error ]: Query cache is no longer supported since (MySQL 8.0.3)"
echo ""
fi
exit
#---------------------------------------
#-----------------------------