Debian Codegraph @

mysql-test/suite/sys_vars/r/timestamp_basic.result

raw
1 SET @session_start_value = @@session.timestamp;
2 '#--------------------FN_DYNVARS_001_01------------------------#'
3 SET @@timestamp = DEFAULT;
4 SELECT FLOOR(@@timestamp) = UNIX_TIMESTAMP();
5 FLOOR(@@timestamp) = UNIX_TIMESTAMP()
6 1
7 '#---------------------FN_DYNVARS_001_02-------------------------#'
8 SET @@global.timestamp = "1000";
9 ERROR HY000: Variable 'timestamp' is a SESSION variable and can't be used with SET GLOBAL
10 '#--------------------FN_DYNVARS_001_03------------------------#'
11 SET @@timestamp = 0;
12 SELECT FLOOR(@@timestamp) = UNIX_TIMESTAMP();
13 FLOOR(@@timestamp) = UNIX_TIMESTAMP()
14 1
15 'Setting 0 resets timestamp to session default timestamp'
16 SET @@timestamp = -1000000000;
17 Warnings:
18 Warning 1292 Truncated incorrect timestamp value: '-1000000000'
19 SELECT FLOOR(@@timestamp) = UNIX_TIMESTAMP();
20 FLOOR(@@timestamp) = UNIX_TIMESTAMP()
21 1
22 SET @temp_ts = @@timestamp - @@timestamp;
23 SELECT @temp_ts;
24 @temp_ts
25 0
26 '#--------------------FN_DYNVARS_001_04-------------------------#'
27 SET @@timestamp = "100";
28 ERROR 42000: Incorrect argument type to variable 'timestamp'
29 SET @@timestamp = " ";
30 ERROR 42000: Incorrect argument type to variable 'timestamp'
31 SET @@timestamp = 9999999999999999999999;
32 ERROR 42000: Variable 'timestamp' can't be set to the value of '1e22'
33 '#----------------------FN_DYNVARS_001_06------------------------#'
34 '#---------------------FN_DYNVARS_001_08-------------------------#'
35 SET @@timestamp = OFF;
36 ERROR 42000: Incorrect argument type to variable 'timestamp'
37 SET @@timestamp = ON;
38 ERROR 42000: Incorrect argument type to variable 'timestamp'
39 SET @@timestamp = TRUE;
40 SELECT @@timestamp;
41 @@timestamp
42 1.000000
43 SET @@timestamp = FALSE;
44 '#---------------------FN_DYNVARS_001_10----------------------#'
45 SET @@timestamp = 123456;
46 SELECT @@timestamp = @@local.timestamp and @@timestamp = @@session.timestamp;
47 @@timestamp = @@local.timestamp and @@timestamp = @@session.timestamp
48 1
49 SET @@timestamp = 654321;
50 SELECT @@timestamp = @@local.timestamp and @@timestamp = @@session.timestamp;
51 @@timestamp = @@local.timestamp and @@timestamp = @@session.timestamp
52 1
53 '#---------------------FN_DYNVARS_001_11----------------------#'
54 SET timestamp = 1;
55 SELECT @@timestamp;
56 @@timestamp
57 1.000000
58 SELECT local.timestamp;
59 ERROR 42S02: Unknown table 'local' in field list
60 SELECT session.timestamp;
61 ERROR 42S02: Unknown table 'session' in field list
62 SELECT timestamp = @@session.timestamp;
63 ERROR 42S22: Unknown column 'timestamp' in 'field list'
64 SET @@timestamp = @session_start_value;