~ubuntu-branches/ubuntu/trusty/mysql-5.6/trusty

« back to all changes in this revision

Viewing changes to mysql-test/suite/sys_vars/t/slow_query_log_file_basic.test

  • Committer: Package Import Robot
  • Author(s): James Page
  • Date: 2014-02-12 11:54:27 UTC
  • Revision ID: package-import@ubuntu.com-20140212115427-oq6tfsqxl1wuwehi
Tags: upstream-5.6.15
ImportĀ upstreamĀ versionĀ 5.6.15

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
################### mysql-test\t\slow_query_log_file_basic.test ################
 
2
#                                                                              #
 
3
# Variable Name: slow_query_log_file                                           #
 
4
# Scope: GLOBAL                                                                #
 
5
# Access Type: Dynamic                                                         #
 
6
# Data Type: Filename                                                          #
 
7
# Default Value: host_name-slow.log                                            #
 
8
# Valid Values:                                                                #
 
9
#                                                                              #
 
10
#                                                                              #
 
11
# Creation Date: 2008-03-16                                                    #
 
12
# Author:  Salman Rawala                                                       #
 
13
# Modified: HHunger 2008-09-11 set system var back to start value              #
 
14
#                                                                              #
 
15
# Description: Test Cases of Dynamic System Variable "slow_query_log_file"     #
 
16
#              that checks behavior of this variable in the following ways     #
 
17
#              * Default Value                                                 #
 
18
#              * Valid & Invalid values                                        #
 
19
#              * Scope & Access method                                         #
 
20
#              * Data Integrity                                                #
 
21
#                                                                              #
 
22
# Reference:                                                                   #
 
23
# http://dev.mysql.com/doc/refman/5.1/en/server-system-variables.html          
 
24
#                                                                              #
 
25
################################################################################
 
26
 
 
27
--source include/load_sysvars.inc
 
28
 
 
29
###########################################################
 
30
#           START OF slow_query_log_file TESTS            #
 
31
###########################################################
 
32
 
 
33
 
 
34
###########################################################################
 
35
#   Saving initial value of slow_query_log_file in a temporary variable   #
 
36
###########################################################################
 
37
 
 
38
SET @start_value = @@global.slow_query_log_file;
 
39
 
 
40
--echo '#---------------------FN_DYNVARS_004_01-------------------------#'
 
41
############################################### 
 
42
#     Verify default value of variable        #
 
43
############################################### 
 
44
 
 
45
SET @@global.slow_query_log_file = DEFAULT;
 
46
SET @a=concat(left(@@hostname, instr(concat(@@hostname, '.'), '.')-1), '-slow.log');
 
47
SELECT RIGHT(@@global.slow_query_log_file, length(@a)) = @a;
 
48
 
 
49
 
 
50
--echo '#--------------------FN_DYNVARS_004_02------------------------#'
 
51
#######################################################################
 
52
#      Change the value of slow_query_log_file to a invalid value     #
 
53
#######################################################################
 
54
 
 
55
# Assumed text if no quotes or numbers.
 
56
SET @@global.slow_query_log_file = mytest.log;
 
57
--error ER_WRONG_TYPE_FOR_VAR
 
58
SET @@global.slow_query_log_file = 12;
 
59
 
 
60
--echo '#----------------------FN_DYNVARS_004_03------------------------#'
 
61
############################################################################## 
 
62
# Check if the value in GLOBAL Tables matches values in variable             #
 
63
##############################################################################
 
64
 
 
65
SELECT @@global.slow_query_log_file = VARIABLE_VALUE 
 
66
FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES 
 
67
WHERE VARIABLE_NAME='slow_query_log_file';
 
68
 
 
69
SET @@global.slow_query_log_file= @start_value;
 
70
#####################################################
 
71
#       END OF slow_query_log_file TESTS            #
 
72
#####################################################
 
73