1
################### mysql-test\t\key_buffer_size_func.test ####################
3
# Variable Name: key_buffer_size #
5
# Access Type: Dynamic #
7
# Default Value: 131072 #
11
# Creation Date: 2008-03-07 #
12
# Author: Salman Rawala #
14
# Description: Test Cases of Dynamic System Variable key_buffer_size #
15
# that checks the functionality of this variable #
17
# Reference: http://dev.mysql.com/doc/refman/5.1/en/ #
18
# server-system-variables.html #
20
###############################################################################
23
drop table if exists t1;
26
#########################
27
# Creating new table #
28
#########################
30
--echo ## Creating new table t1 ##
33
id INT NOT NULL auto_increment,
41
--echo '#--------------------FN_DYNVARS_055_01-------------------------#'
42
########################################################################
43
# Setting initial value of key_buffer_size, inserting some rows
44
# & creating 2 new connections
45
########################################################################
47
--echo ## Setting initial value of variable to 131072 ##
48
SET @@global.key_buffer_size = 131072;
51
--echo ## Creating two new connections ##
52
CONNECT (test_con1,localhost,root,,);
53
CONNECT (test_con2,localhost,root,,);
56
--echo '#--------------------FN_DYNVARS_055_02-------------------------#'
57
###############################################################################
58
# Verifying initial behavior of variable by concatinating values greater than 4
59
###############################################################################
61
--echo ## Connecting with connection test_con1 ##
63
SELECT @@global.key_buffer_size;
66
--echo ## Inserting some rows in table ##
67
INSERT into t1(rollno, name) values(1, 'Record_1');
68
INSERT into t1(rollno, name) values(2, 'Record_2');
69
INSERT into t1(rollno, name) values(1, 'Record_3');
70
INSERT into t1(rollno, name) values(3, 'Record_4');
71
INSERT into t1(rollno, name) values(1, 'Record_5');
72
INSERT into t1(rollno, name) values(3, 'Record_6');
73
INSERT into t1(rollno, name) values(4, 'Record_7');
74
INSERT into t1(rollno, name) values(4, 'Record_8');
75
INSERT into t1(rollno, name) values(4, 'Record_9');
76
INSERT into t1(rollno, name) values(4, 'Record_10');
78
--echo ## Verifying status of reading & writing variables ##
79
# Disabled due to differences in results
80
#show status like 'Key%';
82
--echo ## Switching to connection test_con2 ##
85
--echo ## Verifying status of reading & writing variables ##
86
# Disabled due to differences in results
87
#show status like 'Key%';
89
############################################################
90
# Disconnecting all connection & dropping table #
91
############################################################
93
--echo ## Dropping table ##
94
DROP table if exists t1;
96
--echo ## Disconnecting both the connections ##