~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/item/sum.cc

  • Committer: Brian Aker
  • Date: 2009-11-12 16:13:04 UTC
  • mfrom: (1211.1.7 staging)
  • Revision ID: brian@gaz-20091112161304-opamiauv36fg0n6u
Rollup of Brian, Padraig, and Stewart patches.

Show diffs side-by-side

added added

removed removed

Lines of Context:
517
517
                               name, table->s, collation.collation);
518
518
    break;
519
519
  case DECIMAL_RESULT:
520
 
    field= new Field_new_decimal(max_length, maybe_null, name,
 
520
    field= new Field_decimal(max_length, maybe_null, name,
521
521
                                 decimals, unsigned_flag);
522
522
    break;
523
523
  case ROW_RESULT:
980
980
  case DECIMAL_RESULT:
981
981
    val.traits= Hybrid_type_traits_decimal::instance();
982
982
    if (table_field_type != DRIZZLE_TYPE_LONGLONG)
983
 
      table_field_type= DRIZZLE_TYPE_NEWDECIMAL;
 
983
      table_field_type= DRIZZLE_TYPE_DECIMAL;
984
984
    break;
985
985
  case ROW_RESULT:
986
986
  default:
1259
1259
                               0, name, table->s, &my_charset_bin);
1260
1260
  }
1261
1261
  else if (hybrid_type == DECIMAL_RESULT)
1262
 
    field= new Field_new_decimal(max_length, maybe_null, name,
1263
 
                                 decimals, unsigned_flag);
 
1262
    field= new Field_decimal(max_length, maybe_null, name,
 
1263
                             decimals, unsigned_flag);
1264
1264
  else
1265
1265
    field= new Field_double(max_length, maybe_null, name, decimals, true);
1266
1266
  if (field)
2614
2614
                                (select_lex->options | session->options),
2615
2615
                                HA_POS_ERROR, (char*)"")))
2616
2616
    return true;
2617
 
  table->file->extra(HA_EXTRA_NO_ROWS);         // Don't update rows
 
2617
  table->cursor->extra(HA_EXTRA_NO_ROWS);               // Don't update rows
2618
2618
  table->no_rows=1;
2619
2619
 
2620
2620
  if (table->s->db_type() == heap_engine)
2706
2706
  }
2707
2707
  else if (table)
2708
2708
  {
2709
 
    table->file->extra(HA_EXTRA_NO_CACHE);
2710
 
    table->file->ha_delete_all_rows();
2711
 
    table->file->extra(HA_EXTRA_WRITE_CACHE);
 
2709
    table->cursor->extra(HA_EXTRA_NO_CACHE);
 
2710
    table->cursor->ha_delete_all_rows();
 
2711
    table->cursor->extra(HA_EXTRA_WRITE_CACHE);
2712
2712
  }
2713
2713
}
2714
2714
 
2735
2735
    */
2736
2736
    return tree->unique_add(table->record[0] + table->s->null_bytes);
2737
2737
  }
2738
 
  if ((error= table->file->ha_write_row(table->record[0])) &&
2739
 
      table->file->is_fatal_error(error, HA_CHECK_DUP))
 
2738
  if ((error= table->cursor->ha_write_row(table->record[0])) &&
 
2739
      table->cursor->is_fatal_error(error, HA_CHECK_DUP))
2740
2740
    return true;
2741
2741
  return false;
2742
2742
}
2761
2761
    return (int64_t) count;
2762
2762
  }
2763
2763
 
2764
 
  error= table->file->info(HA_STATUS_VARIABLE | HA_STATUS_NO_LOCK);
 
2764
  error= table->cursor->info(HA_STATUS_VARIABLE | HA_STATUS_NO_LOCK);
2765
2765
 
2766
2766
  if(error)
2767
2767
  {
2768
 
    table->file->print_error(error, MYF(0));
 
2768
    table->cursor->print_error(error, MYF(0));
2769
2769
  }
2770
2770
 
2771
 
  return table->file->stats.records;
 
2771
  return table->cursor->stats.records;
2772
2772
}
2773
2773
 
2774
2774
/*****************************************************************************
3268
3268
                                (select_lex->options | session->options),
3269
3269
                                HA_POS_ERROR, (char*) "")))
3270
3270
    return(true);
3271
 
  table->file->extra(HA_EXTRA_NO_ROWS);
 
3271
  table->cursor->extra(HA_EXTRA_NO_ROWS);
3272
3272
  table->no_rows= 1;
3273
3273
 
3274
3274
  /*