summaryrefslogtreecommitdiff
path: root/sql/item_sum.cc
diff options
context:
space:
mode:
authorunknown <monty@narttu.mysql.fi>2003-08-27 10:26:03 +0300
committerunknown <monty@narttu.mysql.fi>2003-08-27 10:26:03 +0300
commitb43a551e83c20dc647a56036ad76811bb09a4945 (patch)
treed63c2fba98c94c1cc7e1a75b21591e555059d9a1 /sql/item_sum.cc
parent522a32203a1e9f4cd6ee8c3d052a04ac3cd2507a (diff)
downloadmariadb-git-b43a551e83c20dc647a56036ad76811bb09a4945.tar.gz
Add column names for metadata when running mysql with -T
Change metadata info so that that MIN() and code MAX() reports that they can return NULL. Bug #324 client/mysql.cc: Add column names for metadata when running with -T mysql-test/r/show_check.result: test case for bug fix mysql-test/t/show_check.test: test case for bug fix sql/item_sum.cc: Change metadata info so that that MIN() and code MAX() reports that they can return NULL. Bug #324 sql/sql_load.cc: Removed not needed line
Diffstat (limited to 'sql/item_sum.cc')
-rw-r--r--sql/item_sum.cc7
1 files changed, 6 insertions, 1 deletions
diff --git a/sql/item_sum.cc b/sql/item_sum.cc
index 08385bb9ca6..835278ae262 100644
--- a/sql/item_sum.cc
+++ b/sql/item_sum.cc
@@ -46,7 +46,11 @@ Item_sum::Item_sum(List<Item> &list)
void Item_sum::make_field(Send_field *tmp_field)
{
if (args[0]->type() == Item::FIELD_ITEM && keep_field_type())
+ {
((Item_field*) args[0])->field->make_field(tmp_field);
+ if (maybe_null)
+ tmp_field->flags&= ~NOT_NULL_FLAG;
+ }
else
{
tmp_field->flags=0;
@@ -158,7 +162,8 @@ Item_sum_hybrid::fix_fields(THD *thd,TABLE_LIST *tables)
else
max_length=item->max_length;
decimals=item->decimals;
- maybe_null=item->maybe_null;
+ /* MIN/MAX can return NULL for empty set indepedent of the used column */
+ maybe_null= 1;
binary=item->binary;
unsigned_flag=item->unsigned_flag;
result_field=0;