mirror of
https://github.com/MariaDB/server.git
synced 2026-05-01 04:35:32 +02:00
Fixed bug in SUM() with NULL:s
Added logging of warnings for failed connections with ssl. Fixed bug in symbolic link handling on Windows include/my_global.h: Added replication flags from 4.1 mysql-test/r/func_group.result: Added test for SUM(NULL) mysql-test/t/func_group.test: Added test for SUM(NULL) sql/item_sum.cc: Fixed bug in SUM() with NULL:s sql/item_sum.h: Fixed bug in SUM() with NULL:s sql/mysqld.cc: Added option --symbolic-links Fixed bug in symbolic link handling on Windows sql/net_serv.cc: Code cleanup sql/sql_acl.cc: Added logging of warnings for failed connections with ssl. sql/sql_show.cc: Changed to use HAVE_REPLICATION instead of EMBEDDED_LIBRARY
This commit is contained in:
parent
909596e030
commit
3ac05ea481
9 changed files with 112 additions and 27 deletions
|
|
@ -175,12 +175,14 @@ Item_sum_hybrid::fix_fields(THD *thd,TABLE_LIST *tables)
|
|||
|
||||
void Item_sum_sum::reset()
|
||||
{
|
||||
null_value=0; sum=0.0; Item_sum_sum::add();
|
||||
null_value=1; sum=0.0; Item_sum_sum::add();
|
||||
}
|
||||
|
||||
bool Item_sum_sum::add()
|
||||
{
|
||||
sum+=args[0]->val();
|
||||
if (!args[0]->null_value)
|
||||
null_value= 0;
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
@ -566,8 +568,10 @@ void Item_sum_sum::reset_field()
|
|||
{
|
||||
double nr=args[0]->val(); // Nulls also return 0
|
||||
float8store(result_field->ptr,nr);
|
||||
null_value=0;
|
||||
result_field->set_notnull();
|
||||
if (args[0]->null_value)
|
||||
result_field->set_null();
|
||||
else
|
||||
result_field->set_notnull();
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -623,7 +627,10 @@ void Item_sum_sum::update_field(int offset)
|
|||
float8get(old_nr,res+offset);
|
||||
nr=args[0]->val();
|
||||
if (!args[0]->null_value)
|
||||
{
|
||||
old_nr+=nr;
|
||||
result_field->set_notnull();
|
||||
}
|
||||
float8store(res,old_nr);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue