Debian Codegraph @

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

raw
1 ############################################################################
2 # #
3 # Variable Name: timestamp with sysdate-is-now #
4 # Scope: GLOBAL #
5 # Access Type: Dynamic #
6 # Data Type: INTEGER #
7 # #
8 # #
9 # Creation Date: 2008-11-25 #
10 # Author: Horst Hunger #
11 # #
12 # Description: Test Cases of Dynamic System Variable "timestamp" #
13 # that checks behavior of this variable in the following ways #
14 # * Like timstamp_func, but with set "sysdate-is-now". #
15 # #
16 # Reference: http://dev.mysql.com/doc/refman/5.1/en/set-option.html #
17 # #
18 ############################################################################
19
20 # Use Unix epoch timestamp
21 # Due to "--sysdate-is-now" timestamp must have an effect on both.
22 # See also timestamp_func.test.
23
24 --echo ** Connecting con1 using root **
25 connect (con1,localhost,root,,);
26 SELECT date(now()) = date(sysdate());
27 SET @@session.timestamp = 1100000000;
28 SELECT date(now()) != date(sysdate());
29
30 # Assure that setting of the variable has no effect on other session.
31 --echo ** Connecting con0 using root **
32 connect (con0,localhost,root,,);
33 SELECT @@session.timestamp != 1100000000;
34 SET @@session.timestamp = 1000000000;
35 SELECT date(now()) != date(sysdate());
36
37 --echo ** Connection con1 **
38 connection con1;
39 SELECT @@session.timestamp != 1000000000;
40 SELECT @@session.timestamp = 1100000000;
41
42 --echo ** Connection default **
43 connection default;
44 --echo Disconnecting Connections con0, con1
45 disconnect con0;
46 disconnect con1;
47