From 8f543b5eb8daccc3d58a6856fa71ae34fec2ccf4 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 10 Mar 2006 16:47:56 +0200 Subject: BUG#15101 SYSDATE() disregards SET TIMESTAMP. After the ChangeSet 1.1892.20.1 2005/08/24 (Bug #12562) SYSDATE() is not an alias of NOW() and is unsafe for replication. `SYSDATE()' backward compatible aliasing clashes with the idea #12562 fix. To make it safe-replicatable we have to either use RBR or to restore the pre-5.0 style. --sysdate-is-now command line flag was introduced to provide backward compatibility. sql/mysqld.cc: New option to force SYSDATE's backward compatible with 4.1 aliasing to NOW (not default) sql/sql_class.h: new slot to fill at init time and check at parse sql/sql_yacc.yy: calling NOW's branches when --sysdate-is-now mysql-test/r/sysdate_is_now.result: New BitKeeper file ``mysql-test/r/sysdate_is_now.result'' mysql-test/t/sysdate_is_now-master.opt: New BitKeeper file ``mysql-test/t/sysdate_is_now-master.opt'' mysql-test/t/sysdate_is_now.test: New BitKeeper file ``mysql-test/t/sysdate_is_now.test'' --- mysql-test/t/sysdate_is_now.test | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 mysql-test/t/sysdate_is_now.test (limited to 'mysql-test/t/sysdate_is_now.test') diff --git a/mysql-test/t/sysdate_is_now.test b/mysql-test/t/sysdate_is_now.test new file mode 100644 index 00000000000..166914e20c8 --- /dev/null +++ b/mysql-test/t/sysdate_is_now.test @@ -0,0 +1,11 @@ +# +# BUG#15101 restore aliasing of SYSDATE to NOW in 5.0 +# this feature is activated via --sysdate-is-now mysqld init opt +# +# To test here +# 1. SYSDATE() does not distiguish from NOW() +# 2. SYSDATE() obeys set timestamp + +set timestamp=1; +SELECT sleep(1),NOW()-SYSDATE() as zero; +# End of 5.0 tests -- cgit v1.2.1