Commit 69da361c authored by Sergei Golubchik's avatar Sergei Golubchik

reset @@TIMESTAMP for COM_CHANGE_USER

this also fixes tokudb.type_year failure
(in ./mtr tokudb.type_timestamp tokudb.type_year)
parent 4aacb20d
...@@ -90,3 +90,14 @@ NULL ...@@ -90,3 +90,14 @@ NULL
FLUSH STATUS; FLUSH STATUS;
Value of com_select did not change Value of com_select did not change
set global secure_auth=default; set global secure_auth=default;
set timestamp=unix_timestamp('2010-10-10 10:10:10');
select now();
now()
2010-10-10 10:10:10
select year(now()) > 2011;
year(now()) > 2011
0
change_user
select year(now()) > 2011;
year(now()) > 2011
1
...@@ -142,3 +142,10 @@ if ($after != $before){ ...@@ -142,3 +142,10 @@ if ($after != $before){
echo Value of com_select did not change; echo Value of com_select did not change;
set global secure_auth=default; set global secure_auth=default;
set timestamp=unix_timestamp('2010-10-10 10:10:10');
select now();
select year(now()) > 2011;
--echo change_user
--change_user
select year(now()) > 2011;
...@@ -945,7 +945,6 @@ THD::THD(my_thread_id id, bool is_wsrep_applier) ...@@ -945,7 +945,6 @@ THD::THD(my_thread_id id, bool is_wsrep_applier)
statement_id_counter= 0UL; statement_id_counter= 0UL;
// Must be reset to handle error with THD's created for init of mysqld // Must be reset to handle error with THD's created for init of mysqld
lex->current_select= 0; lex->current_select= 0;
user_time.val= start_time= start_time_sec_part= 0;
start_utime= utime_after_query= 0; start_utime= utime_after_query= 0;
utime_after_lock= 0L; utime_after_lock= 0L;
progress.arena= 0; progress.arena= 0;
...@@ -1399,6 +1398,8 @@ void THD::init(void) ...@@ -1399,6 +1398,8 @@ void THD::init(void)
mysql_mutex_unlock(&LOCK_global_system_variables); mysql_mutex_unlock(&LOCK_global_system_variables);
user_time.val= start_time= start_time_sec_part= 0;
server_status= SERVER_STATUS_AUTOCOMMIT; server_status= SERVER_STATUS_AUTOCOMMIT;
if (variables.sql_mode & MODE_NO_BACKSLASH_ESCAPES) if (variables.sql_mode & MODE_NO_BACKSLASH_ESCAPES)
server_status|= SERVER_STATUS_NO_BACKSLASH_ESCAPES; server_status|= SERVER_STATUS_NO_BACKSLASH_ESCAPES;
......
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