mirror of
https://github.com/MariaDB/server.git
synced 2025-07-25 01:22:45 +00:00
MDEV-21195 INSERT chooses wrong partition for RANGE partitioning by DECIMAL column
Use FLOOR rounding for DECIMAL_RESULT item_expr in partition function.
This commit is contained in:
@ -345,12 +345,12 @@ void my_decimal_trim(ulonglong *precision, uint *scale)
|
||||
*/
|
||||
|
||||
int my_decimal2int(uint mask, const decimal_t *d, bool unsigned_flag,
|
||||
longlong *l)
|
||||
longlong *l, decimal_round_mode round_type)
|
||||
{
|
||||
int res;
|
||||
my_decimal rounded;
|
||||
/* decimal_round can return only E_DEC_TRUNCATED */
|
||||
decimal_round(d, &rounded, 0, HALF_UP);
|
||||
decimal_round(d, &rounded, 0, round_type);
|
||||
res= (unsigned_flag ?
|
||||
decimal2ulonglong(&rounded, (ulonglong *) l) :
|
||||
decimal2longlong(&rounded, l));
|
||||
|
Reference in New Issue
Block a user