3
################## mysql-test\t\log_queries_not_using_indexes_basic.test ######
5
# Variable Name: log_queries_not_using_indexes #
7
# Access Type: Static #
11
# Creation Date: 2008-02-07 #
12
# Author : Sharique Abdullah #
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 #
20
# Reference: http://dev.mysql.com/doc/refman/5.1/en/ #
21
# server-system-variables.html #
23
###############################################################################
25
--echo '#---------------------BS_STVARS_041_01----------------------#'
26
####################################################################
27
# Displaying default value #
28
####################################################################
29
SELECT COUNT(@@GLOBAL.log_queries_not_using_indexes);
33
--echo '#---------------------BS_STVARS_041_02----------------------#'
35
# Test case for Bug #35433
37
####################################################################
38
# Check if Value can set #
39
####################################################################
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);
51
--echo '#---------------------BS_STVARS_041_03----------------------#'
52
#################################################################
53
# Check if the value in GLOBAL Table matches value in variable #
54
#################################################################
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';
61
SELECT COUNT(@@GLOBAL.log_queries_not_using_indexes);
64
SELECT COUNT(VARIABLE_VALUE)
65
FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
66
WHERE VARIABLE_NAME='log_queries_not_using_indexes';
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;
80
--echo '#---------------------BS_STVARS_041_05----------------------#'
81
################################################################################
82
# Check if log_queries_not_using_indexes can be accessed with and without @@ sign #
83
################################################################################
85
SELECT COUNT(@@log_queries_not_using_indexes);
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'
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'
96
SELECT COUNT(@@GLOBAL.log_queries_not_using_indexes);
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'