Skip to content
Permalink
Browse files
MDEV-14581 Warning info not cleared when caching THD
In thread caching code, clear THD's warnings before reuse.
  • Loading branch information
vaintroub committed Mar 12, 2018
1 parent 5511e8e commit 248e5d0
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 1 deletion.
@@ -1 +1 @@
--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)
{

0 comments on commit 248e5d0

Please sign in to comment.