- Set tdbp to NULL when ignored

modified:
  storage/connect/ha_connect.cc
This commit is contained in:
Olivier Bertrand 2013-05-13 10:37:35 +02:00
parent 5ac8c8bea6
commit 35f813143b

View file

@ -3014,10 +3014,15 @@ int ha_connect::external_lock(THD *thd, int lock_type)
// This can NOT be called without open called first, but
// the table can have been closed since then
} else if (!tdbp || xp->CheckQuery(valid_query_id) || xmod != newmode) {
// If this is called by a later query, the table may have
// been already closed and the tdbp is not valid anymore.
if (tdbp && xp->last_query_id == valid_query_id)
rc= CloseTable(g);
if (tdbp) {
// If this is called by a later query, the table may have
// been already closed and the tdbp is not valid anymore.
if (xp->last_query_id == valid_query_id)
rc= CloseTable(g);
else
tdbp= NULL;
}// endif tdbp
xmod= newmode;