Debian Codegraph @

mysql-test/suite/sys_vars/t/query_prealloc_size_func.test

raw
1 ############# mysql-test\t\query_prealloc_size_func.test ######################
2 # #
3 # Variable Name: query_prealloc_size #
4 # Scope: GLOBAL & SESSION #
5 # Access Type: Dynamic #
6 # Data Type: integer #
7 # Default Value: 8192 #
8 # Values: 8192-4294967295 #
9 # #
10 # #
11 # Creation Date: 2008-02-22 #
12 # Author: Sharique Abdullah #
13 # #
14 # Description: Test Cases of Dynamic System Variable "query_prealloc_size" #
15 # that checks behavior of this variable in the following ways #
16 # * Default Value #
17 # * Valid & Invalid values #
18 # * Scope & Access method #
19 # * Cache behaviors #
20 # #
21 # Reference: #
22 # http://dev.mysql.com/doc/refman/5.1/en/server-system-variables.html #
23 # #
24 ###############################################################################
25
26
27
28 --echo ** Setup **
29 --echo
30 #
31 # Setup
32 #
33
34 #
35 # Save initial value
36 #
37
38 SET @start_value = @@global.query_prealloc_size;
39
40 CREATE TABLE t1 (id INT AUTO_INCREMENT PRIMARY KEY, val TEXT(200));
41
42 INSERT INTO t1 VALUES(NULL,'a');
43 INSERT INTO t1 VALUES(NULL,'b');
44 INSERT INTO t1 VALUES(NULL,'c');
45 INSERT INTO t1 VALUES(NULL,'d');
46
47 SELECT * FROM t1 ORDER BY val;
48
49 SET SESSION query_prealloc_size = 8192;
50
51
52 --echo '#----------------------------FN_DYNVARS_137_05-----------------#'
53 #
54 # Session data integrity check & GLOBAL Value check
55 #
56
57 SET GLOBAL query_prealloc_size = 8192;
58
59 connect (con_int1,localhost,root,,);
60 connection con_int1;
61
62 SELECT @@SESSION.query_prealloc_size;
63 --echo Expected Value : 8192;
64 SET SESSION query_prealloc_size = 16384;
65
66 connect (con_int2,localhost,root,,);
67 connection con_int2;
68
69 SELECT @@SESSION.query_prealloc_size;
70 --echo Expected Value : 8192;
71
72 SET SESSION query_prealloc_size = 8192;
73
74 connection con_int1;
75 SELECT @@SESSION.query_prealloc_size;
76 --echo Expected Value : 16384;
77
78 connection con_int2;
79 SELECT @@SESSION.query_prealloc_size;
80 --echo Expected Value : 8192;
81
82 SELECT @@GLOBAL.query_prealloc_size;
83 --echo Expected Value : 8192;
84
85 connection default;
86 disconnect con_int1;
87 disconnect con_int2;
88
89 DROP TABLE t1;
90
91 SET @@global.query_prealloc_size = @start_value;
92