~ubuntu-branches/ubuntu/trusty/mysql-5.6/trusty

« back to all changes in this revision

Viewing changes to mysql-test/suite/sys_vars/t/expire_logs_days_basic.test

  • Committer: Package Import Robot
  • Author(s): James Page
  • Date: 2014-02-12 11:54:27 UTC
  • Revision ID: package-import@ubuntu.com-20140212115427-oq6tfsqxl1wuwehi
Tags: upstream-5.6.15
ImportĀ upstreamĀ versionĀ 5.6.15

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
############## mysql-test\t\expire_logs_days_basic.test ###############
 
2
#                                                                             #
 
3
# Variable Name: expire_logs_days                                             #
 
4
# Scope: GLOBAL                                                               #
 
5
# Access Type: Dynamic                                                        #
 
6
# Data Type: numeric                                                          #
 
7
# Default Value:0                                                             #
 
8
# Range:  0-99                                                                #
 
9
#                                                                             #
 
10
#                                                                             #
 
11
# Creation Date: 2008-02-07                                                   #
 
12
# Author:  Salman                                                             #
 
13
#                                                                             #
 
14
# Description: Test Cases of Dynamic System Variable expire_logs_days         #
 
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                                               #
 
23
#                                                                             #
 
24
###############################################################################
 
25
 
 
26
--source include/load_sysvars.inc
 
27
 
 
28
 
 
29
######################################################################## 
 
30
#                    START OF expire_logs_days TESTS                   #
 
31
######################################################################## 
 
32
 
 
33
 
 
34
######################################################################## 
 
35
# Saving initial value of expire_logs_days in a temporary variable     #
 
36
######################################################################## 
 
37
 
 
38
SET @start_value = @@global.expire_logs_days;
 
39
SELECT @start_value;
 
40
 
 
41
 
 
42
--echo '#--------------------FN_DYNVARS_029_01------------------------#'
 
43
######################################################################## 
 
44
#              Display the DEFAULT value of expire_logs_days           #
 
45
######################################################################## 
 
46
 
 
47
SET @@global.expire_logs_days = 99;
 
48
SET @@global.expire_logs_days = DEFAULT;
 
49
SELECT @@global.expire_logs_days;
 
50
 
 
51
 
 
52
--echo '#---------------------FN_DYNVARS_029_02-------------------------#'
 
53
############################################### 
 
54
#     Verify default value of variable        #
 
55
############################################### 
 
56
 
 
57
SET @@global.expire_logs_days = @start_value;
 
58
SELECT @@global.expire_logs_days = 0;
 
59
 
 
60
 
 
61
--echo '#--------------------FN_DYNVARS_029_03------------------------#'
 
62
######################################################################## 
 
63
#        Change the value of expire_logs_days to a valid value         #
 
64
######################################################################## 
 
65
 
 
66
SET @@global.expire_logs_days = 0;
 
67
SELECT @@global.expire_logs_days;
 
68
SET @@global.expire_logs_days = 99;
 
69
SELECT @@global.expire_logs_days;
 
70
SET @@global.expire_logs_days = 10;
 
71
SELECT @@global.expire_logs_days;
 
72
SET @@global.expire_logs_days = 21;
 
73
SELECT @@global.expire_logs_days;
 
74
 
 
75
 
 
76
--echo '#--------------------FN_DYNVARS_029_04-------------------------#'
 
77
########################################################################### 
 
78
#         Change the value of expire_logs_days to invalid value           #
 
79
########################################################################### 
 
80
 
 
81
SET @@global.expire_logs_days = -1;
 
82
SELECT @@global.expire_logs_days;
 
83
SET @@global.expire_logs_days = 100;
 
84
SELECT @@global.expire_logs_days;
 
85
SET @@global.expire_logs_days = 1024;
 
86
SELECT @@global.expire_logs_days;
 
87
--Error ER_WRONG_TYPE_FOR_VAR
 
88
SET @@global.expire_logs_days = 10000.01;
 
89
SELECT @@global.expire_logs_days;
 
90
SET @@global.expire_logs_days = -1024;
 
91
SELECT @@global.expire_logs_days;
 
92
SET @@global.expire_logs_days = 42949672950;
 
93
SELECT @@global.expire_logs_days;
 
94
 
 
95
--Error ER_WRONG_TYPE_FOR_VAR
 
96
SET @@global.expire_logs_days = ON;
 
97
SELECT @@global.expire_logs_days;
 
98
--Error ER_WRONG_TYPE_FOR_VAR
 
99
SET @@global.expire_logs_days = 'test';
 
100
SELECT @@global.expire_logs_days;
 
101
 
 
102
 
 
103
--echo '#-------------------FN_DYNVARS_029_05----------------------------#'
 
104
########################################################################### 
 
105
#       Test if accessing session expire_logs_days gives error            #
 
106
########################################################################### 
 
107
 
 
108
--Error ER_GLOBAL_VARIABLE
 
109
SET @@session.expire_logs_days = 0;
 
110
SELECT @@expire_logs_days;
 
111
 
 
112
 
 
113
--echo '#----------------------FN_DYNVARS_029_06------------------------#'
 
114
############################################################################## 
 
115
# Check if the value in GLOBAL & SESSION Tables matches values in variable   #
 
116
##############################################################################
 
117
 
 
118
SELECT @@global.expire_logs_days = VARIABLE_VALUE 
 
119
FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES 
 
120
WHERE VARIABLE_NAME='expire_logs_days';
 
121
 
 
122
SELECT @@expire_logs_days = VARIABLE_VALUE 
 
123
FROM INFORMATION_SCHEMA.SESSION_VARIABLES 
 
124
WHERE VARIABLE_NAME='expire_logs_days';
 
125
 
 
126
 
 
127
 
 
128
--echo '#---------------------FN_DYNVARS_029_07----------------------#'
 
129
################################################################### 
 
130
#      Check if TRUE and FALSE values can be used on variable     #
 
131
################################################################### 
 
132
 
 
133
SET @@global.expire_logs_days = TRUE;
 
134
SELECT @@global.expire_logs_days;
 
135
SET @@global.expire_logs_days = FALSE;
 
136
SELECT @@global.expire_logs_days;
 
137
 
 
138
 
 
139
--echo '#---------------------FN_DYNVARS_029_08----------------------#'
 
140
########################################################################################################
 
141
#    Check if accessing variable with SESSION,LOCAL and without SCOPE points to same session variable  #
 
142
########################################################################################################
 
143
 
 
144
SET @@global.expire_logs_days = 1;
 
145
SELECT @@expire_logs_days = @@global.expire_logs_days;
 
146
 
 
147
 
 
148
--echo '#---------------------FN_DYNVARS_029_09----------------------#'
 
149
##########################################################################  
 
150
#   Check if expire_logs_days can be accessed with and without @@ sign   #
 
151
##########################################################################
 
152
 
 
153
--Error ER_GLOBAL_VARIABLE
 
154
SET expire_logs_days = 1;
 
155
SELECT @@expire_logs_days;
 
156
--Error ER_PARSE_ERROR
 
157
SET local.expire_logs_days = 1;
 
158
--Error ER_UNKNOWN_TABLE
 
159
SELECT local.expire_logs_days;
 
160
--Error ER_PARSE_ERROR
 
161
SET global.expire_logs_days = 1;
 
162
--Error ER_UNKNOWN_TABLE
 
163
SELECT global.expire_logs_days;
 
164
--Error ER_BAD_FIELD_ERROR
 
165
SELECT expire_logs_days = @@session.expire_logs_days;
 
166
 
 
167
 
 
168
##############################  
 
169
#   Restore initial value    #
 
170
##############################
 
171
 
 
172
SET @@global.expire_logs_days = @start_value;
 
173
SELECT @@global.expire_logs_days;
 
174
 
 
175
 
 
176
######################################################################## 
 
177
#              END OF expire_logs_days TESTS                           #
 
178
########################################################################