mirror of
https://github.com/MariaDB/server.git
synced 2025-01-18 04:53:01 +01:00
Fix for BUG#8003 attempt 2:
Call file->external_lock() for handler objects that index_merge code creates in addition to the handler object opened in open_and_lock_tables.
This commit is contained in:
parent
013a6f50c2
commit
3822eeb972
1 changed files with 5 additions and 0 deletions
|
@ -778,6 +778,7 @@ QUICK_RANGE_SELECT::~QUICK_RANGE_SELECT()
|
||||||
DBUG_PRINT("info", ("Freeing separate handler %p (free=%d)", file,
|
DBUG_PRINT("info", ("Freeing separate handler %p (free=%d)", file,
|
||||||
free_file));
|
free_file));
|
||||||
file->reset();
|
file->reset();
|
||||||
|
file->external_lock(current_thd, F_UNLCK);
|
||||||
file->close();
|
file->close();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -929,6 +930,7 @@ int QUICK_RANGE_SELECT::init_ror_merged_scan(bool reuse_handler)
|
||||||
DBUG_RETURN(0);
|
DBUG_RETURN(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
THD *thd= current_thd;
|
||||||
if (!(file= get_new_handler(head, head->s->db_type)))
|
if (!(file= get_new_handler(head, head->s->db_type)))
|
||||||
goto failure;
|
goto failure;
|
||||||
DBUG_PRINT("info", ("Allocated new handler %p", file));
|
DBUG_PRINT("info", ("Allocated new handler %p", file));
|
||||||
|
@ -937,11 +939,14 @@ int QUICK_RANGE_SELECT::init_ror_merged_scan(bool reuse_handler)
|
||||||
/* Caller will free the memory */
|
/* Caller will free the memory */
|
||||||
goto failure;
|
goto failure;
|
||||||
}
|
}
|
||||||
|
if (file->external_lock(thd, F_RDLCK))
|
||||||
|
goto failure;
|
||||||
|
|
||||||
if (file->extra(HA_EXTRA_KEYREAD) ||
|
if (file->extra(HA_EXTRA_KEYREAD) ||
|
||||||
file->extra(HA_EXTRA_RETRIEVE_PRIMARY_KEY) ||
|
file->extra(HA_EXTRA_RETRIEVE_PRIMARY_KEY) ||
|
||||||
init() || reset())
|
init() || reset())
|
||||||
{
|
{
|
||||||
|
file->external_lock(thd, F_UNLCK);
|
||||||
file->close();
|
file->close();
|
||||||
goto failure;
|
goto failure;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue