1
0
mirror of https://github.com/mariadb-corporation/mariadb-columnstore-engine.git synced 2025-07-29 08:21:15 +03:00

fix(datatypes, funcexp): Overflow detection for MCOL-5568 use case (and some other) (#2987)

We add intermediate calculations in int128_t when target is UBIGINT and
check for overflow before converting into the UBIGINT. This is so
because we can overflow on addition and multiplication, with (some)
signed operands or both unsigned.
This commit is contained in:
Sergey Zefirov
2023-10-16 16:55:02 +03:00
committed by GitHub
parent 3fcb9b66f5
commit 84148cbe4c
4 changed files with 217 additions and 0 deletions

View File

@ -3656,6 +3656,7 @@ ArithmeticColumn* buildArithmeticColumn(Item_func* item, gp_walk_info& gwi, bool
if (rc)
lhs = new ParseTree(rc);
}
rhs = new ParseTree(buildReturnedColumn(sfitempp[1], gwi, nonSupport));
if (!rhs->data() && (sfitempp[1]->type() == Item::FUNC_ITEM))