403Webshell
Server IP : 88.99.149.37  /  Your IP : 216.73.216.141
Web Server : nginx/1.31.2
System : Linux server-88-99-149-37 6.12.0-124.56.5.el10_1.x86_64 #1 SMP PREEMPT_DYNAMIC Fri May 15 06:12:08 EDT 2026 x86_64
User : muralimurth ( 1015)
PHP Version : 8.4.23
Disable Function : exec,system,passthru,shell_exec,proc_close,proc_open,dl,popen,show_source,posix_kill,posix_mkfifo,posix_getpwuid,posix_setpgid,posix_setsid,posix_setuid,posix_setgid,posix_seteuid,posix_setegid,posix_uname
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : ON  |  Pkexec : ON
Directory :  /usr/local/mysql/mysql-test/suite/sys_vars/t/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /usr/local/mysql/mysql-test/suite/sys_vars/t/query_cache_limit_func.test
############# mysql-test\t\Query_cache_limit_func.test ########################
#                                                                             #
# Variable Name: Query_cache_limit                                            #
# Scope: SESSION                                                              #
# Access Type: Dynamic                                                        #
# Data Type: NUMERIC                                                          #
# Default Value: 1048576                                                      #
# Min Value:       0                                                          #
#                                                                             #
#                                                                             #
# Creation Date: 2008-03-02                                                   #
# Author:  Sharique Abdullah                                                  #
#                                                                             #
# Description: Test Cases of Dynamic System Variable "Query_cache_limit"      #
#              that checks behavior of this variable in the following ways    #
#              * Functionality based on different values                      #
#                                                                             #
# Reference:                                                                  #
#   http://dev.mysql.com/doc/refman/5.1/en/server-system-variables.html       #
#                                                                             #
###############################################################################


--echo ** Setup **
--echo
#
# Setup
#

SET @global_query_cache_limit = @@global.query_cache_limit;
SET @global_query_cache_size = @@global.query_cache_size;
SET @global_query_cache_type = @@global.query_cache_type;

SET GLOBAL query_cache_type= ON;
SET LOCAL query_cache_type= ON;

--echo ** warnings **
--disable_warnings
DROP TABLE IF EXISTS t;

--enable_warnings
#creating table#

--echo ** creating table **

CREATE TABLE t
(
id INT AUTO_INCREMENT PRIMARY KEY,
c TEXT(30)
);

#inserting value#

--echo **inserting value **

INSERT INTO t set c = repeat('x',29);
INSERT INTO t set c = concat(repeat('x',28),'r','x');
INSERT INTO t set c = concat(repeat('x',28),'s','y');
INSERT INTO t set c = concat(repeat('x',28),'g','w');

# Reset cache & flush status
--echo ** Reset cache values **
FLUSH STATUS;
RESET QUERY CACHE;

# set query cache type value to on and allocating cache size
--echo ** On query_cache_type **
SET GLOBAL query_cache_type = ON;

--echo ** Allocating cache size **
SET GLOBAL query_cache_size = 131072;

# reset values
--echo ** Reset values
SET GLOBAL query_cache_size = 0;
SET GLOBAL query_cache_size = 131072;
SET GLOBAL query_cache_type = ON;

--disable_cursor_protocol

--echo '#---------------------FN_DYNVARS_132_01----------------------#'
#
#Check if results are cacheing on default value #
#

# Reset cache & flush status
--echo ** Reset cache values **
FLUSH STATUS;
RESET QUERY CACHE;


#fetching results#
--echo ** fetching results **
SELECT * FROM t;

# Check status
--echo ** check status on not setting query_cache_limit value **

SHOW STATUS LIKE 'Qcache_not_cached';
SHOW STATUS LIKE 'Qcache_queries_in_cache';


--echo '#---------------------FN_DYNVARS_132_02----------------------#'
#
#Check if results are cacheing on setting value to 0 i.e. no caching#
#

# Reset cache & flush status
--echo ** Reset cache values **
FLUSH STATUS;
RESET QUERY CACHE;

#set cache limit
--echo ** set cache limit **
SET @@GLOBAL.query_cache_limit = 0;

#fetching results#
--echo ** fetching results **
--disable_ps2_protocol
SELECT * FROM t;
--enable_ps2_protocol

# Check status after setting value#
--echo ** Check status after setting value **
SHOW STATUS LIKE 'Qcache_not_cached';
--echo 1 Expected
SHOW STATUS LIKE 'Qcache_queries_in_cache';
--echo 0 Expected


--echo '#---------------------FN_DYNVARS_132_03----------------------#'
#
# Check if setting to 0 makes any difference to the cache or not #
#

#set cache limit to default
--echo ** set cache limit **
SET @@GLOBAL.query_cache_limit = DEFAULT;

# Reset cache & flush status
--echo ** Reset cache values **
FLUSH STATUS;
RESET QUERY CACHE;

#fetching results#
--echo ** fetching results **
SELECT * FROM t;

SHOW STATUS LIKE 'Qcache_not_cached';
--echo 0 Expected
SHOW STATUS LIKE 'Qcache_queries_in_cache';
--echo 1 Expected

SET @@GLOBAL.query_cache_limit = 0;

SHOW STATUS LIKE 'Qcache_not_cached';
--echo 0 Expected
SHOW STATUS LIKE 'Qcache_queries_in_cache';
--echo 1 Expected

#fetching results#
--echo ** fetching results **
SELECT * FROM t;

# Check status after setting value#
--echo ** Check status after setting value **

SHOW STATUS LIKE 'Qcache_not_cached';
--echo 0 Expected
SHOW STATUS LIKE 'Qcache_queries_in_cache';
--echo 1 Expected

--enable_cursor_protocol

#
# Cleanup
#

SET @@GLOBAL.query_cache_limit = @global_query_cache_limit;
SET GLOBAL query_cache_size = @global_query_cache_size;
SET GLOBAL query_cache_type = @global_query_cache_type;

--disable_warnings
DROP TABLE IF EXISTS t;
--enable_warnings


Youez - 2016 - github.com/yon3zu
LinuXploit