Server IP : 172.67.216.182 / Your IP : 172.70.142.235 Web Server : Apache System : Linux krdc-ubuntu-s-2vcpu-4gb-amd-blr1-01.localdomain 5.15.0-142-generic #152-Ubuntu SMP Mon May 19 10:54:31 UTC 2025 x86_64 User : www ( 1000) PHP Version : 7.4.33 Disable Function : passthru,exec,system,putenv,chroot,chgrp,chown,shell_exec,popen,proc_open,pcntl_exec,ini_alter,ini_restore,dl,openlog,syslog,readlink,symlink,popepassthru,pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,imap_open,apache_setenv MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : ON Directory : /www/server/mysql/src/mysql-test/suite/sys_vars/t/ |
Upload File : |
##################### mysql-test\t\delay_key_write_func.test ################# # # # Variable Name: delay_key_write # # Scope: GLOBAL # # Access Type: Dynamic # # Data Type: enumeration # # Default Value: ON # # Valid Values: ON, OFF & ALL # # # # # # Creation Date: 2008-03-08 # # Author: Rizwan # # # # Description: Test Cases of Dynamic System Variable delay_key_write # # that checks the behavior of this variable # # # # Reference: # # http://dev.mysql.com/doc/refman/5.1/en/server-system-variables.html # # # ############################################################################### --source include/force_myisam_default.inc --echo '#--------------------FN_DYNVARS_023_01-------------------------#' ####################################################################### # Check if setting delay_key_write is changed in every new connection # ####################################################################### SET @start_value= @@global.delay_key_write; SET @@global.delay_key_write = ON; SELECT @@global.delay_key_write; --echo 'connect (user1,localhost,root,,,,)' connect (user1,localhost,root,,,,); --echo 'connection user1' connection user1; SELECT @@global.delay_key_write AS res_is_ON; SET @@global.delay_key_write = ALL; disconnect user1; --echo 'connect (user1,localhost,root,,,,)' connect (user1,localhost,root,,,,); --echo 'connection user1' connection user1; SELECT @@global.delay_key_write AS res_is_ALL; --echo '#--------------------FN_DYNVARS_023_02-------------------------#' ###################################################### # Begin the functionality Testing of delay_key_write # ###################################################### # create procedure to add rows --disable_query_log DELIMITER //; CREATE PROCEDURE sp_addRecords (IN var1 INT,IN var2 INT) BEGIN WHILE (var1 < var2) DO INSERT INTO t1 VALUES(var1,REPEAT('MYSQL',10),100000.0/var1); SET var1=var1+1; END WHILE; END// DELIMITER ;// --enable_query_log #============================================================================== --echo '---check when delay_key_write is OFF---' #============================================================================== SET @@global.delay_key_write = OFF; --disable_query_log --disable_warnings DROP TABLE IF EXISTS t1; --enable_warnings # create a table with delay_key_write enabled CREATE TABLE t1( a INT PRIMARY KEY, b VARCHAR(512), c DOUBLE ) DELAY_KEY_WRITE = 1; --enable_query_log FLUSH STATUS; CALL sp_addRecords(1,10); SHOW STATUS LIKE 'Key_reads'; SHOW STATUS LIKE 'Key_writes'; SHOW STATUS LIKE 'Key_write_requests'; SELECT COUNT(*) FROM t1; #============================================================================== --echo '----check when delay_key_write is ON---' #============================================================================== SET @@global.delay_key_write = ON; --disable_query_log --disable_warnings DROP TABLE IF EXISTS t1; --enable_warnings # create a table with delay_key_write enabled CREATE TABLE t1( a INT PRIMARY KEY, b VARCHAR(512), c DOUBLE ) DELAY_KEY_WRITE = 1; --enable_query_log FLUSH STATUS; CALL sp_addRecords(1,10); SHOW STATUS LIKE 'Key_reads'; SHOW STATUS LIKE 'Key_writes'; SHOW STATUS LIKE 'Key_write_requests'; SELECT COUNT(*) FROM t1; #============================================================================== --echo '----check when delay_key_write is ALL---' #============================================================================== SET @@global.delay_key_write = ALL; --disable_query_log --disable_warnings DROP TABLE IF EXISTS t1; --enable_warnings # create a table with delay_key_write disabled CREATE TABLE t1( a INT PRIMARY KEY, b VARCHAR(512), c DOUBLE ) DELAY_KEY_WRITE = 0; --enable_query_log FLUSH STATUS; CALL sp_addRecords(1,10); SHOW STATUS LIKE 'Key_reads'; SHOW STATUS LIKE 'Key_writes'; SHOW STATUS LIKE 'Key_write_requests'; SELECT COUNT(*) FROM t1; DROP PROCEDURE sp_addRecords; DROP TABLE t1; disconnect user1; connection default; SET @@global.delay_key_write= @start_value; #################################################### # End of functionality testing for delay_key_write # ####################################################