From 1ede6749fea62c8371af7e1808b4efa78deff68c Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 27 Aug 2003 10:26:03 +0300 Subject: 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 --- sql/item_sum.cc | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'sql/item_sum.cc') 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 &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; -- cgit v1.2.1