~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/optimizer/sum.cc

  • Committer: Monty Taylor
  • Date: 2011-02-12 21:49:59 UTC
  • mto: (2165.1.1 build)
  • mto: This revision was merged to the branch mainline in revision 2166.
  • Revision ID: mordred@inaugust.com-20110212214959-bve8sh4hu761y48m
Updated the windows build to be able to build from the command line and not to show warnings on strncpy.

Show diffs side-by-side

added added

removed removed

Lines of Context:
51
51
  (assuming a index for column d of table t2 is defined)
52
52
*/
53
53
 
54
 
#include <config.h>
55
 
 
56
 
#include <drizzled/sql_select.h>
57
 
#include <drizzled/item/sum.h>
58
 
#include <drizzled/item/cmpfunc.h>
59
 
#include <drizzled/optimizer/sum.h>
60
 
#include <drizzled/plugin/storage_engine.h>
61
 
#include <drizzled/table_list.h>
62
 
#include <drizzled/key.h>
 
54
#include "config.h"
 
55
#include "drizzled/sql_select.h"
 
56
#include "drizzled/item/sum.h"
 
57
#include "drizzled/item/cmpfunc.h"
 
58
#include "drizzled/optimizer/sum.h"
 
59
#include "drizzled/plugin/storage_engine.h"
63
60
 
64
61
namespace drizzled
65
62
{
114
111
 
115
112
int optimizer::sum_query(TableList *tables, List<Item> &all_fields, COND *conds)
116
113
{
117
 
  List<Item>::iterator it(all_fields.begin());
 
114
  List_iterator_fast<Item> it(all_fields);
118
115
  int const_result= 1;
119
116
  bool recalc_const_item= false;
120
117
  uint64_t count= 1;
266
263
                break;
267
264
              }
268
265
              error= table->cursor->startIndexScan(static_cast<uint32_t>(ref.key), 1);
269
 
              if (error)
270
 
              {
271
 
                if (table->key_read)
272
 
                {
273
 
                  table->key_read= 0;
274
 
                  table->cursor->extra(HA_EXTRA_NO_KEYREAD);
275
 
                }
276
 
                table->print_error(error, MYF(0));
277
 
                return error;
278
 
              }
279
266
 
280
267
              if (! ref.key_length)
281
268
              {
689
676
    }
690
677
 
691
678
    /* AND */
692
 
    List<Item>::iterator li(((Item_cond*) cond)->argument_list()->begin());
 
679
    List_iterator_fast<Item> li(*((Item_cond*) cond)->argument_list());
693
680
    Item *item;
694
681
    while ((item= li++))
695
682
    {
1071
1058
  /* If AND/OR condition */
1072
1059
  if (cond->type() == Item::COND_ITEM)
1073
1060
  {
1074
 
    List<Item>::iterator li(((Item_cond*) cond)->argument_list()->begin());
 
1061
    List_iterator_fast<Item> li(*((Item_cond*) cond)->argument_list());
1075
1062
    Item *item;
1076
1063
    while ((item= li++))
1077
1064
    {