File: timestamp_sysdate_is_now_func.test

package info (click to toggle)
mysql-5.5 5.5.60-0%2Bdeb8u1
  • links: PTS, VCS
  • area: main
  • in suites: jessie
  • size: 201,012 kB
  • sloc: cpp: 648,063; ansic: 552,041; perl: 48,017; pascal: 25,099; sh: 15,065; yacc: 13,088; cs: 4,647; xml: 4,178; sql: 3,380; makefile: 1,368; lex: 639; awk: 54
file content (47 lines) | stat: -rw-r--r-- 2,227 bytes parent folder | download | duplicates (11)
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
############################################################################
#                                                                          #
# Variable Name: timestamp with sysdate-is-now                             #
# Scope: GLOBAL                                                            #
# Access Type: Dynamic                                                     #
# Data Type: INTEGER                                                       #
#                                                                          #
#                                                                          #
# Creation Date: 2008-11-25                                                #
# Author:  Horst Hunger                                                    #
#                                                                          #
# Description: Test Cases of Dynamic System Variable "timestamp"           #
#              that checks behavior of this variable in the following ways #
#              * Like timstamp_func, but with set "sysdate-is-now".        #
#                                                                          #
# Reference: http://dev.mysql.com/doc/refman/5.1/en/set-option.html        #
#                                                                          #
############################################################################

# Use Unix epoch timestamp
# Due to "--sysdate-is-now" timestamp must have an effect on both.
# See also timestamp_func.test.

--echo ** Connecting con1 using root **
connect (con1,localhost,root,,);
SELECT date(now()) = date(sysdate());
SET @@session.timestamp = 1100000000;
SELECT date(now()) != date(sysdate());

# Assure that setting of the variable has no effect on other session.
--echo ** Connecting con0 using root **
connect (con0,localhost,root,,);
SELECT @@session.timestamp != 1100000000;
SET @@session.timestamp = 1000000000;
SELECT date(now()) != date(sysdate());

--echo ** Connection con1 **
connection con1;
SELECT @@session.timestamp != 1000000000;
SELECT @@session.timestamp = 1100000000;

--echo ** Connection default **
connection default;
--echo Disconnecting Connections con0, con1
disconnect con0;
disconnect con1;