mirror of
https://github.com/MariaDB/server.git
synced 2025-08-01 03:47:19 +03:00
Portablity fix
This commit is contained in:
@ -1,2 +1,2 @@
|
|||||||
Variable_name Value
|
FROM_UNIXTIME(24*3600)
|
||||||
timezone MET
|
1970-01-02 01:00:00
|
||||||
|
@ -32,6 +32,6 @@ CREATE TABLE t1 (
|
|||||||
a double default NULL
|
a double default NULL
|
||||||
) TYPE=MyISAM;
|
) TYPE=MyISAM;
|
||||||
|
|
||||||
INSERT INTO t1 VALUES (NULL);
|
INSERT INTO t1 VALUES (RES);
|
||||||
|
|
||||||
DROP TABLE t1;
|
DROP TABLE t1;
|
||||||
|
@ -1,4 +1,13 @@
|
|||||||
DROP TABLE IF EXISTS t1;
|
DROP TABLE IF EXISTS t1;
|
||||||
|
show variables like "timezone";
|
||||||
|
Variable_name Value
|
||||||
|
timezone MET
|
||||||
|
select @a:=FROM_UNIXTIME(1);
|
||||||
|
@a:=FROM_UNIXTIME(1)
|
||||||
|
1970-01-01 01:00:01
|
||||||
|
select unix_timestamp(@a);
|
||||||
|
unix_timestamp(@a)
|
||||||
|
1
|
||||||
CREATE TABLE t1 (ts int);
|
CREATE TABLE t1 (ts int);
|
||||||
INSERT INTO t1 (ts) VALUES (Unix_timestamp('2002-10-27 01:00'));
|
INSERT INTO t1 (ts) VALUES (Unix_timestamp('2002-10-27 01:00'));
|
||||||
INSERT INTO t1 (ts) VALUES (Unix_timestamp('2002-10-27 02:00'));
|
INSERT INTO t1 (ts) VALUES (Unix_timestamp('2002-10-27 02:00'));
|
||||||
@ -23,9 +32,3 @@ ts from_unixtime(ts)
|
|||||||
1048989599 2003-03-30 03:59:59
|
1048989599 2003-03-30 03:59:59
|
||||||
1048989601 2003-03-30 04:00:01
|
1048989601 2003-03-30 04:00:01
|
||||||
DROP TABLE t1;
|
DROP TABLE t1;
|
||||||
select @a:=FROM_UNIXTIME(1);
|
|
||||||
@a:=FROM_UNIXTIME(1)
|
|
||||||
1970-01-01 01:00:01
|
|
||||||
select unix_timestamp(@a);
|
|
||||||
unix_timestamp(@a)
|
|
||||||
1
|
|
||||||
|
@ -25,5 +25,8 @@ DROP TABLE t1;
|
|||||||
|
|
||||||
CREATE TABLE t1 (a double);
|
CREATE TABLE t1 (a double);
|
||||||
INSERT INTO t1 VALUES (-9e999999);
|
INSERT INTO t1 VALUES (-9e999999);
|
||||||
|
# The following replaces is here because some systems replaces the above
|
||||||
|
# double with '-inf' and others with MAX_DOUBLE
|
||||||
|
--replace_result (-1.79769313486232e+308) (RES) (NULL) (RES)
|
||||||
--exec $MYSQL_DUMP --skip-comments test t1
|
--exec $MYSQL_DUMP --skip-comments test t1
|
||||||
DROP TABLE t1;
|
DROP TABLE t1;
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
|
|
||||||
-- require r/have_met_timezone.require
|
-- require r/have_met_timezone.require
|
||||||
disable_query_log;
|
disable_query_log;
|
||||||
show variables like "timezone";
|
select FROM_UNIXTIME(24*3600);
|
||||||
enable_query_log;
|
enable_query_log;
|
||||||
|
|
||||||
# Initialization
|
# Initialization
|
||||||
@ -11,6 +11,17 @@ enable_query_log;
|
|||||||
DROP TABLE IF EXISTS t1;
|
DROP TABLE IF EXISTS t1;
|
||||||
--enable_warnings
|
--enable_warnings
|
||||||
|
|
||||||
|
show variables like "timezone";
|
||||||
|
|
||||||
|
#
|
||||||
|
# Test unix timestamp
|
||||||
|
#
|
||||||
|
select @a:=FROM_UNIXTIME(1);
|
||||||
|
select unix_timestamp(@a);
|
||||||
|
|
||||||
|
#
|
||||||
|
# Test of some values, including some with daylight saving time
|
||||||
|
#
|
||||||
|
|
||||||
CREATE TABLE t1 (ts int);
|
CREATE TABLE t1 (ts int);
|
||||||
INSERT INTO t1 (ts) VALUES (Unix_timestamp('2002-10-27 01:00'));
|
INSERT INTO t1 (ts) VALUES (Unix_timestamp('2002-10-27 01:00'));
|
||||||
@ -27,8 +38,3 @@ INSERT INTO t1 (ts) VALUES (Unix_timestamp('2003-03-30 04:00:01'));
|
|||||||
SELECT ts,from_unixtime(ts) FROM t1;
|
SELECT ts,from_unixtime(ts) FROM t1;
|
||||||
DROP TABLE t1;
|
DROP TABLE t1;
|
||||||
|
|
||||||
#
|
|
||||||
# Test unix timestamp
|
|
||||||
#
|
|
||||||
select @a:=FROM_UNIXTIME(1);
|
|
||||||
select unix_timestamp(@a);
|
|
||||||
|
Reference in New Issue
Block a user