blob: ecca3c7daeb9771f5e02efcfe425a4c79e02b548 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
|
############# mysql-test\t\timestamp_func.test #############################
# #
# Variable Name: timestamp #
# Scope: GLOBAL #
# Access Type: Dynamic #
# Data Type: INTEGER #
# #
# #
# Creation Date: 2008-02-25 #
# Author: Sharique Abdullah #
# #
# Description: Test Cases of Dynamic System Variable "timestamp" #
# that checks behavior of this variable in the following ways #
# * Functionality based on different values #
# #
# Reference: http://dev.mysql.com/doc/refman/5.1/en/set-option.html #
# #
############################################################################
--echo ** Setup **
--echo
#
# Setup
#
--echo ** Connecting con0 using root **
connect (con0,localhost,root,,);
--echo ** Connecting con1 using root **
connect (con1, localhost, root,,);
--echo '#-----------------------------FN_DYNVARS_179_01------------------#'
#
# Checking for connection 1
#
--echo ** Connection con0 **
connection con0;
SET @ts_old = @@SESSION.timestamp;
--echo waiting 1 sec
--sleep 1
SET @ts_new = @@SESSION.timestamp;
SELECT @ts_new - @ts_old >= 1 AS 'Timestamp Difference';
--echo 1 means >=1 expected is true
#
# Checking for connection 2
#
--echo ** Connection con1 **
connection con1;
SET @ts_old = @@SESSION.timestamp;
--echo waiting 4 sec
--sleep 4
SET @ts_new = @@SESSION.timestamp;
SELECT @ts_new - @ts_old >= 4 AS 'Timestamp Difference';
--echo 1 means >=4 expected is true
--echo '#-----------------------------FN_DYNVARS_179_02---------------------#'
#
# Testing timezone change effect
#
SET @ts_old = @@SESSION.timestamp;
--sleep 1
--echo Changing time zone
SET time_zone = 'MET';
SET @ts_new = @@SESSION.timestamp;
SELECT @ts_new - @ts_old >= 1 AS 'Timestamp Difference';
--echo 1 means >=1 expected is true
#
# Cleanup
#
--echo ** Cleanup **
--echo ** Connection default **
connection default;
--echo Disconnecting Connections con0, con1
disconnect con0;
disconnect con1;
|