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