MySQL 5.6.14 Source Code Document
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
log_warnings_basic.inc
1 ############## mysql-test\t\log_warnings_basic.test ###############
2 # #
3 # Variable Name: log_warnings #
4 # Scope: GLOBAL #
5 # Access Type: Dynamic #
6 # Data Type: numeric #
7 # Default Value: 1 #
8 # Range: - #
9 # #
10 # #
11 # Creation Date: 2008-02-07 #
12 # Author: Salman #
13 # #
14 # Description: Test Cases of Dynamic System Variable log_warnings #
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 log_warnings TESTS #
30 ############################################################
31 
32 
33 #############################################################
34 # Save initial value #
35 #############################################################
36 
37 SET @start_global_value = @@global.log_warnings;
38 SELECT @start_global_value;
39 
40 
41 --echo '#--------------------FN_DYNVARS_067_01-------------------------#'
42 ########################################################################
43 # Display the DEFAULT value of log_warnings #
44 ########################################################################
45 
46 SET @@global.log_warnings = 100;
47 SET @@global.log_warnings = DEFAULT;
48 SELECT @@global.log_warnings;
49 
50 
51 --echo '#--------------------FN_DYNVARS_067_02-------------------------#'
52 ########################################################################
53 # Check the DEFAULT value of log_warnings #
54 ########################################################################
55 
56 SET @@global.log_warnings = DEFAULT;
57 SELECT @@global.log_warnings = 1;
58 
59 
60 --echo '#--------------------FN_DYNVARS_067_03-------------------------#'
61 ######################################################################
62 # Change the value of log_warnings to a valid value for GLOBAL Scope #
63 ######################################################################
64 
65 SET @@global.log_warnings = 0;
66 SELECT @@global.log_warnings;
67 SET @@global.log_warnings = 1;
68 SELECT @@global.log_warnings;
69 SET @@global.log_warnings = 60020;
70 SELECT @@global.log_warnings;
71 SET @@global.log_warnings = 65535;
72 SELECT @@global.log_warnings;
73 SET @@global.log_warnings = 65536;
74 SELECT @@global.log_warnings;
75 
76 
77 --echo '#------------------FN_DYNVARS_067_04-----------------------#'
78 ########################################################
79 # Change the value of log_warnings to an invalid value #
80 ########################################################
81 
82 SET @@global.log_warnings = 100000000000;
83 SELECT @@global.log_warnings;
84 SET @@global.log_warnings = -1024;
85 SELECT @@global.log_warnings;
86 --Error ER_WRONG_TYPE_FOR_VAR
87 SET @@global.log_warnings = 65530.34;
88 SELECT @@global.log_warnings;
89 --Error ER_WRONG_TYPE_FOR_VAR
90 SET @@global.log_warnings = test;
91 SELECT @@global.log_warnings;
92 
93 
94 --echo '#------------------FN_DYNVARS_067_05-----------------------#'
95 ####################################################################
96 # Check if the value in GLOBAL Table matches value in variable #
97 ####################################################################
98 
99 SELECT @@global.log_warnings = VARIABLE_VALUE
100 FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
101 WHERE VARIABLE_NAME='log_warnings';
102 
103 
104 --echo '#------------------FN_DYNVARS_067_06-----------------------#'
105 ####################################################################
106 # Check if TRUE and FALSE values can be used on variable #
107 ####################################################################
108 
109 SET @@global.log_warnings = TRUE;
110 SELECT @@global.log_warnings;
111 SET @@global.log_warnings = FALSE;
112 SELECT @@global.log_warnings;
113 
114 
115 --echo '#---------------------FN_DYNVARS_067_07----------------------#'
116 #################################################################################
117 # Check if accessing variable with and without GLOBAL point to same variable #
118 #################################################################################
119 
120 SET @@global.log_warnings = 10;
121 SELECT @@log_warnings = @@global.log_warnings;
122 
123 
124 ####################################
125 # Restore initial value #
126 ####################################
127 
128 SET @@global.log_warnings = @start_global_value;
129 SELECT @@global.log_warnings;
130 
131 
132 #############################################################
133 # END OF log_warnings TESTS #
134 #############################################################
135