~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/item/field.cc

  • Committer: Monty Taylor
  • Date: 2010-08-21 02:55:13 UTC
  • mfrom: (1711.6.12 staging)
  • Revision ID: mordred@inaugust.com-20100821025513-3xyidjf8dodeh4gy
Remove btree heap index.

Show diffs side-by-side

added added

removed removed

Lines of Context:
30
30
#include <drizzled/item/outer_ref.h>
31
31
#include <drizzled/plugin/client.h>
32
32
 
33
 
#include <boost/dynamic_bitset.hpp>
34
 
 
35
33
namespace drizzled
36
34
{
37
35
 
111
109
{
112
110
  Table *table= (Table *) arg;
113
111
  if (field->getTable() == table || !table)
114
 
    field->getTable()->setReadSet(field->position());
 
112
    field->getTable()->setReadSet(field->field_index);
115
113
 
116
114
  return 0;
117
115
}
323
321
  switch (result_field->result_type()) {
324
322
  case INT_RESULT:
325
323
    return result_field->val_int() != 0;
326
 
 
327
324
  case DECIMAL_RESULT:
328
 
    {
329
 
      my_decimal decimal_value;
330
 
      my_decimal *val= result_field->val_decimal(&decimal_value);
331
 
      if (val)
332
 
        return !my_decimal_is_zero(val);
333
 
      return 0;
334
 
    }
335
 
 
 
325
  {
 
326
    my_decimal decimal_value;
 
327
    my_decimal *val= result_field->val_decimal(&decimal_value);
 
328
    if (val)
 
329
      return !my_decimal_is_zero(val);
 
330
    return 0;
 
331
  }
336
332
  case REAL_RESULT:
337
333
  case STRING_RESULT:
338
334
    return result_field->val_real() != 0.0;
339
 
 
340
335
  case ROW_RESULT:
 
336
  default:
341
337
    assert(0);
342
338
    return 0;                                   // Shut up compiler
343
339
  }
344
 
 
345
 
  assert(0);
346
 
  return 0;                                   // Shut up compiler
347
340
}
348
341
 
349
342
 
704
697
    {
705
698
      Item_ref *rf;
706
699
      rf= new Item_ref(context,
707
 
                       (cached_table->getSchemaName()[0] ? cached_table->getSchemaName() : 0),
 
700
                       (cached_table->db[0] ? cached_table->db : 0),
708
701
                       (char*) cached_table->alias, (char*) field_name);
709
702
      if (!rf)
710
703
        return -1;
896
889
  else if (session->mark_used_columns != MARK_COLUMNS_NONE)
897
890
  {
898
891
    Table *table= field->getTable();
899
 
    boost::dynamic_bitset<> *current_bitmap, *other_bitmap;
 
892
    MyBitmap *current_bitmap, *other_bitmap;
900
893
    if (session->mark_used_columns == MARK_COLUMNS_READ)
901
894
    {
902
895
      current_bitmap= table->read_set;
907
900
      current_bitmap= table->write_set;
908
901
      other_bitmap=   table->read_set;
909
902
    }
910
 
    //if (! current_bitmap->testAndSet(field->position()))
911
 
    if (! current_bitmap->test(field->position()))
 
903
    if (! current_bitmap->testAndSet(field->field_index))
912
904
    {
913
 
      if (! other_bitmap->test(field->position()))
 
905
      if (! other_bitmap->isBitSet(field->field_index))
914
906
      {
915
907
        /* First usage of column */
916
908
        table->used_fields++;                     // Used to optimize loops
1268
1260
  {
1269
1261
    char buff[MAX_FIELD_WIDTH];
1270
1262
    String tmp(buff,sizeof(buff),str->charset());
1271
 
    field->val_str_internal(&tmp);
 
1263
    field->val_str(&tmp);
1272
1264
    if (field->is_null())  {
1273
1265
      str->append("NULL");
1274
1266
    }