~jlukas79/+junk/mysql-server

« back to all changes in this revision

Viewing changes to mysql-test/t/query_prealloc_size_func.test

manual merge 6.0-main --> 6.0-bka-review

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
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: http://dev.mysql.com/doc/refman/5.1/en/                          # 
 
22
#            server-system-variables.html#option_mysqld_query_prealloc_size   # 
 
23
#                                                                             # 
 
24
###############################################################################
 
25
 
 
26
 
 
27
 
 
28
--echo ** Setup **
 
29
--echo 
 
30
#
 
31
# Setup
 
32
#
 
33
 
 
34
#
 
35
# Save initial value
 
36
#
 
37
 
 
38
CREATE TABLE t1 (id int auto_increment primary key, val text(200));
 
39
 
 
40
INSERT INTO t1 values(NULL,'a');
 
41
INSERT INTO t1 values(NULL,'b');
 
42
INSERT INTO t1 values(NULL,'c');
 
43
INSERT INTO t1 values(NULL,'d');
 
44
 
 
45
SELECT * FROM t1 ORDER BY val;
 
46
 
 
47
SET SESSION query_prealloc_size  = 8192;
 
48
 
 
49
 
 
50
--echo '#----------------------------FN_DYNVARS_137_05-----------------#'
 
51
#
 
52
# Session data integrity check & GLOBAL Value check
 
53
#
 
54
 
 
55
SET GLOBAL query_prealloc_size = 8192;
 
56
 
 
57
connect (con_int1,localhost,root,,);
 
58
connection con_int1;
 
59
 
 
60
SELECT @@SESSION.query_prealloc_size;
 
61
--echo Expected Value : 8192;
 
62
SET SESSION query_prealloc_size = 16384;
 
63
 
 
64
connect (con_int2,localhost,root,,);
 
65
connection con_int2;
 
66
 
 
67
SELECT @@SESSION.query_prealloc_size;
 
68
--echo Expected Value : 8192;
 
69
 
 
70
SET SESSION query_prealloc_size = 8192;
 
71
 
 
72
connection con_int1;
 
73
SELECT @@SESSION.query_prealloc_size;
 
74
--echo Expected Value : 16384;
 
75
 
 
76
connection con_int2;
 
77
SELECT @@SESSION.query_prealloc_size;
 
78
--echo Expected Value : 8192;
 
79
 
 
80
SELECT @@GLOBAL.query_prealloc_size;
 
81
--echo Expected Value : 8192;
 
82
 
 
83
connection default;
 
84
disconnect con_int1;
 
85
disconnect con_int2;
 
86