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 connect (con1,localhost,root,,);
25 SELECT date(now()) = date(sysdate());
26 SET @@session.timestamp = 1100000000;
27 SELECT date(now()) != date(sysdate());
28
29 # Assure that setting of the variable has no effect on other session.
30 connect (con0,localhost,root,,);
31 SELECT @@session.timestamp != 1100000000;
32 SET @@session.timestamp = 1000000000;
33 SELECT date(now()) != date(sysdate());
34
35 connection con1;
36 SELECT @@session.timestamp != 1000000000;
37 SELECT @@session.timestamp = 1100000000;
38
39 connection default;
40 disconnect con0;
41 disconnect con1;