Current Path : /home/usr.opt/mysql57/mysql-test/suite/engines/funcs/t/ |
FreeBSD hs32.drive.ne.jp 9.1-RELEASE FreeBSD 9.1-RELEASE #1: Wed Jan 14 12:18:08 JST 2015 root@hs32.drive.ne.jp:/sys/amd64/compile/hs32 amd64 |
Current File : //home/usr.opt/mysql57/mysql-test/suite/engines/funcs/t/date_function.test |
--disable_warnings DROP TABLE IF EXISTS t3; --enable_warnings SET sql_mode='NO_ENGINE_SUBSTITUTION'; CREATE TABLE t3(c1 DATE NOT NULL); INSERT INTO t3 VALUES('1000-01-01'); INSERT INTO t3 VALUES('1999-12-31'); INSERT INTO t3 VALUES('2000-01-01'); INSERT INTO t3 VALUES('2006-12-25'); INSERT INTO t3 VALUES('2008-02-29'); SELECT DATE(c1) FROM t3; DROP TABLE t3; CREATE TABLE t3(c1 DATETIME NOT NULL); INSERT INTO t3 VALUES('1000-01-01'); INSERT INTO t3 VALUES('1999-12-31'); INSERT INTO t3 VALUES('2000-01-01'); INSERT INTO t3 VALUES('2006-12-25'); INSERT INTO t3 VALUES('2008-02-29'); SELECT DATE(c1) FROM t3; DROP TABLE t3; CREATE TABLE t3(c1 TIMESTAMP NOT NULL); INSERT INTO t3 VALUES('1000-01-01'); INSERT INTO t3 VALUES('1999-12-31'); INSERT INTO t3 VALUES('2000-01-01'); INSERT INTO t3 VALUES('2006-12-25'); INSERT INTO t3 VALUES('2008-02-29'); SELECT DATE(c1) FROM t3; DROP TABLE t3; CREATE TABLE t3(c1 DATE NOT NULL); INSERT INTO t3 VALUES('1000-01-01'); INSERT INTO t3 VALUES('1999-12-31'); INSERT INTO t3 VALUES('2000-01-01'); INSERT INTO t3 VALUES('2006-12-25'); INSERT INTO t3 VALUES('2008-02-29'); SELECT DAYNAME(c1) FROM t3; DROP TABLE t3; CREATE TABLE t3(c1 DATETIME NOT NULL); INSERT INTO t3 VALUES('1000-01-01'); INSERT INTO t3 VALUES('1999-12-31'); INSERT INTO t3 VALUES('2000-01-01'); INSERT INTO t3 VALUES('2006-12-25'); INSERT INTO t3 VALUES('2008-02-29'); SELECT DAYNAME(c1) FROM t3; DROP TABLE t3; CREATE TABLE t3(c1 TIMESTAMP NOT NULL); INSERT INTO t3 VALUES('1000-01-01'); INSERT INTO t3 VALUES('1999-12-31'); INSERT INTO t3 VALUES('2000-01-01'); INSERT INTO t3 VALUES('2006-12-25'); INSERT INTO t3 VALUES('2008-02-29'); SELECT DAYNAME(c1) FROM t3; DROP TABLE t3; CREATE TABLE t3(c1 DATE NOT NULL); INSERT INTO t3 VALUES('1000-01-01'); INSERT INTO t3 VALUES('1999-12-31'); INSERT INTO t3 VALUES('2000-01-01'); INSERT INTO t3 VALUES('2006-12-25'); INSERT INTO t3 VALUES('2008-02-29'); SELECT DAYOFMONTH(c1) FROM t3; DROP TABLE t3; CREATE TABLE t3(c1 DATETIME NOT NULL); INSERT INTO t3 VALUES('1000-01-01'); INSERT INTO t3 VALUES('1999-12-31'); INSERT INTO t3 VALUES('2000-01-01'); INSERT INTO t3 VALUES('2006-12-25'); INSERT INTO t3 VALUES('2008-02-29'); SELECT DAYOFMONTH(c1) FROM t3; DROP TABLE t3; CREATE TABLE t3(c1 TIMESTAMP NOT NULL); INSERT INTO t3 VALUES('1000-01-01'); INSERT INTO t3 VALUES('1999-12-31'); INSERT INTO t3 VALUES('2000-01-01'); INSERT INTO t3 VALUES('2006-12-25'); INSERT INTO t3 VALUES('2008-02-29'); SELECT DAYOFMONTH(c1) FROM t3; DROP TABLE t3; CREATE TABLE t3(c1 DATE NOT NULL); INSERT INTO t3 VALUES('1000-01-01'); INSERT INTO t3 VALUES('1999-12-31'); INSERT INTO t3 VALUES('2000-01-01'); INSERT INTO t3 VALUES('2006-12-25'); INSERT INTO t3 VALUES('2008-02-29'); SELECT DAYOFWEEK(c1) FROM t3; DROP TABLE t3; CREATE TABLE t3(c1 DATETIME NOT NULL); INSERT INTO t3 VALUES('1000-01-01'); INSERT INTO t3 VALUES('1999-12-31'); INSERT INTO t3 VALUES('2000-01-01'); INSERT INTO t3 VALUES('2006-12-25'); INSERT INTO t3 VALUES('2008-02-29'); SELECT DAYOFWEEK(c1) FROM t3; DROP TABLE t3; CREATE TABLE t3(c1 TIMESTAMP NOT NULL); INSERT INTO t3 VALUES('1000-01-01'); INSERT INTO t3 VALUES('1999-12-31'); INSERT INTO t3 VALUES('2000-01-01'); INSERT INTO t3 VALUES('2006-12-25'); INSERT INTO t3 VALUES('2008-02-29'); SELECT DAYOFWEEK(c1) FROM t3; DROP TABLE t3; CREATE TABLE t3(c1 DATE NOT NULL); INSERT INTO t3 VALUES('1000-01-01'); INSERT INTO t3 VALUES('1999-12-31'); INSERT INTO t3 VALUES('2000-01-01'); INSERT INTO t3 VALUES('2006-12-25'); INSERT INTO t3 VALUES('2008-02-29'); SELECT DAYOFYEAR(c1) FROM t3; DROP TABLE t3; CREATE TABLE t3(c1 DATETIME NOT NULL); INSERT INTO t3 VALUES('1000-01-01'); INSERT INTO t3 VALUES('1999-12-31'); INSERT INTO t3 VALUES('2000-01-01'); INSERT INTO t3 VALUES('2006-12-25'); INSERT INTO t3 VALUES('2008-02-29'); SELECT DAYOFYEAR(c1) FROM t3; DROP TABLE t3; CREATE TABLE t3(c1 TIMESTAMP NOT NULL); INSERT INTO t3 VALUES('1000-01-01'); INSERT INTO t3 VALUES('1999-12-31'); INSERT INTO t3 VALUES('2000-01-01'); INSERT INTO t3 VALUES('2006-12-25'); INSERT INTO t3 VALUES('2008-02-29'); SELECT DAYOFYEAR(c1) FROM t3; DROP TABLE t3; CREATE TABLE t3(c1 DATE NOT NULL); INSERT INTO t3 VALUES('1000-01-01'); INSERT INTO t3 VALUES('1999-12-31'); INSERT INTO t3 VALUES('2000-01-01'); INSERT INTO t3 VALUES('2006-12-25'); INSERT INTO t3 VALUES('2008-02-29'); SELECT FROM_DAYS(c1) FROM t3; DROP TABLE t3; CREATE TABLE t3(c1 DATETIME NOT NULL); INSERT INTO t3 VALUES('1000-01-01'); INSERT INTO t3 VALUES('1999-12-31'); INSERT INTO t3 VALUES('2000-01-01'); INSERT INTO t3 VALUES('2006-12-25'); INSERT INTO t3 VALUES('2008-02-29'); SELECT FROM_DAYS(c1) FROM t3; DROP TABLE t3; CREATE TABLE t3(c1 TIMESTAMP NOT NULL); INSERT INTO t3 VALUES('1000-01-01'); INSERT INTO t3 VALUES('1999-12-31'); INSERT INTO t3 VALUES('2000-01-01'); INSERT INTO t3 VALUES('2006-12-25'); INSERT INTO t3 VALUES('2008-02-29'); SELECT FROM_DAYS(c1) FROM t3; DROP TABLE t3; CREATE TABLE t3(c1 DATE NOT NULL); INSERT INTO t3 VALUES('1000-01-01'); INSERT INTO t3 VALUES('1999-12-31'); INSERT INTO t3 VALUES('2000-01-01'); INSERT INTO t3 VALUES('2006-12-25'); INSERT INTO t3 VALUES('2008-02-29'); SELECT LAST_DAY(c1) FROM t3; DROP TABLE t3; CREATE TABLE t3(c1 DATETIME NOT NULL); INSERT INTO t3 VALUES('1000-01-01'); INSERT INTO t3 VALUES('1999-12-31'); INSERT INTO t3 VALUES('2000-01-01'); INSERT INTO t3 VALUES('2006-12-25'); INSERT INTO t3 VALUES('2008-02-29'); SELECT LAST_DAY(c1) FROM t3; DROP TABLE t3; CREATE TABLE t3(c1 TIMESTAMP NOT NULL); INSERT INTO t3 VALUES('1000-01-01'); INSERT INTO t3 VALUES('1999-12-31'); INSERT INTO t3 VALUES('2000-01-01'); INSERT INTO t3 VALUES('2006-12-25'); INSERT INTO t3 VALUES('2008-02-29'); SELECT LAST_DAY(c1) FROM t3; DROP TABLE t3; CREATE TABLE t3(c1 DATE NOT NULL); INSERT INTO t3 VALUES('1000-01-01'); INSERT INTO t3 VALUES('1999-12-31'); INSERT INTO t3 VALUES('2000-01-01'); INSERT INTO t3 VALUES('2006-12-25'); INSERT INTO t3 VALUES('2008-02-29'); SELECT MONTH(c1) FROM t3; DROP TABLE t3; CREATE TABLE t3(c1 DATETIME NOT NULL); INSERT INTO t3 VALUES('1000-01-01'); INSERT INTO t3 VALUES('1999-12-31'); INSERT INTO t3 VALUES('2000-01-01'); INSERT INTO t3 VALUES('2006-12-25'); INSERT INTO t3 VALUES('2008-02-29'); SELECT MONTH(c1) FROM t3; DROP TABLE t3; CREATE TABLE t3(c1 TIMESTAMP NOT NULL); INSERT INTO t3 VALUES('1000-01-01'); INSERT INTO t3 VALUES('1999-12-31'); INSERT INTO t3 VALUES('2000-01-01'); INSERT INTO t3 VALUES('2006-12-25'); INSERT INTO t3 VALUES('2008-02-29'); SELECT MONTH(c1) FROM t3; DROP TABLE t3; CREATE TABLE t3(c1 DATE NOT NULL); INSERT INTO t3 VALUES('1000-01-01'); INSERT INTO t3 VALUES('1999-12-31'); INSERT INTO t3 VALUES('2000-01-01'); INSERT INTO t3 VALUES('2006-12-25'); INSERT INTO t3 VALUES('2008-02-29'); SELECT MONTHNAME(c1) FROM t3; DROP TABLE t3; CREATE TABLE t3(c1 DATETIME NOT NULL); INSERT INTO t3 VALUES('1000-01-01'); INSERT INTO t3 VALUES('1999-12-31'); INSERT INTO t3 VALUES('2000-01-01'); INSERT INTO t3 VALUES('2006-12-25'); INSERT INTO t3 VALUES('2008-02-29'); SELECT MONTHNAME(c1) FROM t3; DROP TABLE t3; CREATE TABLE t3(c1 TIMESTAMP NOT NULL); INSERT INTO t3 VALUES('1000-01-01'); INSERT INTO t3 VALUES('1999-12-31'); INSERT INTO t3 VALUES('2000-01-01'); INSERT INTO t3 VALUES('2006-12-25'); INSERT INTO t3 VALUES('2008-02-29'); SELECT MONTHNAME(c1) FROM t3; DROP TABLE t3; CREATE TABLE t3(c1 DATE NOT NULL); INSERT INTO t3 VALUES('1000-01-01'); INSERT INTO t3 VALUES('1999-12-31'); INSERT INTO t3 VALUES('2000-01-01'); INSERT INTO t3 VALUES('2006-12-25'); INSERT INTO t3 VALUES('2008-02-29'); SELECT QUARTER(c1) FROM t3; DROP TABLE t3; CREATE TABLE t3(c1 DATETIME NOT NULL); INSERT INTO t3 VALUES('1000-01-01'); INSERT INTO t3 VALUES('1999-12-31'); INSERT INTO t3 VALUES('2000-01-01'); INSERT INTO t3 VALUES('2006-12-25'); INSERT INTO t3 VALUES('2008-02-29'); SELECT QUARTER(c1) FROM t3; DROP TABLE t3; CREATE TABLE t3(c1 TIMESTAMP NOT NULL); INSERT INTO t3 VALUES('1000-01-01'); INSERT INTO t3 VALUES('1999-12-31'); INSERT INTO t3 VALUES('2000-01-01'); INSERT INTO t3 VALUES('2006-12-25'); INSERT INTO t3 VALUES('2008-02-29'); SELECT QUARTER(c1) FROM t3; DROP TABLE t3; CREATE TABLE t3(c1 DATE NOT NULL); INSERT INTO t3 VALUES('1000-01-01'); INSERT INTO t3 VALUES('1999-12-31'); INSERT INTO t3 VALUES('2000-01-01'); INSERT INTO t3 VALUES('2006-12-25'); INSERT INTO t3 VALUES('2008-02-29'); SELECT TIMESTAMP(c1) FROM t3; DROP TABLE t3; CREATE TABLE t3(c1 DATETIME NOT NULL); INSERT INTO t3 VALUES('1000-01-01'); INSERT INTO t3 VALUES('1999-12-31'); INSERT INTO t3 VALUES('2000-01-01'); INSERT INTO t3 VALUES('2006-12-25'); INSERT INTO t3 VALUES('2008-02-29'); SELECT TIMESTAMP(c1) FROM t3; DROP TABLE t3; CREATE TABLE t3(c1 TIMESTAMP NOT NULL); INSERT INTO t3 VALUES('1000-01-01'); INSERT INTO t3 VALUES('1999-12-31'); INSERT INTO t3 VALUES('2000-01-01'); INSERT INTO t3 VALUES('2006-12-25'); INSERT INTO t3 VALUES('2008-02-29'); SELECT TIMESTAMP(c1) FROM t3; DROP TABLE t3; CREATE TABLE t3(c1 DATE NOT NULL); INSERT INTO t3 VALUES('1000-01-01'); INSERT INTO t3 VALUES('1999-12-31'); INSERT INTO t3 VALUES('2000-01-01'); INSERT INTO t3 VALUES('2006-12-25'); INSERT INTO t3 VALUES('2008-02-29'); SELECT TO_DAYS(c1) FROM t3; DROP TABLE t3; CREATE TABLE t3(c1 DATETIME NOT NULL); INSERT INTO t3 VALUES('1000-01-01'); INSERT INTO t3 VALUES('1999-12-31'); INSERT INTO t3 VALUES('2000-01-01'); INSERT INTO t3 VALUES('2006-12-25'); INSERT INTO t3 VALUES('2008-02-29'); SELECT TO_DAYS(c1) FROM t3; DROP TABLE t3; CREATE TABLE t3(c1 TIMESTAMP NOT NULL); INSERT INTO t3 VALUES('1000-01-01'); INSERT INTO t3 VALUES('1999-12-31'); INSERT INTO t3 VALUES('2000-01-01'); INSERT INTO t3 VALUES('2006-12-25'); INSERT INTO t3 VALUES('2008-02-29'); SELECT TO_DAYS(c1) FROM t3; DROP TABLE t3; CREATE TABLE t3(c1 DATE NOT NULL); INSERT INTO t3 VALUES('1000-01-01'); INSERT INTO t3 VALUES('1999-12-31'); INSERT INTO t3 VALUES('2000-01-01'); INSERT INTO t3 VALUES('2006-12-25'); INSERT INTO t3 VALUES('2008-02-29'); SELECT WEEK(c1) FROM t3; DROP TABLE t3; CREATE TABLE t3(c1 DATETIME NOT NULL); INSERT INTO t3 VALUES('1000-01-01'); INSERT INTO t3 VALUES('1999-12-31'); INSERT INTO t3 VALUES('2000-01-01'); INSERT INTO t3 VALUES('2006-12-25'); INSERT INTO t3 VALUES('2008-02-29'); SELECT WEEK(c1) FROM t3; DROP TABLE t3; CREATE TABLE t3(c1 TIMESTAMP NOT NULL); INSERT INTO t3 VALUES('1000-01-01'); INSERT INTO t3 VALUES('1999-12-31'); INSERT INTO t3 VALUES('2000-01-01'); INSERT INTO t3 VALUES('2006-12-25'); INSERT INTO t3 VALUES('2008-02-29'); SELECT WEEK(c1) FROM t3; DROP TABLE t3; CREATE TABLE t3(c1 DATE NOT NULL); INSERT INTO t3 VALUES('1000-01-01'); INSERT INTO t3 VALUES('1999-12-31'); INSERT INTO t3 VALUES('2000-01-01'); INSERT INTO t3 VALUES('2006-12-25'); INSERT INTO t3 VALUES('2008-02-29'); SELECT WEEKDAY(c1) FROM t3; DROP TABLE t3; CREATE TABLE t3(c1 DATETIME NOT NULL); INSERT INTO t3 VALUES('1000-01-01'); INSERT INTO t3 VALUES('1999-12-31'); INSERT INTO t3 VALUES('2000-01-01'); INSERT INTO t3 VALUES('2006-12-25'); INSERT INTO t3 VALUES('2008-02-29'); SELECT WEEKDAY(c1) FROM t3; DROP TABLE t3; CREATE TABLE t3(c1 TIMESTAMP NOT NULL); INSERT INTO t3 VALUES('1000-01-01'); INSERT INTO t3 VALUES('1999-12-31'); INSERT INTO t3 VALUES('2000-01-01'); INSERT INTO t3 VALUES('2006-12-25'); INSERT INTO t3 VALUES('2008-02-29'); SELECT WEEKDAY(c1) FROM t3; DROP TABLE t3; CREATE TABLE t3(c1 DATE NOT NULL); INSERT INTO t3 VALUES('1000-01-01'); INSERT INTO t3 VALUES('1999-12-31'); INSERT INTO t3 VALUES('2000-01-01'); INSERT INTO t3 VALUES('2006-12-25'); INSERT INTO t3 VALUES('2008-02-29'); SELECT WEEKOFYEAR(c1) FROM t3; DROP TABLE t3; CREATE TABLE t3(c1 DATETIME NOT NULL); INSERT INTO t3 VALUES('1000-01-01'); INSERT INTO t3 VALUES('1999-12-31'); INSERT INTO t3 VALUES('2000-01-01'); INSERT INTO t3 VALUES('2006-12-25'); INSERT INTO t3 VALUES('2008-02-29'); SELECT WEEKOFYEAR(c1) FROM t3; DROP TABLE t3; CREATE TABLE t3(c1 TIMESTAMP NOT NULL); INSERT INTO t3 VALUES('1000-01-01'); INSERT INTO t3 VALUES('1999-12-31'); INSERT INTO t3 VALUES('2000-01-01'); INSERT INTO t3 VALUES('2006-12-25'); INSERT INTO t3 VALUES('2008-02-29'); SELECT WEEKOFYEAR(c1) FROM t3; DROP TABLE t3; CREATE TABLE t3(c1 DATE NOT NULL); INSERT INTO t3 VALUES('1000-01-01'); INSERT INTO t3 VALUES('1999-12-31'); INSERT INTO t3 VALUES('2000-01-01'); INSERT INTO t3 VALUES('2006-12-25'); INSERT INTO t3 VALUES('2008-02-29'); SELECT YEAR(c1) FROM t3; DROP TABLE t3; CREATE TABLE t3(c1 DATETIME NOT NULL); INSERT INTO t3 VALUES('1000-01-01'); INSERT INTO t3 VALUES('1999-12-31'); INSERT INTO t3 VALUES('2000-01-01'); INSERT INTO t3 VALUES('2006-12-25'); INSERT INTO t3 VALUES('2008-02-29'); SELECT YEAR(c1) FROM t3; DROP TABLE t3; CREATE TABLE t3(c1 TIMESTAMP NOT NULL); INSERT INTO t3 VALUES('1000-01-01'); INSERT INTO t3 VALUES('1999-12-31'); INSERT INTO t3 VALUES('2000-01-01'); INSERT INTO t3 VALUES('2006-12-25'); INSERT INTO t3 VALUES('2008-02-29'); SELECT YEAR(c1) FROM t3; DROP TABLE t3; CREATE TABLE t3(c1 DATE NOT NULL); INSERT INTO t3 VALUES('1000-01-01'); INSERT INTO t3 VALUES('1999-12-31'); INSERT INTO t3 VALUES('2000-01-01'); INSERT INTO t3 VALUES('2006-12-25'); INSERT INTO t3 VALUES('2008-02-29'); SELECT YEARWEEK(c1) FROM t3; DROP TABLE t3; CREATE TABLE t3(c1 DATETIME NOT NULL); INSERT INTO t3 VALUES('1000-01-01'); INSERT INTO t3 VALUES('1999-12-31'); INSERT INTO t3 VALUES('2000-01-01'); INSERT INTO t3 VALUES('2006-12-25'); INSERT INTO t3 VALUES('2008-02-29'); SELECT YEARWEEK(c1) FROM t3; DROP TABLE t3; CREATE TABLE t3(c1 TIMESTAMP NOT NULL); INSERT INTO t3 VALUES('1000-01-01'); INSERT INTO t3 VALUES('1999-12-31'); INSERT INTO t3 VALUES('2000-01-01'); INSERT INTO t3 VALUES('2006-12-25'); INSERT INTO t3 VALUES('2008-02-29'); SELECT YEARWEEK(c1) FROM t3; DROP TABLE t3; SET sql_mode=default;