~jlukas79/+junk/mysql-server

« back to all changes in this revision

Viewing changes to mysql-test/t/log_queries_not_using_indexes_basic.test

manual merge 6.0-main --> 6.0-bka-review

Show diffs side-by-side

added added

removed removed

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