mirror of
https://github.com/MariaDB/server.git
synced 2025-08-08 11:22:35 +03:00
MDEV-30710 Incorrect operator when comparing large unsigned integers.
When constructing a SEL_TREE, an unsigned integer greater than its signed equivalent caused an incorrect comparison operator to be chosen.
This commit is contained in:
@@ -8995,7 +8995,8 @@ SEL_ARG *Field::stored_field_make_mm_leaf_bounded_int(RANGE_OPT_PARAM *param,
|
||||
DBUG_RETURN(new (param->mem_root) SEL_ARG_IMPOSSIBLE(this));
|
||||
longlong item_val= value->val_int();
|
||||
|
||||
if (op == SCALAR_CMP_LT && item_val > 0)
|
||||
if (op == SCALAR_CMP_LT && ((item_val > 0)
|
||||
|| (value->unsigned_flag && (ulonglong)item_val > 0 )))
|
||||
op= SCALAR_CMP_LE; // e.g. rewrite (tinyint < 200) to (tinyint <= 127)
|
||||
else if (op == SCALAR_CMP_GT && !unsigned_field &&
|
||||
!value->unsigned_flag && item_val < 0)
|
||||
|
Reference in New Issue
Block a user