mirror of
https://github.com/MariaDB/server.git
synced 2025-07-30 16:24:05 +03:00
MDEV-21341: Fix UBSAN failures, part 8: fix error in compare_fields_by_table_order
Dont assign Item_field variables to point to Item_string objects (even if we don't make any dangerous calls for them).
This commit is contained in:
@ -13669,12 +13669,16 @@ static int compare_fields_by_table_order(Item *field1,
|
|||||||
{
|
{
|
||||||
int cmp= 0;
|
int cmp= 0;
|
||||||
bool outer_ref= 0;
|
bool outer_ref= 0;
|
||||||
Item_field *f1= (Item_field *) (field1->real_item());
|
Item *field1_real= field1->real_item();
|
||||||
Item_field *f2= (Item_field *) (field2->real_item());
|
Item *field2_real= field2->real_item();
|
||||||
if (field1->const_item() || f1->const_item())
|
|
||||||
|
if (field1->const_item() || field1_real->const_item())
|
||||||
return 1;
|
return 1;
|
||||||
if (field2->const_item() || f2->const_item())
|
if (field2->const_item() || field2_real->const_item())
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
|
Item_field *f1= (Item_field *) field1_real;
|
||||||
|
Item_field *f2= (Item_field *) field2_real;
|
||||||
if (f2->used_tables() & OUTER_REF_TABLE_BIT)
|
if (f2->used_tables() & OUTER_REF_TABLE_BIT)
|
||||||
{
|
{
|
||||||
outer_ref= 1;
|
outer_ref= 1;
|
||||||
|
Reference in New Issue
Block a user