Debian Codegraph @

mysql-test/suite/sys_vars/t/basedir_basic.test

raw
1
2 ################## mysql-test\t\basedir_basic.test ############################
3 # #
4 # Variable Name: basedir #
5 # Scope: Global #
6 # Access Type: Static #
7 # Data Type: filename #
8 # #
9 # #
10 # Creation Date: 2008-02-07 #
11 # Author : Sharique Abdullah #
12 # #
13 # #
14 # Description:Test Cases of Dynamic System Variable basedir #
15 # that checks the behavior of this variable in the following ways #
16 # * Value Check #
17 # * Scope Check #
18 # #
19 # Reference: http://dev.mysql.com/doc/refman/5.1/en/ #
20 # server-system-variables.html #
21 # #
22 ###############################################################################
23
24 --echo '#---------------------BS_STVARS_001_01----------------------#'
25 ####################################################################
26 # Displaying default value #
27 ####################################################################
28 SELECT COUNT(@@GLOBAL.basedir);
29 --echo 1 Expected
30
31
32 --echo '#---------------------BS_STVARS_001_02----------------------#'
33 ####################################################################
34 # Check if Value can set #
35 ####################################################################
36
37 --error ER_INCORRECT_GLOBAL_LOCAL_VAR
38 SET @@GLOBAL.basedir=1;
39 --echo Expected error 'Read only variable'
40
41 SELECT COUNT(@@GLOBAL.basedir);
42 --echo 1 Expected
43
44
45
46
47 --echo '#---------------------BS_STVARS_001_03----------------------#'
48 #################################################################
49 # Check if the value in GLOBAL Table matches value in variable #
50 #################################################################
51
52 --disable_warnings
53 SELECT @@GLOBAL.basedir = VARIABLE_VALUE
54 FROM performance_schema.global_variables
55 WHERE VARIABLE_NAME='basedir';
56 --enable_warnings
57 --echo 1 Expected
58
59 SELECT COUNT(@@GLOBAL.basedir);
60 --echo 1 Expected
61
62 --disable_warnings
63 SELECT COUNT(VARIABLE_VALUE)
64 FROM performance_schema.global_variables
65 WHERE VARIABLE_NAME='basedir';
66 --enable_warnings
67 --echo 1 Expected
68
69
70
71 --echo '#---------------------BS_STVARS_001_04----------------------#'
72 ################################################################################
73 # Check if accessing variable with and without GLOBAL point to same variable #
74 ################################################################################
75 SELECT @@basedir = @@GLOBAL.basedir;
76 --echo 1 Expected
77
78
79
80 --echo '#---------------------BS_STVARS_001_05----------------------#'
81 ################################################################################
82 # Check if basedir can be accessed with and without @@ sign #
83 ################################################################################
84
85 SELECT COUNT(@@basedir);
86 --echo 1 Expected
87
88 --Error ER_INCORRECT_GLOBAL_LOCAL_VAR
89 SELECT COUNT(@@local.basedir);
90 --echo Expected error 'Variable is a GLOBAL variable'
91
92 --Error ER_INCORRECT_GLOBAL_LOCAL_VAR
93 SELECT COUNT(@@SESSION.basedir);
94 --echo Expected error 'Variable is a GLOBAL variable'
95
96 SELECT COUNT(@@GLOBAL.basedir);
97 --echo 1 Expected
98
99 --Error ER_BAD_FIELD_ERROR
100 SELECT basedir;
101 --echo Expected error 'Unknown column'
102
103