Debian Codegraph @

mysql-test/suite/sys_vars/t/timestamp_func.test

raw
1 ############################################################################
2 # #
3 # Variable Name: timestamp #
4 # Scope: GLOBAL #
5 # Access Type: Dynamic #
6 # Data Type: INTEGER #
7 # #
8 # #
9 # Creation Date: 2008-02-25 #
10 # Author: Sharique Abdullah #
11 # #
12 # Modified: HHunger 2008-08-28 Reimplemented the test completely. #
13 # #
14 # Description: Test Cases of Dynamic System Variable "timestamp" #
15 # that checks behavior of this variable in the following ways #
16 # * Functionality based on different values #
17 # #
18 # Reference: http://dev.mysql.com/doc/refman/5.1/en/set-option.html #
19 # #
20 ############################################################################
21
22 # Change timestamp which must have an effect on now(), but not on sysdate().
23 # Use Unix epoch timestamp
24 # All comparisons must deliver true(1)
25 # Exception: --sysdate-is-now switches off this behaviour and must not be set.
26
27 connect (con1,localhost,root,,);
28 SELECT date(now()) = date(sysdate());
29 SET @@session.timestamp = 1100000000;
30 SELECT date(now()) != date(sysdate());
31
32 # Assure that setting of the variable has no effect on other session.
33 connect (con0,localhost,root,,);
34 SELECT @@session.timestamp != 1100000000;
35 SET @@session.timestamp = 1000000000;
36 SELECT date(now()) != date(sysdate());
37
38 connection con1;
39 SELECT @@session.timestamp != 1000000000;
40 SELECT @@session.timestamp = 1100000000;
41
42 connection default;
43 disconnect con0;
44 disconnect con1;