mirror of
https://github.com/MariaDB/server.git
synced 2026-05-14 19:07:15 +02:00
MDEV-9550 COUNT(NULL) returns incorrect result with sequence storage engine
when calculating COUNT(basic_const), take into account that this basic_const may be NULL
This commit is contained in:
parent
9214d043fd
commit
e6d51aac77
3 changed files with 18 additions and 3 deletions
|
|
@ -452,7 +452,11 @@ int ha_seq_group_by_handler::next_row()
|
|||
switch (item_sum->sum_func()) {
|
||||
case Item_sum::COUNT_FUNC:
|
||||
{
|
||||
field->store((longlong) elements, 1);
|
||||
Item *arg0= ((Item_sum*) item_sum)->get_arg(0);
|
||||
if (arg0->basic_const_item() && arg0->is_null())
|
||||
field->store(0LL, 1);
|
||||
else
|
||||
field->store((longlong) elements, 1);
|
||||
break;
|
||||
}
|
||||
case Item_sum::SUM_FUNC:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue