mirror of
https://github.com/MariaDB/server.git
synced 2025-07-30 16:24:05 +03:00
ha_innodb.h, ha_innodb.cc, handler.h, handler.cc, sql_class.cc:
Fix a hang on the adaptive hash S-latch if an application program uses mysql_use_result() and performs queries on two connections at the same time
This commit is contained in:
@ -463,6 +463,14 @@ bool select_send::send_data(List<Item> &items)
|
||||
String *packet= &thd->packet;
|
||||
DBUG_ENTER("send_data");
|
||||
|
||||
#ifdef HAVE_INNOBASE_DB
|
||||
/* We may be passing the control from mysqld to the client: release the
|
||||
InnoDB adaptive hash S-latch to avoid thread deadlocks if it was reserved
|
||||
by thd */
|
||||
if (thd->transaction.all.innobase_tid)
|
||||
ha_release_temporary_latches(thd);
|
||||
#endif
|
||||
|
||||
if (thd->offset_limit)
|
||||
{ // using limit offset,count
|
||||
thd->offset_limit--;
|
||||
@ -486,6 +494,14 @@ bool select_send::send_data(List<Item> &items)
|
||||
|
||||
bool select_send::send_eof()
|
||||
{
|
||||
#ifdef HAVE_INNOBASE_DB
|
||||
/* We may be passing the control from mysqld to the client: release the
|
||||
InnoDB adaptive hash S-latch to avoid thread deadlocks if it was reserved
|
||||
by thd */
|
||||
if (thd->transaction.all.innobase_tid)
|
||||
ha_release_temporary_latches(thd);
|
||||
#endif
|
||||
|
||||
/* Unlock tables before sending packet to gain some speed */
|
||||
if (thd->lock)
|
||||
{
|
||||
|
Reference in New Issue
Block a user