diff options
author | unknown <thek@kpdesk.mysql.com> | 2007-02-19 14:57:54 +0100 |
---|---|---|
committer | unknown <thek@kpdesk.mysql.com> | 2007-02-19 14:57:54 +0100 |
commit | a48276798b77fe4846ba5a7f74281cc1c9814357 (patch) | |
tree | 7b1b3005a3b08bf70ec31a1286cf9ac6c56e0aaa /mysql-test | |
parent | 663b9cad825177de7c70be99a2da78116e899362 (diff) | |
download | mariadb-git-a48276798b77fe4846ba5a7f74281cc1c9814357.tar.gz |
Bug#23240 --init_file statements with NOW() reports '1970-01-01 11:00:00'as the date time
- Starting time of a query sent by bootstrapping wasn't initialized
and starting time defaulted to 0. This later used value by NOW-
item and was translated to 1970-01-01 11:00:00.
- Marketing the time with thd->set_time() before the call to
mysql_parse resolves this issue.
- set_time was refactored to be part of the thd->init_for_queries-
process.
mysql-test/r/init_file.result:
Manual merge from 4.1
mysql-test/std_data/init_file.dat:
Manual merge from 4.1
sql/sql_class.cc:
- Moved set_time into init_for_queries process.
Diffstat (limited to 'mysql-test')
-rw-r--r-- | mysql-test/r/init_file.result | 7 | ||||
-rw-r--r-- | mysql-test/std_data/init_file.dat | 9 |
2 files changed, 16 insertions, 0 deletions
diff --git a/mysql-test/r/init_file.result b/mysql-test/r/init_file.result index 1569f2c3d68..6394014f3e5 100644 --- a/mysql-test/r/init_file.result +++ b/mysql-test/r/init_file.result @@ -1,3 +1,10 @@ +INSERT INTO init_file.startup VALUES ( NOW() ); +SELECT * INTO @X FROM init_file.startup limit 0,1; +SELECT * INTO @Y FROM init_file.startup limit 1,1; +SELECT YEAR(@X)-YEAR(@Y); +YEAR(@X)-YEAR(@Y) +0 +DROP DATABASE init_file; ok end of 4.1 tests select * from t1; diff --git a/mysql-test/std_data/init_file.dat b/mysql-test/std_data/init_file.dat index 814e968eb31..cb8e0778438 100644 --- a/mysql-test/std_data/init_file.dat +++ b/mysql-test/std_data/init_file.dat @@ -27,3 +27,12 @@ insert into t2 values (11), (13); drop procedure p1; drop function f1; drop view v1; + +# +# Bug#23240 --init-file statements with NOW() reports '1970-01-01 11:00:00'as the date time +# +CREATE DATABASE IF NOT EXISTS init_file; +CREATE TABLE IF NOT EXISTS init_file.startup ( startdate DATETIME ); +INSERT INTO init_file.startup VALUES ( NOW() ); + + |