| Bug #176 | Mixing aliases and aggregate functions in GROUP BY results in empty set | ||
|---|---|---|---|
| Submitted: | 21 Mar 2003 11:32 | Modified: | 24 Mar 2003 12:57 |
| Reporter: | Alexander Keremidarski | Email Updates: | |
| Status: | Closed | Impact on me: | |
| Category: | MySQL Server | Severity: | S3 (Non-critical) |
| Version: | all | OS: | Any |
| Assigned to: | CPU Architecture: | Any | |
[21 Mar 2003 11:32]
Alexander Keremidarski
[22 Mar 2003 11:59]
MySQL Verification Team
===== sql/item_func.cc 1.90 vs edited =====
*** /tmp/item_func.cc-1.90-27748 Wed Mar 19 17:46:31 2003
--- edited/sql/item_func.cc Sat Mar 22 21:38:53 2003
***************
*** 70,84 ****
{ // Print purify happy
for (arg=args, arg_end=args+arg_count; arg != arg_end ; arg++)
{
! if ((*arg)->fix_fields(thd,tables))
return 1; /* purecov: inspected */
! if ((*arg)->maybe_null)
maybe_null=1;
! if ((*arg)->binary)
binary=1;
! with_sum_func= with_sum_func || (*arg)->with_sum_func;
! used_tables_cache|=(*arg)->used_tables();
! const_item_cache&= (*arg)->const_item();
}
}
fix_length_and_dec();
--- 70,87 ----
{ // Print purify happy
for (arg=args, arg_end=args+arg_count; arg != arg_end ; arg++)
{
! Item *item=*arg;
! if (item->fix_fields(thd,tables))
return 1; /* purecov: inspected */
! if (item->type() == Item::REF_ITEM)
! item=*((Item_ref *)item)->ref;
! if (item->maybe_null)
maybe_null=1;
! if (item->binary)
binary=1;
! with_sum_func= with_sum_func || item->with_sum_func;
! used_tables_cache|=item->used_tables();
! const_item_cache&= item->const_item();
}
}
fix_length_and_dec();
[24 Mar 2003 12:57]
MySQL Verification Team
Closed with bug fix corrected by Monty. Fix will come in 4.0.13
