~jlukas79/+junk/mysql-server

« back to all changes in this revision

Viewing changes to mysql-test/t/table_open_cache_basic.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\table_open_cache_basic.test #######################
 
2
#                                                                             #
 
3
# Variable Name: table_open_cache                                             #
 
4
# Scope: GLOBAL                                                               #
 
5
# Access Type: Dynamic                                                        #
 
6
# Data Type: numeric                                                          #
 
7
# Default Value: 64                                                           #
 
8
# Range: 1-524288                                                             #
 
9
#                                                                             #
 
10
#                                                                             #
 
11
# Creation Date: 2008-02-13                                                   #
 
12
# Author:  Salman                                                             #
 
13
#                                                                             #
 
14
# Description: Test Cases of Dynamic System Variable table_open_cache         #
 
15
#              that checks the behavior of this variable in the following ways#
 
16
#              * Default Value                                                #
 
17
#              * Valid & Invalid values                                       #
 
18
#              * Scope & Access method                                        #
 
19
#              * Data Integrity                                               #
 
20
#                                                                             #
 
21
# Reference: http://dev.mysql.com/doc/refman/5.1/en/                          #
 
22
#  server-system-variables.html#option_mysqld_table_open_cache                #
 
23
#                                                                             #
 
24
###############################################################################
 
25
 
 
26
--source include/load_sysvars.inc
 
27
 
 
28
######################################################################## 
 
29
#                    START OF table_open_cache TESTS                   #
 
30
######################################################################## 
 
31
 
 
32
 
 
33
########################################################################## 
 
34
# Saving initial value of table_open_cache in a temporary variable       #
 
35
########################################################################## 
 
36
 
 
37
SET @start_value = @@global.table_open_cache ;
 
38
SELECT @start_value;
 
39
 
 
40
 
 
41
--echo '#--------------------FN_DYNVARS_001_01------------------------#'
 
42
######################################################################## 
 
43
#              Display the DEFAULT value of table_open_cache           #
 
44
######################################################################## 
 
45
 
 
46
SET @@global.table_open_cache  = 99;
 
47
SET @@global.table_open_cache  = DeFAULT;
 
48
SELECT @@global.table_open_cache;
 
49
 
 
50
 
 
51
--echo '#---------------------FN_DYNVARS_001_02-------------------------#'
 
52
############################################### 
 
53
#     Verify default value of variable        #
 
54
############################################### 
 
55
 
 
56
SET @@global.table_open_cache = Default;
 
57
SELECT @@global.table_open_cache  = 64;
 
58
 
 
59
--echo '#--------------------FN_DYNVARS_001_03------------------------#'
 
60
######################################################################## 
 
61
#        Change the value of table_open_cache  to a valid value        #
 
62
######################################################################## 
 
63
 
 
64
 
 
65
SET @@global.table_open_cache  = 8;
 
66
SELECT @@global.table_open_cache ;
 
67
 
 
68
SET @@global.table_open_cache  = 1;
 
69
SELECT @@global.table_open_cache ;
 
70
 
 
71
SET @@global.table_open_cache  = 1073741824;
 
72
SELECT @@global.table_open_cache ;
 
73
 
 
74
SET @@global.table_open_cache  = 18000;
 
75
SELECT @@global.table_open_cache ;
 
76
SET @@global.table_open_cache  = 65535;
 
77
SELECT @@global.table_open_cache ;
 
78
 
 
79
 
 
80
 
 
81
--echo '#--------------------FN_DYNVARS_001_04-------------------------#'
 
82
#######################################################################
 
83
#         Change the value of table_open_cache  to invalid value      #
 
84
#######################################################################
 
85
 
 
86
SET @@global.table_open_cache  = -1;
 
87
SELECT @@global.table_open_cache  ;
 
88
 
 
89
SET @@global.table_open_cache = 100000000000;
 
90
SELECT @@global.table_open_cache ;
 
91
 
 
92
SET @@global.table_open_cache = -1024;
 
93
SELECT @@global.table_open_cache ;
 
94
 
 
95
SET @@global.table_open_cache = 0;
 
96
SELECT @@global.table_open_cache ;
 
97
 
 
98
--echo 'Bug # 34837: Errors are not coming on assigning invalid values to variable';
 
99
 
 
100
 
 
101
--Error ER_WRONG_TYPE_FOR_VAR
 
102
SET @@global.table_open_cache = 10000.01;
 
103
 
 
104
--Error ER_WRONG_TYPE_FOR_VAR
 
105
SET @@global.table_open_cache = ON;
 
106
--Error ER_WRONG_TYPE_FOR_VAR
 
107
SET @@global.table_open_cache= 'test';
 
108
 
 
109
--Error ER_WRONG_TYPE_FOR_VAR
 
110
SET @@global.table_open_cache = '';
 
111
 
 
112
 
 
113
--echo '#-------------------FN_DYNVARS_001_05----------------------------#'
 
114
########################################################################### 
 
115
#       Test if accessing session table_open_cache  gives error           #
 
116
###########################################################################
 
117
 
 
118
--Error ER_GLOBAL_VARIABLE
 
119
SET @@session.table_open_cache = 0;
 
120
 
 
121
 
 
122
--echo '#----------------------FN_DYNVARS_001_06------------------------#'
 
123
####################################################################
 
124
# Check if the value in GLOBAL Tables matches values in variable   #
 
125
####################################################################
 
126
 
 
127
SELECT @@global.table_open_cache = VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES WHERE VARIABLE_NAME='table_open_cache ';
 
128
 
 
129
 
 
130
--echo '#---------------------FN_DYNVARS_001_09----------------------#'
 
131
################################################################### 
 
132
#      Check if TRUE and FALSE values can be used on variable     #
 
133
################################################################### 
 
134
 
 
135
SET @@global.table_open_cache = TRUE;
 
136
SELECT @@global.table_open_cache ;
 
137
 
 
138
SET @@global.table_open_cache = FALSE;
 
139
SELECT @@global.table_open_cache ;
 
140
 
 
141
 
 
142
--echo '#---------------------FN_DYNVARS_001_10----------------------#'
 
143
##############################################################################
 
144
#  Check if accessing variable without SCOPE points to same session variable #
 
145
##############################################################################
 
146
 
 
147
SET @@global.table_open_cache = 10;
 
148
SELECT @@table_open_cache = @@global.table_open_cache ;
 
149
 
 
150
 
 
151
--echo '#---------------------FN_DYNVARS_001_11----------------------#'
 
152
##########################################################################  
 
153
#   Check if table_open_cache can be accessed with and without @@ sign   #
 
154
##########################################################################
 
155
 
 
156
--Error ER_GLOBAL_VARIABLE
 
157
SET table_open_cache = 8;
 
158
--Error ER_PARSE_ERROR
 
159
SET global.table_open_cache = 10;
 
160
--Error ER_UNKNOWN_TABLE
 
161
SELECT global.table_open_cache ;
 
162
--Error ER_BAD_FIELD_ERROR
 
163
SELECT table_open_cache = @@session.table_open_cache ;
 
164
 
 
165
 
 
166
##############################  
 
167
#   Restore initial value    #
 
168
##############################
 
169
 
 
170
SET @@global.table_open_cache = @start_value;
 
171
SELECT @@global.table_open_cache ;
 
172
 
 
173
 
 
174
##################################################################
 
175
#              END OF table_open_cache  TESTS                    #
 
176
##################################################################
 
177