Commit 360947ec authored by unknown's avatar unknown

Merge kpdesk.mysql.com:/home/thek/dev/bug23240/my50-bug23240

into  kpdesk.mysql.com:/home/thek/dev/bug23240/my51-bug23240


sql/sql_class.cc:
  Auto merged
sql/sql_parse.cc:
  Auto merged
parents ae6cc963 a4827679
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 ok
end of 4.1 tests end of 4.1 tests
select * from t1; select * from t1;
......
...@@ -27,3 +27,12 @@ insert into t2 values (11), (13); ...@@ -27,3 +27,12 @@ insert into t2 values (11), (13);
drop procedure p1; drop procedure p1;
drop function f1; drop function f1;
drop view v1; 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() );
...@@ -6,6 +6,15 @@ ...@@ -6,6 +6,15 @@
# mysql-test/t/init_file-master.opt for the actual test # mysql-test/t/init_file-master.opt for the actual test
# #
#
# Bug#23240 --init-file statements with NOW() reports '1970-01-01 11:00:00'as the date time
#
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);
DROP DATABASE init_file;
--echo ok --echo ok
--echo end of 4.1 tests --echo end of 4.1 tests
# #
......
...@@ -355,6 +355,7 @@ void THD::init(void) ...@@ -355,6 +355,7 @@ void THD::init(void)
void THD::init_for_queries() void THD::init_for_queries()
{ {
set_time();
ha_enable_transaction(this,TRUE); ha_enable_transaction(this,TRUE);
reset_root_defaults(mem_root, variables.query_alloc_block_size, reset_root_defaults(mem_root, variables.query_alloc_block_size,
......
...@@ -1205,7 +1205,6 @@ pthread_handler_t handle_one_connection(void *arg) ...@@ -1205,7 +1205,6 @@ pthread_handler_t handle_one_connection(void *arg)
thd->version= refresh_version; thd->version= refresh_version;
thd->proc_info= 0; thd->proc_info= 0;
thd->command= COM_SLEEP; thd->command= COM_SLEEP;
thd->set_time();
thd->init_for_queries(); thd->init_for_queries();
if (sys_init_connect.value_length && !(sctx->master_access & SUPER_ACL)) if (sys_init_connect.value_length && !(sctx->master_access & SUPER_ACL))
...@@ -1221,7 +1220,6 @@ pthread_handler_t handle_one_connection(void *arg) ...@@ -1221,7 +1220,6 @@ pthread_handler_t handle_one_connection(void *arg)
sql_print_warning("%s", net->last_error); sql_print_warning("%s", net->last_error);
} }
thd->proc_info=0; thd->proc_info=0;
thd->set_time();
thd->init_for_queries(); thd->init_for_queries();
} }
...@@ -1355,6 +1353,7 @@ pthread_handler_t handle_bootstrap(void *arg) ...@@ -1355,6 +1353,7 @@ pthread_handler_t handle_bootstrap(void *arg)
mode we have only one thread. mode we have only one thread.
*/ */
thd->query_id=next_query_id(); thd->query_id=next_query_id();
thd->set_time();
mysql_parse(thd,thd->query,length); mysql_parse(thd,thd->query,length);
close_thread_tables(thd); // Free tables close_thread_tables(thd); // Free tables
if (thd->is_fatal_error) if (thd->is_fatal_error)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment