Fix a bug

This commit is contained in:
Raúl Marín 2024-01-24 21:03:46 +01:00
parent 5aa4abbe96
commit f9d218ec52
3 changed files with 8 additions and 1 deletions

View File

@ -400,7 +400,7 @@ void SingleValueDataFixed<T>::setGreatestNotNullIf(
if (index >= row_end)
return;
setIfSmaller(column, index, arena);
setIfGreater(column, index, arena);
for (size_t i = index + 1; i < row_end; i++)
if ((!if_map || if_map[i] != 0) && (!null_map || null_map[i] == 0))

View File

@ -194,3 +194,7 @@ SELECT min(n::Nullable(String)) from (Select if(number < 15 and number % 2 == 1,
22
SELECT max(n::Nullable(String)) from (Select if(number < 15 and number % 2 == 1, number * 2, NULL) as n from numbers(10, 20));
26
SELECT max(number::Nullable(Decimal64(3))) from numbers(11) settings max_block_size=10;
10
SELECT min(-number::Nullable(Decimal64(3))) from numbers(11) settings max_block_size=10;
-10

View File

@ -141,3 +141,6 @@ SELECT maxIf(number::Nullable(String), number < 10) as number from numbers(10, 1
SELECT min(n::Nullable(String)) from (Select if(number < 15 and number % 2 == 1, number * 2, NULL) as n from numbers(10, 20));
SELECT max(n::Nullable(String)) from (Select if(number < 15 and number % 2 == 1, number * 2, NULL) as n from numbers(10, 20));
SELECT max(number::Nullable(Decimal64(3))) from numbers(11) settings max_block_size=10;
SELECT min(-number::Nullable(Decimal64(3))) from numbers(11) settings max_block_size=10;