~jlukas79/+junk/mysql-server

« back to all changes in this revision

Viewing changes to mysql-test/t/sql_quote_show_create_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\sql_quote_show_create_basic.test ##################
 
2
#                                                                             #
 
3
# Variable Name: sql_quote_show_create                                        #
 
4
# Scope: SESSION                                                              #
 
5
# Access Type: Dynamic                                                        #
 
6
# Data Type: boolean                                                          #
 
7
# Default Value:                                                              #
 
8
# Valid Values: 0,1                                                           #
 
9
#                                                                             #
 
10
#                                                                             #
 
11
# Creation Date: 2008-02-07                                                   #
 
12
# Author:  Rizwan                                                             #
 
13
#                                                                             #
 
14
# Description: Test Cases of Dynamic System Variable sql_quote_show_create    #
 
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
#                    START OF sql_quote_show_create TESTS             #
 
30
#######################################################################
 
31
 
 
32
 
 
33
############################################################################## 
 
34
#      Saving initial value of sql_quote_show_create in a temporary variable #
 
35
##############################################################################
 
36
 
 
37
SET @session_start_value = @@session.sql_quote_show_create;
 
38
SELECT @session_start_value;
 
39
 
 
40
--echo '#--------------------FN_DYNVARS_162_01------------------------#'
 
41
######################################################################
 
42
#           Display the DEFAULT value of sql_quote_show_create       #
 
43
######################################################################
 
44
 
 
45
SET @@session.sql_quote_show_create = 0;
 
46
SET @@session.sql_quote_show_create = DEFAULT;
 
47
SELECT @@session.sql_quote_show_create;
 
48
 
 
49
SET @@session.sql_quote_show_create = 1;
 
50
SET @@session.sql_quote_show_create = DEFAULT;
 
51
SELECT @@session.sql_quote_show_create;
 
52
 
 
53
 
 
54
--echo '#---------------------FN_DYNVARS_162_02-------------------------#'
 
55
############################################################################# 
 
56
#  Check if sql_quote_show_create can be accessed with and without @@ sign  #
 
57
############################################################################# 
 
58
 
 
59
SET sql_quote_show_create = 1;
 
60
SELECT @@sql_quote_show_create;
 
61
 
 
62
--Error ER_UNKNOWN_TABLE
 
63
SELECT session.sql_quote_show_create;
 
64
 
 
65
--Error ER_UNKNOWN_TABLE
 
66
SELECT local.sql_quote_show_create;
 
67
 
 
68
SET session sql_quote_show_create = 0;
 
69
SELECT @@session.sql_quote_show_create;
 
70
 
 
71
 
 
72
--echo '#--------------------FN_DYNVARS_162_03------------------------#'
 
73
######################################################################## 
 
74
#      change the value of sql_quote_show_create to a valid value      #
 
75
######################################################################## 
 
76
 
 
77
SET @@session.sql_quote_show_create = 0;
 
78
SELECT @@session.sql_quote_show_create;
 
79
SET @@session.sql_quote_show_create = 1;
 
80
SELECT @@session.sql_quote_show_create;
 
81
 
 
82
 
 
83
--echo '#--------------------FN_DYNVARS_162_04-------------------------#'
 
84
########################################################################## 
 
85
#       Change the value of sql_quote_show_create to invalid value       #
 
86
########################################################################## 
 
87
 
 
88
--Error ER_WRONG_VALUE_FOR_VAR
 
89
SET @@session.sql_quote_show_create = -1;
 
90
--Error ER_WRONG_VALUE_FOR_VAR
 
91
SET @@session.sql_quote_show_create = 2;
 
92
--Error ER_WRONG_VALUE_FOR_VAR
 
93
SET @@session.sql_quote_show_create = "T";
 
94
--Error ER_WRONG_VALUE_FOR_VAR
 
95
SET @@session.sql_quote_show_create = "Y";
 
96
--Error ER_WRONG_VALUE_FOR_VAR
 
97
SET @@session.sql_quote_show_create = TR�E;
 
98
--Error ER_WRONG_VALUE_FOR_VAR
 
99
SET @@session.sql_quote_show_create = �N;
 
100
 
 
101
SET @@session.sql_quote_show_create = OF;
 
102
SELECT @@session.sql_quote_show_create;
 
103
 
 
104
--echo 'Bug# 34828: OF is taken as OFF and a value of 0 is set.'
 
105
 
 
106
--Error ER_WRONG_VALUE_FOR_VAR
 
107
SET @@session.sql_quote_show_create = �FF;
 
108
--Error ER_WRONG_VALUE_FOR_VAR
 
109
SET @@session.sql_quote_show_create = '�';
 
110
--Error ER_WRONG_VALUE_FOR_VAR
 
111
SET @@session.sql_quote_show_create = NO;
 
112
 
 
113
 
 
114
--echo '#-------------------FN_DYNVARS_162_05----------------------------#'
 
115
########################################################################## 
 
116
#       Test if accessing global sql_quote_show_create gives error       #
 
117
########################################################################## 
 
118
 
 
119
--Error ER_LOCAL_VARIABLE
 
120
SET @@global.sql_quote_show_create = 0;
 
121
 
 
122
--Error ER_INCORRECT_GLOBAL_LOCAL_VAR
 
123
SELECT @@global.sql_quote_show_create;
 
124
 
 
125
--echo '#----------------------FN_DYNVARS_162_06------------------------#'
 
126
######################################################################### 
 
127
#     Check if the value in GLOBAL Table contains variable value        #
 
128
#########################################################################
 
129
 
 
130
SELECT count(VARIABLE_VALUE) 
 
131
FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES 
 
132
WHERE VARIABLE_NAME='sql_quote_show_create';
 
133
 
 
134
--echo '#----------------------FN_DYNVARS_162_07------------------------#'
 
135
######################################################################### 
 
136
#     Check if the value in GLOBAL Table matches value in variable      #
 
137
#########################################################################
 
138
 
 
139
SELECT @@session.sql_quote_show_create = VARIABLE_VALUE 
 
140
FROM INFORMATION_SCHEMA.SESSION_VARIABLES 
 
141
WHERE VARIABLE_NAME='sql_quote_show_create';
 
142
SELECT @@session.sql_quote_show_create;
 
143
SELECT VARIABLE_VALUE 
 
144
FROM INFORMATION_SCHEMA.SESSION_VARIABLES 
 
145
WHERE VARIABLE_NAME='sql_quote_show_create';
 
146
 
 
147
--echo '#---------------------FN_DYNVARS_162_08-------------------------#'
 
148
################################################################### 
 
149
#        Check if ON and OFF values can be used on variable       #
 
150
################################################################### 
 
151
 
 
152
SET @@session.sql_quote_show_create = OFF;
 
153
SELECT @@session.sql_quote_show_create;
 
154
SET @@session.sql_quote_show_create = ON;
 
155
SELECT @@session.sql_quote_show_create;
 
156
 
 
157
--echo '#---------------------FN_DYNVARS_162_09----------------------#'
 
158
################################################################### 
 
159
#      Check if TRUE and FALSE values can be used on variable     #
 
160
################################################################### 
 
161
 
 
162
SET @@session.sql_quote_show_create = TRUE;
 
163
SELECT @@session.sql_quote_show_create;
 
164
SET @@session.sql_quote_show_create = FALSE;
 
165
SELECT @@session.sql_quote_show_create;
 
166
 
 
167
##############################  
 
168
#   Restore initial value    #
 
169
##############################
 
170
 
 
171
SET @@session.sql_quote_show_create = @session_start_value;
 
172
SELECT @@session.sql_quote_show_create;
 
173
 
 
174
###############################################################
 
175
#                    END OF sql_quote_show_create TESTS       #
 
176
###############################################################