| 1 |
################## mysql-test\t\log_queries_not_using_indexes_basic.test ###### |
| 2 |
# # |
| 3 |
# Variable Name: log_queries_not_using_indexes # |
| 4 |
# Scope: Global # |
| 5 |
# Access Type: Static # |
| 6 |
# Data Type: # |
| 7 |
# # |
| 8 |
# # |
| 9 |
# Creation Date: 2008-02-07 # |
| 10 |
# Author : Sharique Abdullah # |
| 11 |
# # |
| 12 |
# Description:Test Cases of Dynamic System Variable # |
| 13 |
# log_queries_not_using_indexes # |
| 14 |
# that checks the behavior of this variable in the following ways # |
| 15 |
# * Value Check # |
| 16 |
# * Scope Check # |
| 17 |
# # |
| 18 |
# Reference: # |
| 19 |
# http://dev.mysql.com/doc/refman/5.1/en/server-system-variables.html # |
| 20 |
# # |
| 21 |
############################################################################### |
| 22 |
|
| 23 |
SET @start_value= @@global.log_queries_not_using_indexes; |
| 24 |
SET @filter_start_value= @@global.log_slow_filter; |
| 25 |
|
| 26 |
#################################################################### |
| 27 |
# Check that variable is both session and global # |
| 28 |
#################################################################### |
| 29 |
|
| 30 |
SET @@global.log_queries_not_using_indexes= TRUE; |
| 31 |
SET @@session.log_queries_not_using_indexes= TRUE; |
| 32 |
SET @@global.log_queries_not_using_indexes= FALSE; |
| 33 |
SET @@session.log_queries_not_using_indexes= FALSE; |
| 34 |
|
| 35 |
#################################################################### |
| 36 |
# Valid values for boolean # |
| 37 |
#################################################################### |
| 38 |
SET @@global.log_queries_not_using_indexes= DEFAULT; |
| 39 |
SELECT @@global.log_queries_not_using_indexes; |
| 40 |
|
| 41 |
SET @@global.log_queries_not_using_indexes= TRUE; |
| 42 |
SELECT @@global.log_queries_not_using_indexes; |
| 43 |
|
| 44 |
SET @@global.log_queries_not_using_indexes= true; |
| 45 |
SELECT @@global.log_queries_not_using_indexes; |
| 46 |
|
| 47 |
SET @@global.log_queries_not_using_indexes= 0; |
| 48 |
SELECT @@global.log_queries_not_using_indexes; |
| 49 |
|
| 50 |
SET @@global.log_queries_not_using_indexes= 1; |
| 51 |
SELECT @@global.log_queries_not_using_indexes; |
| 52 |
|
| 53 |
SET @goodvar= TRUE; |
| 54 |
SET @@global.log_queries_not_using_indexes= @goodvar; |
| 55 |
SELECT @@global.log_queries_not_using_indexes; |
| 56 |
|
| 57 |
SET GLOBAL log_queries_not_using_indexes= DEFAULT; |
| 58 |
SELECT @@global.log_queries_not_using_indexes; |
| 59 |
|
| 60 |
SET GLOBAL log_queries_not_using_indexes= ON; |
| 61 |
SELECT @@global.log_queries_not_using_indexes; |
| 62 |
|
| 63 |
SET GLOBAL log_queries_not_using_indexes= OFF; |
| 64 |
SELECT @@global.log_queries_not_using_indexes; |
| 65 |
|
| 66 |
SET GLOBAL log_queries_not_using_indexes= -0; |
| 67 |
SELECT @@global.log_queries_not_using_indexes; |
| 68 |
|
| 69 |
--error ER_WRONG_TYPE_FOR_VAR |
| 70 |
SET GLOBAL log_queries_not_using_indexes= 0.00; |
| 71 |
|
| 72 |
SET GLOBAL log_queries_not_using_indexes= +0; |
| 73 |
SELECT @@global.log_queries_not_using_indexes; |
| 74 |
|
| 75 |
################################################################# |
| 76 |
# Not valid values for the variable # |
| 77 |
################################################################# |
| 78 |
|
| 79 |
--error ER_WRONG_VALUE_FOR_VAR |
| 80 |
SET @@global.log_queries_not_using_indexes= 'DEFAULT'; |
| 81 |
|
| 82 |
--error ER_WRONG_VALUE_FOR_VAR |
| 83 |
SET @@global.log_queries_not_using_indexes= 'true'; |
| 84 |
|
| 85 |
--error ER_WRONG_VALUE_FOR_VAR |
| 86 |
SET @@global.log_queries_not_using_indexes= BLABLA; |
| 87 |
|
| 88 |
--error ER_WRONG_VALUE_FOR_VAR |
| 89 |
SET @@global.log_queries_not_using_indexes= 25; |
| 90 |
|
| 91 |
--error ER_WRONG_VALUE_FOR_VAR |
| 92 |
SET GLOBAL log_queries_not_using_indexes= -1; |
| 93 |
|
| 94 |
SET @badvar= 'true'; |
| 95 |
--error ER_WRONG_VALUE_FOR_VAR |
| 96 |
SET @@global.log_queries_not_using_indexes= @badvar; |
| 97 |
|
| 98 |
--error ER_WRONG_VALUE_FOR_VAR |
| 99 |
SET GLOBAL log_queries_not_using_indexes= 'DEFAULT'; |
| 100 |
|
| 101 |
--error ER_PARSE_ERROR |
| 102 |
SET @@global log_queries_not_using_indexes= TRUE; |
| 103 |
|
| 104 |
--error ER_PARSE_ERROR |
| 105 |
SET @@SESSION log_queries_not_using_indexes= TRUE; |
| 106 |
|
| 107 |
#################################################################### |
| 108 |
# Ensure that the value matches log_slow_filter # |
| 109 |
#################################################################### |
| 110 |
|
| 111 |
SET @@SESSION.log_queries_not_using_indexes= TRUE; |
| 112 |
select @@SESSION.log_slow_filter; |
| 113 |
SET @@SESSION.log_queries_not_using_indexes= FALSE; |
| 114 |
select @@SESSION.log_slow_filter; |
| 115 |
SET @@GLOBAL.log_queries_not_using_indexes= TRUE; |
| 116 |
select @@GLOBAL.log_slow_filter; |
| 117 |
SET @@GLOBAL.log_queries_not_using_indexes= FALSE; |
| 118 |
select @@GLOBAL.log_slow_filter; |
| 119 |
|
| 120 |
SET @@SESSION.log_slow_filter=""; |
| 121 |
select @@SESSION.log_queries_not_using_indexes; |
| 122 |
SET @@SESSION.log_slow_filter="not_using_index"; |
| 123 |
select @@SESSION.log_queries_not_using_indexes; |
| 124 |
|
| 125 |
SET @@GLOBAL.log_slow_filter=""; |
| 126 |
select @@GLOBAL.log_queries_not_using_indexes; |
| 127 |
SET @@GLOBAL.log_slow_filter="not_using_index"; |
| 128 |
select @@GLOBAL.log_queries_not_using_indexes; |
| 129 |
|
| 130 |
#################################################################### |
| 131 |
# Restore original value # |
| 132 |
#################################################################### |
| 133 |
|
| 134 |
SET @@global.log_queries_not_using_indexes= @start_value; |
| 135 |
SET @@global.log_slow_filter= @filter_start_value; |