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(), @@timestamp = UNIX_TIMESTAMP(NOW(6));
5 floor(@@timestamp) = UNIX_TIMESTAMP() @@timestamp = UNIX_TIMESTAMP(NOW(6))
6 1 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(), @@timestamp = UNIX_TIMESTAMP(NOW(6));
13 floor(@@timestamp) = UNIX_TIMESTAMP() @@timestamp = UNIX_TIMESTAMP(NOW(6))
14 1 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(), @@timestamp = UNIX_TIMESTAMP(NOW(6));
20 floor(@@timestamp) = UNIX_TIMESTAMP() @@timestamp = UNIX_TIMESTAMP(NOW(6))
21 1 1
22 SET @temp_ts = @@timestamp - @@timestamp;
23 SELECT @temp_ts;
24 @temp_ts
25 0
26 SET @@timestamp = 1.1;
27 SELECT @@timestamp;
28 @@timestamp
29 1.100000
30 SET @@timestamp = 9999999999999999999999;
31 Warnings:
32 Warning 1292 Truncated incorrect timestamp value: '1e22'
33 SELECT @@timestamp;
34 @@timestamp
35 2147483647.000000
36 '#--------------------FN_DYNVARS_001_04-------------------------#'
37 SET @@timestamp = "100";
38 ERROR 42000: Incorrect argument type to variable 'timestamp'
39 SET @@timestamp = " ";
40 ERROR 42000: Incorrect argument type to variable 'timestamp'
41 '#----------------------FN_DYNVARS_001_06------------------------#'
42 '#---------------------FN_DYNVARS_001_08-------------------------#'
43 SET @@timestamp = OFF;
44 ERROR 42000: Incorrect argument type to variable 'timestamp'
45 SET @@timestamp = ON;
46 ERROR 42000: Incorrect argument type to variable 'timestamp'
47 SET @@timestamp = TRUE;
48 SELECT @@timestamp;
49 @@timestamp
50 1.000000
51 SET @@timestamp = FALSE;
52 '#---------------------FN_DYNVARS_001_10----------------------#'
53 SET @@timestamp = 123456;
54 SELECT @@timestamp = @@local.timestamp and @@timestamp = @@session.timestamp;
55 @@timestamp = @@local.timestamp and @@timestamp = @@session.timestamp
56 1
57 SET @@timestamp = 654321;
58 SELECT @@timestamp = @@local.timestamp and @@timestamp = @@session.timestamp;
59 @@timestamp = @@local.timestamp and @@timestamp = @@session.timestamp
60 1
61 '#---------------------FN_DYNVARS_001_11----------------------#'
62 SET timestamp = 1;
63 SELECT @@timestamp;
64 @@timestamp
65 1.000000
66 SELECT local.timestamp;
67 ERROR 42S02: Unknown table 'local' in SELECT
68 SELECT session.timestamp;
69 ERROR 42S02: Unknown table 'session' in SELECT
70 SELECT timestamp = @@session.timestamp;
71 ERROR 42S22: Unknown column 'timestamp' in 'SELECT'
72 SET @@timestamp = @session_start_value;