summaryrefslogtreecommitdiff
path: root/mysql-test/t/func_time.test
diff options
context:
space:
mode:
authorunknown <monty@hundin.mysql.fi>2001-10-31 18:27:49 +0200
committerunknown <monty@hundin.mysql.fi>2001-10-31 18:27:49 +0200
commit03f6fdd575f71aacd4b6e782c9df4b929f8222b1 (patch)
tree603547f133fd6eaa7de511aeb171eb8224e0d208 /mysql-test/t/func_time.test
parent3f7cf671a1d735a72e98e89d91a16cce085e6817 (diff)
downloadmariadb-git-03f6fdd575f71aacd4b6e782c9df4b929f8222b1.tar.gz
Portability fixes
Fix for consistent 0000-00-00 date handling Close + open binary logs on flush tables Fix for AVG() in HAVING. BUILD/SETUP.sh: Compile MySQL with -O0 to make debugging easier. Docs/manual.texi: Changelog configure.in: Version change innobase/buf/buf0lru.c: Fix for windows mysql-test/r/func_time.result: Updated tests mysql-test/r/having.result: Updated tests mysql-test/t/func_time.test: Updated tests mysql-test/t/having.test: Updated tests mysys/mf_casecnv.c: Portability fix mysys/mf_qsort.c: Portability fix mysys/my_compress.c: Portability fix mysys/my_tempnam.c: More comments sql/field.cc: Fix for consistent 0000-00-00 date handling sql/item.h: Fix for AVG() in HAVING sql/log.cc: Close + open update logs on flush tables sql/sql_select.cc: More debugging info sql/time.cc: Fix for consistent 0000-00-00 date handling strings/ctype.c: Portability fix strings/strto.c: Portability fix
Diffstat (limited to 'mysql-test/t/func_time.test')
-rw-r--r--mysql-test/t/func_time.test18
1 files changed, 18 insertions, 0 deletions
diff --git a/mysql-test/t/func_time.test b/mysql-test/t/func_time.test
index cb021d25ae3..7901387eb24 100644
--- a/mysql-test/t/func_time.test
+++ b/mysql-test/t/func_time.test
@@ -131,3 +131,21 @@ INSERT INTO t1 VALUES ('');
SELECT month(updated) from t1;
SELECT year(updated) from t1;
drop table t1;
+
+#
+# Check that functions work identically on 0000-00-00 as a constant and on a
+# column
+#
+
+create table t1 (d date, dt datetime, t timestamp, c char(10));
+insert into t1 values ("0000-00-00", "0000-00-00", "0000-00-00", "0000-00-00");
+select dayofyear("0000-00-00"),dayofyear(d),dayofyear(dt),dayofyear(t),dayofyear(c) from t1;
+select dayofmonth("0000-00-00"),dayofmonth(d),dayofmonth(dt),dayofmonth(t),dayofmonth(c) from t1;
+select month("0000-00-00"),month(d),month(dt),month(t),month(c) from t1;
+select quarter("0000-00-00"),quarter(d),quarter(dt),quarter(t),quarter(c) from t1;
+select week("0000-00-00"),week(d),week(dt),week(t),week(c) from t1;
+select year("0000-00-00"),year(d),year(dt),year(t),year(c) from t1;
+select yearweek("0000-00-00"),yearweek(d),yearweek(dt),yearweek(t),yearweek(c) from t1;
+select to_days("0000-00-00"),to_days(d),to_days(dt),to_days(t),to_days(c) from t1;
+select extract(MONTH FROM "0000-00-00"),extract(MONTH FROM d),extract(MONTH FROM dt),extract(MONTH FROM t),extract(MONTH FROM c) from t1;
+drop table t1;