~jlukas79/+junk/mysql-server

« back to all changes in this revision

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

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

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
############## mysql-test\t\wait_timeout_func.test ############################
 
2
#                                                                             #
 
3
# Variable Name: wait_timeout                                                 #
 
4
# Scope: GLOBAL | SESSION                                                     #
 
5
# Access Type: Dynamic                                                        #
 
6
# Data Type: numeric                                                          #
 
7
# Default Value:                                                              #
 
8
# Range:                                                                      #
 
9
#                                                                             #
 
10
#                                                                             #
 
11
# Creation Date: 2008-03-07                                                   #
 
12
# Author:  Salman Rawala                                                      #
 
13
#                                                                             #
 
14
# Description: Test Cases of Dynamic System Variable wait_timeout             #
 
15
#              that checks the functionality of this variable                 #
 
16
#                                                                             #
 
17
# Reference: http://dev.mysql.com/doc/refman/5.1/en/                          #
 
18
#  server-system-variables.html#option_mysqld_wait_timeouts                   #
 
19
#                                                                             #
 
20
###############################################################################
 
21
 
 
22
--source include/not_embedded.inc
 
23
 
 
24
--disable_warnings
 
25
drop table if exists t1;
 
26
--enable_warnings
 
27
 
 
28
##############################
 
29
#   Creating two new tables  #
 
30
##############################
 
31
 
 
32
--echo ## Creating new table t1 ##
 
33
CREATE TABLE t1
 
34
(
 
35
id INT NOT NULL auto_increment,
 
36
PRIMARY KEY (id),
 
37
name VARCHAR(30)
 
38
);
 
39
 
 
40
 
 
41
--echo '#--------------------FN_DYNVARS_186_01-------------------------#'
 
42
#######################################################################
 
43
#   Setting initial value of interactive_timeout greater than sleep and
 
44
#   verifying its behavior on session scope
 
45
#######################################################################
 
46
 
 
47
--echo ## Creating new connection test_con1 ## 
 
48
connect (test_con1, localhost, root,,);
 
49
connection test_con1;
 
50
 
 
51
--echo ## Setting value of variable to 5 ##
 
52
SET @@session.wait_timeout = 5;
 
53
 
 
54
--echo ## Inserting record in table t1 ##
 
55
INSERT into t1(name) values('Record_1');
 
56
 
 
57
--echo ## Using sleep to check timeout ## 
 
58
sleep 4;
 
59
 
 
60
 
 
61
--echo '#--------------------FN_DYNVARS_186_02-------------------------#'
 
62
#######################################################################
 
63
#   Setting initial value of interactive_timeout greater than sleep and
 
64
#   verifying its behavior on global scope
 
65
#######################################################################
 
66
 
 
67
--echo ## Setting value of variable ##
 
68
SET @@global.wait_timeout = 5;
 
69
 
 
70
--echo ## Creating new connection test_con2 ## 
 
71
connect (test_con2, localhost, root,,);
 
72
connection test_con2;
 
73
 
 
74
INSERT into t1(name) values('Record_2');
 
75
 
 
76
--echo ## Using sleep to check timeout ## 
 
77
sleep 4;
 
78
 
 
79
 
 
80
 
 
81
 
 
82
--echo '#--------------------FN_DYNVARS_186_03-------------------------#'
 
83
#######################################################################
 
84
#   Setting initial value of interactive_timeout less than sleep and
 
85
#   verifying its behavior on global scope
 
86
#######################################################################
 
87
 
 
88
--echo ## Setting value of variable to 1 ##
 
89
SET @@global.wait_timeout = 1;
 
90
 
 
91
--echo ## Creating new connection ## 
 
92
connect (test_con3, localhost, root,,);
 
93
connection test_con3;
 
94
 
 
95
INSERT into t1(name) values('Record_3');
 
96
 
 
97
--echo ## Using sleep to check timeout ##
 
98
sleep 5;
 
99
 
 
100
--echo ## We cannot test it further because the server stops due to wait_timeout ## 
 
101
--Error 2006
 
102
SELECT * from t1;
 
103