~ubuntu-branches/ubuntu/quantal/mysql-5.5/quantal-security

« back to all changes in this revision

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

  • Committer: Package Import Robot
  • Author(s): Seth Arnold
  • Date: 2013-04-18 18:15:39 UTC
  • mfrom: (1.1.12)
  • Revision ID: package-import@ubuntu.com-20130418181539-7uo1w041b4h2ulbs
Tags: 5.5.31-0ubuntu0.12.10.1
* SECURITY UPDATE: Update to 5.5.31 to fix security issues (LP: #1170516)
  - http://www.oracle.com/technetwork/topics/security/cpuapr2013-1899555.html
* debian/patches/71_disable_rpl_tests.patch: refreshed.
* debian/patches/fix-mysqldump-test.patch: removed, fixed differently
  upstream

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
####################### mysql-test\t\pseudo_slave_mode_basic.test ###################
 
2
#                                                                             #
 
3
# Variable Name: pseudo_slave_mode                                            #
 
4
# Scope: SESSION                                                              #
 
5
# Access Type: Dynamic                                                        #
 
6
# Data Type: boolean                                                          #
 
7
# Default Value:                                                              #
 
8
# Valid Values: 0,1                                                           #
 
9
#                                                                             #
 
10
#                                                                             #
 
11
# Creation Date: 2012-11-16                                                   #
 
12
#                                                                             #
 
13
# Description: Test Cases of Dynamic System Variable pseudo_slave_mode        #
 
14
#              that checks the behavior of this variable in the following ways#
 
15
#              * Default Value                                                #
 
16
#              * Valid & Invalid values                                       #
 
17
#              * Scope & Access method                                        #
 
18
#              * Data Integrity                                               #
 
19
#                                                                             #
 
20
# Reference: http://dev.mysql.com/doc/refman/5.5/en/                          #
 
21
#  server-system-variables.html                                               #
 
22
#                                                                             #
 
23
###############################################################################
 
24
 
 
25
--source include/load_sysvars.inc
 
26
 
 
27
######################################################################## 
 
28
#                    START OF pseudo_slave_mode TESTS                        #
 
29
######################################################################## 
 
30
 
 
31
 
 
32
############################################################################## 
 
33
#      Saving initial value of pseudo_slave_mode in a temporary variable           #
 
34
##############################################################################
 
35
 
 
36
SET @session_start_value = @@session.pseudo_slave_mode;
 
37
SELECT @session_start_value;
 
38
 
 
39
--echo '#--------------------FN_DYNVARS_156_01------------------------#'
 
40
######################################################################## 
 
41
#           Display the DEFAULT value of pseudo_slave_mode                   #
 
42
######################################################################## 
 
43
 
 
44
SET @@session.pseudo_slave_mode = 0;
 
45
SET @@session.pseudo_slave_mode = DEFAULT;
 
46
SELECT @@session.pseudo_slave_mode;
 
47
 
 
48
SET @@session.pseudo_slave_mode = 1;
 
49
SET @@session.pseudo_slave_mode = DEFAULT;
 
50
SELECT @@session.pseudo_slave_mode;
 
51
 
 
52
 
 
53
--echo '#---------------------FN_DYNVARS_156_02-------------------------#'
 
54
############################################################################# 
 
55
#   Check if pseudo_slave_mode can be accessed with and without @@ sign           #
 
56
############################################################################# 
 
57
 
 
58
SET pseudo_slave_mode = 1;
 
59
SELECT @@pseudo_slave_mode;
 
60
 
 
61
--Error ER_UNKNOWN_TABLE
 
62
SELECT session.pseudo_slave_mode;
 
63
 
 
64
--Error ER_UNKNOWN_TABLE
 
65
SELECT local.pseudo_slave_mode;
 
66
 
 
67
SET session pseudo_slave_mode = 0;
 
68
SELECT @@session.pseudo_slave_mode;
 
69
 
 
70
 
 
71
--echo '#--------------------FN_DYNVARS_156_03------------------------#'
 
72
######################################################################## 
 
73
#      change the value of pseudo_slave_mode to a valid value                #
 
74
######################################################################## 
 
75
 
 
76
SET @@session.pseudo_slave_mode = 0;
 
77
SELECT @@session.pseudo_slave_mode;
 
78
SET @@session.pseudo_slave_mode = 1;
 
79
SELECT @@session.pseudo_slave_mode;
 
80
 
 
81
 
 
82
--echo '#--------------------FN_DYNVARS_156_04-------------------------#'
 
83
########################################################################### 
 
84
#       Change the value of pseudo_slave_mode to invalid value                  #
 
85
########################################################################### 
 
86
 
 
87
--Error ER_WRONG_VALUE_FOR_VAR
 
88
SET @@session.pseudo_slave_mode = -1;
 
89
--Error ER_WRONG_VALUE_FOR_VAR
 
90
SET @@session.pseudo_slave_mode = 2;
 
91
--Error ER_WRONG_VALUE_FOR_VAR
 
92
SET @@session.pseudo_slave_mode = "T";
 
93
--Error ER_WRONG_VALUE_FOR_VAR
 
94
SET @@session.pseudo_slave_mode = "Y";
 
95
--Error ER_WRONG_VALUE_FOR_VAR
 
96
SET @@session.pseudo_slave_mode = TR�E;
 
97
--Error ER_WRONG_VALUE_FOR_VAR
 
98
SET @@session.pseudo_slave_mode = �N;
 
99
--Error ER_WRONG_VALUE_FOR_VAR
 
100
SET @@session.pseudo_slave_mode = OF;
 
101
--Error ER_WRONG_VALUE_FOR_VAR
 
102
SET @@session.pseudo_slave_mode = �FF;
 
103
--Error ER_WRONG_VALUE_FOR_VAR
 
104
SET @@session.pseudo_slave_mode = '�';
 
105
--Error ER_WRONG_VALUE_FOR_VAR
 
106
SET @@session.pseudo_slave_mode = NO;
 
107
 
 
108
 
 
109
--echo '#-------------------FN_DYNVARS_156_05----------------------------#'
 
110
########################################################################### 
 
111
#       Test if accessing global pseudo_slave_mode gives error                  #
 
112
########################################################################### 
 
113
 
 
114
--error ER_LOCAL_VARIABLE
 
115
SET @@global.pseudo_slave_mode = 0;
 
116
--error ER_INCORRECT_GLOBAL_LOCAL_VAR
 
117
SELECT @@global.pseudo_slave_mode;
 
118
 
 
119
--echo '#----------------------FN_DYNVARS_156_06------------------------#'
 
120
######################################################################### 
 
121
#     Check if the value in SESSION Table contains variable value        #
 
122
#########################################################################
 
123
 
 
124
SELECT count(VARIABLE_VALUE) FROM INFORMATION_SCHEMA.SESSION_VARIABLES WHERE VARIABLE_NAME='pseudo_slave_mode';
 
125
 
 
126
--echo '#----------------------FN_DYNVARS_156_07------------------------#'
 
127
######################################################################### 
 
128
#     Check if the value in SESSION Table matches value in variable      #
 
129
#########################################################################
 
130
 
 
131
SELECT IF(@@session.pseudo_slave_mode, "ON", "OFF") = VARIABLE_VALUE 
 
132
FROM INFORMATION_SCHEMA.SESSION_VARIABLES 
 
133
WHERE VARIABLE_NAME='pseudo_slave_mode';
 
134
SELECT @@session.pseudo_slave_mode;
 
135
SELECT VARIABLE_VALUE 
 
136
FROM INFORMATION_SCHEMA.SESSION_VARIABLES 
 
137
WHERE VARIABLE_NAME='pseudo_slave_mode';
 
138
 
 
139
--echo '#---------------------FN_DYNVARS_156_08-------------------------#'
 
140
################################################################### 
 
141
#        Check if ON and OFF values can be used on variable       #
 
142
################################################################### 
 
143
 
 
144
SET @@session.pseudo_slave_mode = OFF;
 
145
SELECT @@session.pseudo_slave_mode;
 
146
SET @@session.pseudo_slave_mode = ON;
 
147
SELECT @@session.pseudo_slave_mode;
 
148
 
 
149
--echo '#---------------------FN_DYNVARS_156_09----------------------#'
 
150
################################################################### 
 
151
#      Check if TRUE and FALSE values can be used on variable     #
 
152
################################################################### 
 
153
 
 
154
SET @@session.pseudo_slave_mode = TRUE;
 
155
SELECT @@session.pseudo_slave_mode;
 
156
SET @@session.pseudo_slave_mode = FALSE;
 
157
SELECT @@session.pseudo_slave_mode;
 
158
 
 
159
##############################  
 
160
#   Restore initial value    #
 
161
##############################
 
162
 
 
163
SET @@session.pseudo_slave_mode = @session_start_value;
 
164
SELECT @@session.pseudo_slave_mode;
 
165
 
 
166
###############################################################
 
167
#                    END OF pseudo_slave_mode TESTS                 #
 
168
###############################################################