1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-29 05:21:33 +03:00

MDEV-21342 Assertion in set_ok_status() upon spatial field error on system-versioned table

SQL_SELECT::check_quick() returns error status only
test_quick_select() returns -1. Fix error handling when lower frames
throw error, but it is ignored by test_quick_select(). Fix return
status for out-of-memory errors which are obviously must be processed
as error in upper frames.
This commit is contained in:
Aleksey Midenkov
2020-04-02 20:48:38 +03:00
parent 9149017bb8
commit 44c6c7a923
3 changed files with 27 additions and 3 deletions

View File

@ -2386,7 +2386,7 @@ static int fill_used_fields_bitmap(PARAM *param)
force_quick_range is really needed.
RETURN
-1 if impossible select (i.e. certainly no rows will be selected)
-1 if error or impossible select (i.e. certainly no rows will be selected)
0 if can't use quick_select
1 if found usable ranges and quick select has been successfully created.
*/
@ -2473,7 +2473,7 @@ int SQL_SELECT::test_quick_select(THD *thd, key_map keys_to_use,
{
thd->no_errors=0;
free_root(&alloc,MYF(0)); // Return memory & allocator
DBUG_RETURN(0); // Can't use range
DBUG_RETURN(-1); // Error
}
key_parts= param.key_parts;
@ -2524,7 +2524,7 @@ int SQL_SELECT::test_quick_select(THD *thd, key_map keys_to_use,
{
thd->no_errors=0;
free_root(&alloc,MYF(0)); // Return memory & allocator
DBUG_RETURN(0); // Can't use range
DBUG_RETURN(-1); // Error
}
thd->mem_root= &alloc;
@ -2561,6 +2561,13 @@ int SQL_SELECT::test_quick_select(THD *thd, key_map keys_to_use,
if (tree->type != SEL_TREE::KEY && tree->type != SEL_TREE::KEY_SMALLER)
tree= NULL;
}
else if (thd->is_error())
{
thd->no_errors=0;
thd->mem_root= param.old_root;
free_root(&alloc, MYF(0));
DBUG_RETURN(-1);
}
}
/*