~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/item/field.cc

  • Committer: Brian Aker
  • Date: 2010-12-07 09:12:12 UTC
  • mto: This revision was merged to the branch mainline in revision 1985.
  • Revision ID: brian@tangent.org-20101207091212-1m0w20tck6z7632m
This is a fix for bug lp:686197

Show diffs side-by-side

added added

removed removed

Lines of Context:
111
111
{
112
112
  Table *table= (Table *) arg;
113
113
  if (field->getTable() == table || !table)
114
 
    field->getTable()->setReadSet(field->position());
 
114
    field->getTable()->setReadSet(field->field_index);
115
115
 
116
116
  return 0;
117
117
}
323
323
  switch (result_field->result_type()) {
324
324
  case INT_RESULT:
325
325
    return result_field->val_int() != 0;
326
 
 
327
326
  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
 
 
 
327
  {
 
328
    my_decimal decimal_value;
 
329
    my_decimal *val= result_field->val_decimal(&decimal_value);
 
330
    if (val)
 
331
      return !my_decimal_is_zero(val);
 
332
    return 0;
 
333
  }
336
334
  case REAL_RESULT:
337
335
  case STRING_RESULT:
338
336
    return result_field->val_real() != 0.0;
339
 
 
340
337
  case ROW_RESULT:
 
338
  default:
341
339
    assert(0);
342
340
    return 0;                                   // Shut up compiler
343
341
  }
344
 
 
345
 
  assert(0);
346
 
  return 0;                                   // Shut up compiler
347
342
}
348
343
 
349
344
 
907
902
      current_bitmap= table->write_set;
908
903
      other_bitmap=   table->read_set;
909
904
    }
910
 
    //if (! current_bitmap->testAndSet(field->position()))
911
 
    if (! current_bitmap->test(field->position()))
 
905
    //if (! current_bitmap->testAndSet(field->field_index))
 
906
    if (! current_bitmap->test(field->field_index))
912
907
    {
913
 
      if (! other_bitmap->test(field->position()))
 
908
      if (! other_bitmap->test(field->field_index))
914
909
      {
915
910
        /* First usage of column */
916
911
        table->used_fields++;                     // Used to optimize loops
1268
1263
  {
1269
1264
    char buff[MAX_FIELD_WIDTH];
1270
1265
    String tmp(buff,sizeof(buff),str->charset());
1271
 
    field->val_str_internal(&tmp);
 
1266
    field->val_str(&tmp);
1272
1267
    if (field->is_null())  {
1273
1268
      str->append("NULL");
1274
1269
    }