1
0
mirror of https://github.com/MariaDB/server.git synced 2025-12-24 11:21:21 +03:00

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.
This commit is contained in:
unknown
2007-02-19 14:57:54 +01:00
parent 663b9cad82
commit a48276798b
4 changed files with 18 additions and 2 deletions

View File

@@ -1160,7 +1160,6 @@ pthread_handler_t handle_one_connection(void *arg)
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(void *arg)
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 *arg)
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)