diff options
author | Gleb Shchepa <gshchepa@mysql.com> | 2009-07-24 20:58:58 +0500 |
---|---|---|
committer | Gleb Shchepa <gshchepa@mysql.com> | 2009-07-24 20:58:58 +0500 |
commit | 6aea4cebfc2eb6d39ccfe4f7fc53ac0dd1fc9ac5 (patch) | |
tree | 09d21c8df0aaa2410de0d4420236458edc9d4022 /sql/sp_head.cc | |
parent | ec7ea4454102db998c5477624f576308e52d9f3d (diff) | |
download | mariadb-git-6aea4cebfc2eb6d39ccfe4f7fc53ac0dd1fc9ac5.tar.gz |
Bug #38816: kill + flush tables with read lock + stored
procedures causes crashes!
The problem of that bugreport was mostly fixed by the
patch for bug 38691.
However, attached test case focused on another crash or
valgrind warning problem: SHOW PROCESSLIST query accesses
freed memory of SP instruction that run in a parallel
connection.
Changes of thd->query/thd->query_length in dangerous
places have been guarded with the per-thread
LOCK_thd_data mutex (the THD::LOCK_delete mutex has been
renamed to THD::LOCK_thd_data).
Diffstat (limited to 'sql/sp_head.cc')
-rw-r--r-- | sql/sp_head.cc | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/sql/sp_head.cc b/sql/sp_head.cc index 240948d217c..e32dd75486b 100644 --- a/sql/sp_head.cc +++ b/sql/sp_head.cc @@ -949,8 +949,7 @@ subst_spvars(THD *thd, sp_instr *instr, LEX_STRING *query_str) else DBUG_RETURN(TRUE); - thd->query= pbuf; - thd->query_length= qbuf.length(); + thd->set_query(pbuf, qbuf.length()); DBUG_RETURN(FALSE); } @@ -2654,8 +2653,7 @@ sp_instr_stmt::execute(THD *thd, uint *nextp) } else *nextp= m_ip+1; - thd->query= query; - thd->query_length= query_length; + thd->set_query(query, query_length); thd->query_name_consts= 0; } DBUG_RETURN(res); |