Commit 35f81314 authored by Olivier Bertrand's avatar Olivier Bertrand

- Set tdbp to NULL when ignored

modified:
  storage/connect/ha_connect.cc
parent 5ac8c8be
......@@ -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 (tdbp) {
// 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)
if (xp->last_query_id == valid_query_id)
rc= CloseTable(g);
else
tdbp= NULL;
}// endif tdbp
xmod= newmode;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment