diff --git a/check_mysqlserver b/check_mysqlserver
index a6d58b2fc27c0f2c60b29d54d13fd603785140f2..704916b2425c54496cae9c89e60218f501ad8812 100755
--- a/check_mysqlserver
+++ b/check_mysqlserver
@@ -189,15 +189,14 @@ function _mysqlrenderdelta() {
 # helper function for caching checks
 # The function aborts the check ending with OK.
 function _verify_cache(){
-    local bCacheEnabled=
     _mysqlgetvar "have_query_cache" | grep "YES" >/dev/null
     if [ $? -ne 0 ]; then
-        _mysqlgetvar "query_cache_type" | grep "OFF" >/dev/null
-        if [ $? -eq 0 ]; then
-            echo "INFO: Query cache (have_query_cache) is active but query_cache_type is OFF."
-        else
-            echo "INFO: Query cache (have_query_cache) is not active."
-        fi
+        echo "INFO: Query cache (have_query_cache) is not active."
+        ph.exit
+    fi
+    _mysqlgetvar "query_cache_type" | grep "OFF" >/dev/null
+    if [ $? -eq 0 ]; then
+        echo "INFO: Query cache (have_query_cache) is active but query_cache_type is OFF."
         ph.exit
     fi
 }