Commit 248e5d01 authored by Vladislav Vaintroub's avatar Vladislav Vaintroub

MDEV-14581 Warning info not cleared when caching THD

In thread caching code, clear THD's warnings before reuse.
parent 5511e8ed
--loose-skip-innodb
--loose-skip-innodb --thread-handling=one-thread-per-connection
......@@ -286,3 +286,15 @@ SHOW WARNINGS;
DROP TABLE t1;
DROP FUNCTION f1;
# MDEV-14581 Warning info not cleared when caching THD
connect (con1,localhost,root,,);
SELECT TIME('10:10:10.11111111111');
disconnect con1;
connect (con2,localhost,root,,);
SHOW WARNINGS;
disconnect con2;
connection default;
......@@ -2961,6 +2961,10 @@ static bool cache_thread(THD *thd)
_db_pop_();
#endif
/* Clear warnings. */
if (!thd->get_stmt_da()->is_warning_info_empty())
thd->get_stmt_da()->clear_warning_info(thd->query_id);
set_timespec(abstime, THREAD_CACHE_TIMEOUT);
while (!abort_loop && ! wake_thread && ! kill_cached_threads)
{
......
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