diff options
author | unknown <monty@hundin.mysql.fi> | 2002-11-05 22:45:42 +0200 |
---|---|---|
committer | unknown <monty@hundin.mysql.fi> | 2002-11-05 22:45:42 +0200 |
commit | 841fa6f694a5d998b94a6cd4508fe7d26e8407f3 (patch) | |
tree | 35c29682f33da14c65ad84bda65e02a747878d55 /mysql-test/t/func_time.test | |
parent | 54ebb4175bc98d1ba2ca0e72abd83150d722ce8a (diff) | |
download | mariadb-git-841fa6f694a5d998b94a6cd4508fe7d26e8407f3.tar.gz |
Removed wrong patch to fix DATE BETWEEN TIMESTAMP1 AND TIMESTAMP2
Some simple optimizations
Docs/manual.texi:
Updted how binary log works
mysql-test/mysql-test-run.sh:
Added usage of --port to mysqltest
mysql-test/r/func_test.result:
Moved test of datetime comparison to func_time
mysql-test/r/func_time.result:
New test
mysql-test/t/func_test.test:
Moved test of datetime comparison to func_time
mysql-test/t/func_time.test:
Test of DATE BETWEEN TIMESTAMPS
sql/field.h:
Removed wrong patch
sql/item_cmpfunc.cc:
Removed wrong patch
(Need to be fixed by taking into account all arguments to between)
sql/lock.cc:
Removed call to current_thd
sql/set_var.cc:
Don't show 'socket' variable if sockets are not used
sql/sql_base.cc:
Simple optimisation
Diffstat (limited to 'mysql-test/t/func_time.test')
-rw-r--r-- | mysql-test/t/func_time.test | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/mysql-test/t/func_time.test b/mysql-test/t/func_time.test index a052f5f2d92..7d5ab73fa4c 100644 --- a/mysql-test/t/func_time.test +++ b/mysql-test/t/func_time.test @@ -1,7 +1,7 @@ # # time functions # -drop table if exists t1,t2; +drop table if exists t1,t2,t3; select from_days(to_days("960101")),to_days(960201)-to_days("19960101"),to_days(date_add(curdate(), interval 1 day))-to_days(curdate()),weekday("1997-11-29"); select period_add("9602",-12),period_diff(199505,"9404") ; @@ -160,3 +160,20 @@ select yearweek("0000-00-00"),yearweek(d),yearweek(dt),yearweek(t),yearweek(c) f 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; + +# +# Test problem with TIMESTAMP and BETWEEN +# + +CREATE TABLE t1 ( start datetime default NULL); +INSERT INTO t1 VALUES ('2002-10-21 00:00:00'),('2002-10-28 00:00:00'),('2002-11-04 00:00:00'); +CREATE TABLE t2 ( ctime1 timestamp(14) NOT NULL, ctime2 timestamp(14) NOT NULL); +INSERT INTO t2 VALUES (20021029165106,20021105164731); +CREATE TABLE t3 (ctime1 char(19) NOT NULL, ctime2 char(19) NOT NULL); +INSERT INTO t3 VALUES ("2002-10-29 16:51:06","2002-11-05 16:47:31"); + +# The following statement should be fixed to return a row in 4.1 +select * from t1, t2 where t1.start between t2.ctime1 and t2.ctime2; +select * from t1, t2 where t1.start >= t2.ctime1 and t1.start <= t2.ctime2; +select * from t1, t3 where t1.start between t3.ctime1 and t3.ctime2; +drop table t1,t2,t3; |