mirror of
https://github.com/MariaDB/server.git
synced 2025-08-08 11:22:35 +03:00
Merge mysql.com:/home/ram/work/mysql-5.0-maint
into mysql.com:/home/ram/work/b21976/my50-b21976
This commit is contained in:
@@ -1050,14 +1050,8 @@ void Item_sum_count::clear()
|
||||
|
||||
bool Item_sum_count::add()
|
||||
{
|
||||
if (!args[0]->maybe_null)
|
||||
if (!args[0]->maybe_null || !args[0]->is_null())
|
||||
count++;
|
||||
else
|
||||
{
|
||||
args[0]->update_null_value();
|
||||
if (!args[0]->null_value)
|
||||
count++;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -1890,14 +1884,8 @@ void Item_sum_count::reset_field()
|
||||
char *res=result_field->ptr;
|
||||
longlong nr=0;
|
||||
|
||||
if (!args[0]->maybe_null)
|
||||
if (!args[0]->maybe_null || !args[0]->is_null())
|
||||
nr=1;
|
||||
else
|
||||
{
|
||||
args[0]->update_null_value();
|
||||
if (!args[0]->null_value)
|
||||
nr=1;
|
||||
}
|
||||
int8store(res,nr);
|
||||
}
|
||||
|
||||
@@ -2000,14 +1988,8 @@ void Item_sum_count::update_field()
|
||||
char *res=result_field->ptr;
|
||||
|
||||
nr=sint8korr(res);
|
||||
if (!args[0]->maybe_null)
|
||||
if (!args[0]->maybe_null || !args[0]->is_null())
|
||||
nr++;
|
||||
else
|
||||
{
|
||||
args[0]->update_null_value();
|
||||
if (!args[0]->null_value)
|
||||
nr++;
|
||||
}
|
||||
int8store(res,nr);
|
||||
}
|
||||
|
||||
@@ -2431,12 +2413,8 @@ bool Item_sum_count_distinct::setup(THD *thd)
|
||||
Item *item=args[i];
|
||||
if (list.push_back(item))
|
||||
return TRUE; // End of memory
|
||||
if (item->const_item())
|
||||
{
|
||||
item->update_null_value();
|
||||
if (item->null_value)
|
||||
always_null=1;
|
||||
}
|
||||
if (item->const_item() && item->is_null())
|
||||
always_null= 1;
|
||||
}
|
||||
if (always_null)
|
||||
return FALSE;
|
||||
|
Reference in New Issue
Block a user