⚝
One Hat Cyber Team
⚝
Your IP:
216.73.216.124
Server IP:
50.28.103.30
Server:
Linux host.jcukjv-lwsites.com 4.18.0-553.22.1.el8_10.x86_64 #1 SMP Tue Sep 24 05:16:59 EDT 2024 x86_64
Server Software:
nginx/1.28.0
PHP Version:
8.3.12
Buat File
|
Buat Folder
Eksekusi
Dir :
~
/
www
/
server
/
mysql
/
mysql-test
/
t
/
View File Name :
query_cache_type_functionality.test
############################################################################### # # # Variable Name: query_cache_type # # Scope: Global/Session # # Access Type: Dynamic # # Data Type: numeric # # # # # # Creation Date: 2012-09-6 # # Author : Tanjot Singh Uppal # # # # # # Description:Test Cases of Dynamic System Variable query_cache_type # # that checks the behavior of this variable in the following ways # # * Value Check # # * Scope Check # # * Functionality Check # # * Accessability Check # # # # This test does not perform the crash recovery on this variable # # For crash recovery test on default change please run the ibtest # ############################################################################### -- source include/have_innodb.inc -- source include/not_embedded.inc -- source include/have_innodb_16k.inc echo '#________________________VAR_03_query_cache_type__________________#' echo '##' --echo '#---------------------WL6372_VAR_3_01----------------------#' #################################################################### # Checking default value # #################################################################### SELECT COUNT(@@GLOBAL.query_cache_type); --echo 1 Expected SELECT @@GLOBAL.query_cache_type; --echo OFF Expected --echo '#---------------------WL6372_VAR_3_02----------------------#' ################################################################################# # Checking the Default value post starting the server with other value # ################################################################################# --echo # Restart server with query_cache_type 1; let $restart_file= $MYSQLTEST_VARDIR/tmp/mysqld.1.expect; --exec echo "wait" > $restart_file --shutdown_server --source include/wait_until_disconnected.inc -- exec echo "restart:--query_cache_type=1 " > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect -- enable_reconnect -- source include/wait_until_connected_again.inc SELECT @@GLOBAL.query_cache_type; --echo ON Expected SET @@GLOBAL.query_cache_type=DEFAULT; SELECT @@GLOBAL.query_cache_type; --echo OFF Expected --echo '#---------------------WL6372_VAR_3_03----------------------#' #################################################################### # Checking Value can be set - Dynamic # #################################################################### SET @@local.query_cache_type=1; SELECT @@Local.query_cache_type; --echo ON Expected SET @@session.query_cache_type=1; SELECT @@Session.query_cache_type; --echo ON Expected SET @@GLOBAL.query_cache_type=1; SELECT @@GLOBAL.query_cache_type; --echo ON Expected SET @@GLOBAL.query_cache_type=DEFAULT; SELECT @@GLOBAL.query_cache_type; --echo OFF Expected SET @@Session.query_cache_type=DEFAULT; SELECT @@Session.query_cache_type; --echo OFF Expected SET @@Local.query_cache_type=DEFAULT; SELECT @@Local.query_cache_type; --echo OFF Expected --echo '#---------------------WL6372_VAR_3_04----------------------#' ################################################################# # Check if the value in GLOBAL Table matches value in variable # ################################################################# --disable_warnings SELECT @@GLOBAL.query_cache_type = VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES WHERE VARIABLE_NAME='query_cache_type'; --enable_warnings --echo 1 Expected SELECT COUNT(@@GLOBAL.query_cache_type); --echo 1 Expected --disable_warnings SELECT COUNT(VARIABLE_VALUE) FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES WHERE VARIABLE_NAME='query_cache_type'; --enable_warnings --echo 1 Expected --echo '#---------------------WL6372_VAR_3_05----------------------#' ################################################################################ # Checking Variable Scope # ################################################################################ SELECT @@query_cache_type = @@GLOBAL.query_cache_type; --echo 1 Expected SELECT @@query_cache_type = @@Session.query_cache_type; --echo 1 Expected SELECT COUNT(@@local.query_cache_type); --echo 1 Expected SELECT COUNT(@@SESSION.query_cache_type); --echo 1 Expected SELECT COUNT(@@GLOBAL.query_cache_type); --echo 1 Expected --Error ER_BAD_FIELD_ERROR SELECT query_cache_type = @@SESSION.query_cache_type; --echo Expected error 'Unknown column query_cache_type in field list' --echo '#---------------------WL6372_VAR_3_06----------------------#' ############################################################################### # Checking the /Var directory size # ############################################################################### -- source include/vardir_size_check.inc --echo TRUE Expected --echo '#---------------------WL6372_VAR_3_07----------------------#' ################################################################################# # Checking the size of query cache functionality # ################################################################################# --echo # create 1 table and insert 3 rows each --disable_warnings DROP TABLE IF EXISTS tab1; --enable_warnings let $i = 3; let $table = tab1; --source include/create_table.inc --source include/Load_data.inc set @@GLOBAL.query_cache_type=DEFAULT; let $Qcache_hits = `select variable_value from information_schema.global_status where variable_name ='Qcache_hits';`; let $Qcache_inserts = `select variable_value from information_schema.global_status where variable_name ='Qcache_inserts';`; let $Qcache_queries_in_cache = `select variable_value from information_schema.global_status where variable_name ='Qcache_queries_in_cache';`; let $Qcache_not_cached = `select variable_value from information_schema.global_status where variable_name ='Qcache_not_cached';`; select 1 from tab1 limit 1; --echo 1 Expected --disable_warnings select variable_value from information_schema.global_status where variable_name ='Qcache_hits'; --echo 0 Expected select variable_value from information_schema.global_status where variable_name ='Qcache_inserts'; --echo 0 Expected select variable_value from information_schema.global_status where variable_name ='Qcache_queries_in_cache'; --echo 0 Expected select variable_value from information_schema.global_status where variable_name ='Qcache_not_cached'; --enable_warnings --echo 25 Expected select 1 from tab1 limit 1; --echo 1 Expected --disable_warnings select variable_value from information_schema.global_status where variable_name ='Qcache_hits'; --echo 0 Expected select variable_value from information_schema.global_status where variable_name ='Qcache_inserts'; --echo 0 Expected select variable_value from information_schema.global_status where variable_name ='Qcache_queries_in_cache'; --echo 0 Expected select variable_value from information_schema.global_status where variable_name ='Qcache_not_cached'; --enable_warnings --echo 30 Expected select 1 from tab1 limit 2; --echo 1 Expected --disable_warnings select variable_value from information_schema.global_status where variable_name ='Qcache_hits'; --echo 0 Expected select variable_value from information_schema.global_status where variable_name ='Qcache_inserts'; --echo 0 Expected select variable_value from information_schema.global_status where variable_name ='Qcache_queries_in_cache'; --echo 0 Expected select variable_value from information_schema.global_status where variable_name ='Qcache_not_cached'; --enable_warnings --echo 35 Expected --echo # Restart server with query_cache_type ON let $restart_file= $MYSQLTEST_VARDIR/tmp/mysqld.1.expect; --exec echo "wait" > $restart_file --shutdown_server --source include/wait_until_disconnected.inc -- exec echo "restart:--query_cache_type=1 " > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect -- enable_reconnect -- source include/wait_until_connected_again.inc --disable_warnings let $Qcache_hits = `select variable_value from information_schema.global_status where variable_name ='Qcache_hits';`; let $Qcache_inserts = `select variable_value from information_schema.global_status where variable_name ='Qcache_inserts';`; let $Qcache_queries_in_cache = `select variable_value from information_schema.global_status where variable_name ='Qcache_queries_in_cache';`; let $Qcache_not_cached = `select variable_value from information_schema.global_status where variable_name ='Qcache_not_cached';`; --enable_warnings select 1 from tab1 limit 1; --echo 1 Expected --disable_warnings select variable_value from information_schema.global_status where variable_name ='Qcache_hits'; --echo 0 Expected select variable_value from information_schema.global_status where variable_name ='Qcache_inserts'; --echo 1 Expected select variable_value from information_schema.global_status where variable_name ='Qcache_queries_in_cache'; --echo 1 Expected select variable_value from information_schema.global_status where variable_name ='Qcache_not_cached'; --echo 8 Expected select 1 from tab1 limit 2; --echo 1 Expected select variable_value from information_schema.global_status where variable_name ='Qcache_hits'; --echo 0 Expected select variable_value from information_schema.global_status where variable_name ='Qcache_inserts'; --echo 2 Expected select variable_value from information_schema.global_status where variable_name ='Qcache_queries_in_cache'; --echo 2 Expected select variable_value from information_schema.global_status where variable_name ='Qcache_not_cached'; --echo 12 Expected select 1 from tab1 limit 1; --echo 1 Expected select variable_value from information_schema.global_status where variable_name ='Qcache_hits'; --echo 1 Expected select variable_value from information_schema.global_status where variable_name ='Qcache_inserts'; --echo 2 Expected select variable_value from information_schema.global_status where variable_name ='Qcache_queries_in_cache'; --echo 2 Expected select variable_value from information_schema.global_status where variable_name ='Qcache_not_cached'; --echo 16 Expected --echo # opening another client session connect (con1,localhost,root,,); select variable_value from information_schema.global_status where variable_name ='Qcache_not_cached'; --enable_warnings --echo 17 Expected disconnect con1; --echo #cleanup connection default; DROP TABLE IF EXISTS tab1;