~jlukas79/+junk/mysql-server

« back to all changes in this revision

Viewing changes to mysql-test/t/interactive_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\interactive_timeout_func.test #####################
 
2
#                                                                             #
 
3
# Variable Name: interactive_timeout                                          #
 
4
# Scope: GLOBAL | SESSION                                                     #
 
5
# Access Type: Dynamic                                                        #
 
6
# Data Type: numeric                                                          #
 
7
# Default Value:28800                                                         #
 
8
# Minvalue: 1                                                                 #
 
9
#                                                                             #
 
10
#                                                                             #
 
11
# Creation Date: 2008-03-07                                                   #
 
12
# Author:  Salman Rawala                                                      #
 
13
#                                                                             #
 
14
# Description: Test Cases of Dynamic System Variable interactive_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                                               #
 
19
#                                                                             #
 
20
###############################################################################
 
21
 
 
22
 
 
23
--disable_warnings
 
24
drop table if exists t1;
 
25
--enable_warnings
 
26
 
 
27
##############################
 
28
#   Creating two new tables  #
 
29
##############################
 
30
 
 
31
--echo ## Creating new table t1 ##
 
32
CREATE TABLE t1
 
33
(
 
34
id INT NOT NULL auto_increment,
 
35
PRIMARY KEY (id),
 
36
name VARCHAR(30)
 
37
);
 
38
 
 
39
 
 
40
--echo '#--------------------FN_DYNVARS_052_01-------------------------#'
 
41
#######################################################################
 
42
#   Setting initial value of interactive_timeout to 1 and verifying its
 
43
#   behavior
 
44
#######################################################################
 
45
 
 
46
--echo ## Setting initial value of variable to 1 ##
 
47
SET @@global.interactive_timeout = 1;
 
48
 
 
49
--echo ## Creating new interactive connection test_con1 ## 
 
50
connect (test_con1, localhost, root,);
 
51
connection test_con1;
 
52
 
 
53
--echo ## Inserting record in table ##
 
54
INSERT into t1(name) values('Record_1');
 
55
 
 
56
--echo ## Setting session value of interactive_timeout ## 
 
57
SET @@session.interactive_timeout = 1;
 
58
 
 
59
--echo ## Verifying values of variable ## 
 
60
SELECT @@session.interactive_timeout;
 
61
SELECT @@global.interactive_timeout;
 
62
 
 
63
--echo ## Using sleep to check timeout ## 
 
64
sleep 5;
 
65
SELECT * from t1;
 
66
 
 
67
--echo 'Bug#35377: Error should appear here because interactive_timeout value';
 
68
--echo 'is 1 and connection remains idle for 5 secs';
 
69
 
 
70
INSERT into t1(name) values('Record_2');