mirror of
https://github.com/MariaDB/server.git
synced 2025-01-19 05:22:25 +01:00
Bug #29252 Assertion 'table->file || table->file->inited == handler::NONE' failed
when index_init() or rnd_init() return an error, we still set handler->inited to INDEX or RND in ha_index_init and ha_rnd_init. As caller doesn't call ha_*_end() in this case, we get DBUG_ASSERT failed.
This commit is contained in:
parent
38991f3e80
commit
0a4b46be90
1 changed files with 7 additions and 4 deletions
|
@ -1097,10 +1097,12 @@ public:
|
|||
|
||||
int ha_index_init(uint idx, bool sorted)
|
||||
{
|
||||
int result;
|
||||
DBUG_ENTER("ha_index_init");
|
||||
DBUG_ASSERT(inited==NONE);
|
||||
inited=INDEX;
|
||||
DBUG_RETURN(index_init(idx, sorted));
|
||||
if (!(result= index_init(idx, sorted)))
|
||||
inited=INDEX;
|
||||
DBUG_RETURN(result);
|
||||
}
|
||||
int ha_index_end()
|
||||
{
|
||||
|
@ -1111,10 +1113,11 @@ public:
|
|||
}
|
||||
int ha_rnd_init(bool scan)
|
||||
{
|
||||
int result;
|
||||
DBUG_ENTER("ha_rnd_init");
|
||||
DBUG_ASSERT(inited==NONE || (inited==RND && scan));
|
||||
inited=RND;
|
||||
DBUG_RETURN(rnd_init(scan));
|
||||
inited= (result= rnd_init(scan)) ? NONE: RND;
|
||||
DBUG_RETURN(result);
|
||||
}
|
||||
int ha_rnd_end()
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue