diff options
Diffstat (limited to 'sql/item_sum.cc')
-rw-r--r-- | sql/item_sum.cc | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/sql/item_sum.cc b/sql/item_sum.cc index d2fd0c4b0eb..e38e1d237b6 100644 --- a/sql/item_sum.cc +++ b/sql/item_sum.cc @@ -500,7 +500,7 @@ Field *Item_sum::create_tmp_field(bool group, TABLE *table, field= Field_new_decimal::create_from_item(this); break; case ROW_RESULT: - default: + case TIME_RESULT: // This case should never be choosen DBUG_ASSERT(0); return 0; @@ -624,7 +624,7 @@ Item_sum_hybrid::fix_fields(THD *thd, Item **ref) max_length= item->max_length; break; case ROW_RESULT: - default: + case TIME_RESULT: DBUG_ASSERT(0); }; setup_hybrid(args[0], NULL); @@ -761,13 +761,14 @@ void Item_sum_sum::fix_length_and_dec() DBUG_ENTER("Item_sum_sum::fix_length_and_dec"); maybe_null=null_value=1; decimals= args[0]->decimals; - switch (args[0]->result_type()) { + switch (args[0]->cast_to_int_type()) { case REAL_RESULT: case STRING_RESULT: hybrid_type= REAL_RESULT; sum= 0.0; break; case INT_RESULT: + case TIME_RESULT: case DECIMAL_RESULT: { /* SUM result can't be longer than length(arg) + length(MAX_ROWS) */ @@ -781,7 +782,6 @@ void Item_sum_sum::fix_length_and_dec() break; } case ROW_RESULT: - default: DBUG_ASSERT(0); } DBUG_PRINT("info", ("Type: %s (%d, %d)", @@ -970,7 +970,7 @@ void Item_sum_distinct::fix_length_and_dec() table_field_type= MYSQL_TYPE_NEWDECIMAL; break; case ROW_RESULT: - default: + case TIME_RESULT: DBUG_ASSERT(0); } val.traits->fix_length_and_dec(this, args[0]); @@ -1421,7 +1421,7 @@ void Item_sum_variance::fix_length_and_dec() break; } case ROW_RESULT: - default: + case TIME_RESULT: DBUG_ASSERT(0); } DBUG_PRINT("info", ("Type: REAL_RESULT (%d, %d)", max_length, (int)decimals)); @@ -1832,7 +1832,7 @@ void Item_sum_hybrid::reset_field() break; } case ROW_RESULT: - default: + case TIME_RESULT: DBUG_ASSERT(0); } } |