1
0
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:
heikki@hundin.mysql.fi
2003-03-03 19:31:01 +02:00
parent 177f584f90
commit 6ef0f4ad41
5 changed files with 61 additions and 0 deletions

View File

@ -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)
{