Below is the list of changes that have just been committed into a local
5.0 repository of thek. When thek does a push these changes will
be propagated to the main repository and, within 24 hours after the
push, to the public repository.
For information on how to access the public repository
see http://dev.mysql.com/doc/mysql/en/installing-source-tree.html
ChangeSet@stripped, 2007-02-19 14:46:39+01:00, thek@stripped +4 -0
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@stripped, 2007-02-19 14:46:37+01:00, thek@stripped +7 -0
Manual merge from 4.1
mysql-test/std_data/init_file.dat@stripped, 2007-02-19 14:46:37+01:00, thek@stripped +9 -0
Manual merge from 4.1
sql/sql_class.cc@stripped, 2007-02-19 14:46:37+01:00, thek@stripped +2 -0
- Moved set_time into init_for_queries process.
sql/sql_parse.cc@stripped, 2007-02-19 14:46:37+01:00, thek@stripped +1 -2
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.
# This is a BitKeeper patch. What follows are the unified diffs for the
# set of deltas contained in the patch. The rest of the patch, the part
# that BitKeeper cares about, is below these diffs.
# User: thek
# Host: kpdesk.mysql.com
# Root: /home/thek/dev/bug23240/my50-bug23240
--- 1.257/sql/sql_class.cc 2007-02-19 14:46:46 +01:00
+++ 1.258/sql/sql_class.cc 2007-02-19 14:46:46 +01:00
@@ -328,6 +328,8 @@ void THD::init_for_queries()
#endif
transaction.xid_state.xid.null();
transaction.xid_state.in_thd=1;
+
+ set_time();
}
--- 1.602/sql/sql_parse.cc 2007-02-19 14:46:46 +01:00
+++ 1.603/sql/sql_parse.cc 2007-02-19 14:46:46 +01:00
@@ -1160,7 +1160,6 @@ pthread_handler_t handle_one_connection(
thd->version= refresh_version;
thd->proc_info= 0;
thd->command= COM_SLEEP;
- thd->set_time();
thd->init_for_queries();
if (sys_init_connect.value_length && !(sctx->master_access & SUPER_ACL))
@@ -1176,7 +1175,6 @@ pthread_handler_t handle_one_connection(
sql_print_warning("%s", net->last_error);
}
thd->proc_info=0;
- thd->set_time();
thd->init_for_queries();
}
@@ -1306,6 +1304,7 @@ pthread_handler_t handle_bootstrap(void
mode we have only one thread.
*/
thd->query_id=next_query_id();
+ thd->set_time();
mysql_parse(thd,thd->query,length);
close_thread_tables(thd); // Free tables
if (thd->is_fatal_error)
--- 1.2/mysql-test/r/init_file.result 2007-02-19 14:46:46 +01:00
+++ 1.3/mysql-test/r/init_file.result 2007-02-19 14:46:46 +01:00
@@ -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;
--- 1.7/mysql-test/std_data/init_file.dat 2007-02-19 14:46:46 +01:00
+++ 1.8/mysql-test/std_data/init_file.dat 2007-02-19 14:46:46 +01:00
@@ -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() );
+
+
| Thread |
|---|
| • bk commit into 5.0 tree (thek:1.2396) BUG#23240 | kpettersson | 19 Feb |