~ubuntu-branches/ubuntu/precise/mysql-5.1/precise

« back to all changes in this revision

Viewing changes to sql/item_sum.cc

  • Committer: Bazaar Package Importer
  • Author(s): Norbert Tretkowski
  • Date: 2010-05-11 18:47:32 UTC
  • mto: (2.1.2 sid) (1.2.1 upstream)
  • mto: This revision was merged to the branch mainline in revision 4.
  • Revision ID: james.westby@ubuntu.com-20100511184732-jhn055kfhxze24kt
Tags: upstream-5.1.46
ImportĀ upstreamĀ versionĀ 5.1.46

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/* Copyright (C) 2000-2003 MySQL AB
 
1
/* Copyright (c) 2000, 2010 Oracle and/or its affiliates. All rights reserved.
2
2
 
3
3
   This program is free software; you can redistribute it and/or modify
4
4
   it under the terms of the GNU General Public License as published by
647
647
  default:
648
648
    DBUG_ASSERT(0);
649
649
  };
650
 
  setup(args[0], NULL);
 
650
  setup_hybrid(args[0], NULL);
651
651
  /* MIN/MAX can return NULL for empty set indepedent of the used column */
652
652
  maybe_null= 1;
653
653
  unsigned_flag=item->unsigned_flag;
681
681
    of the original MIN/MAX object and it is saved in this object's cache.
682
682
*/
683
683
 
684
 
void Item_sum_hybrid::setup(Item *item, Item *value_arg)
 
684
void Item_sum_hybrid::setup_hybrid(Item *item, Item *value_arg)
685
685
{
686
686
  value= Item_cache::get_cache(item);
687
687
  value->setup(item);
1651
1651
Item *Item_sum_min::copy_or_same(THD* thd)
1652
1652
{
1653
1653
  Item_sum_min *item= new (thd->mem_root) Item_sum_min(thd, this);
1654
 
  item->setup(args[0], value);
 
1654
  item->setup_hybrid(args[0], value);
1655
1655
  return item;
1656
1656
}
1657
1657
 
1674
1674
Item *Item_sum_max::copy_or_same(THD* thd)
1675
1675
{
1676
1676
  Item_sum_max *item= new (thd->mem_root) Item_sum_max(thd, this);
1677
 
  item->setup(args[0], value);
 
1677
  item->setup_hybrid(args[0], value);
1678
1678
  return item;
1679
1679
}
1680
1680
 
3420
3420
    {
3421
3421
      if (i)
3422
3422
        str->append(',');
3423
 
      (*order[i]->item)->print(str, query_type);
 
3423
      pargs[i + arg_count_field]->print(str, query_type);
3424
3424
      if (order[i]->asc)
3425
3425
        str->append(STRING_WITH_LEN(" ASC"));
3426
3426
      else