~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/item/ref.cc

  • Committer: Monty Taylor
  • Date: 2010-06-02 22:35:45 UTC
  • mto: This revision was merged to the branch mainline in revision 1586.
  • Revision ID: mordred@inaugust.com-20100602223545-q8ekf9b40a85nwuf
Rearragned unittests into a single exe because of how we need to link it
(thanks lifeless)
Link with server symbols without needing to build a library.
Added an additional atomics test which tests whatever version of the atomics
lib the running platform would actually use.

Show diffs side-by-side

added added

removed removed

Lines of Context:
184
184
          condition, so that we can give a better error message -
185
185
          ER_WRONG_FIELD_WITH_GROUP, instead of the less informative
186
186
          ER_BAD_FIELD_ERROR which we produce now.
187
 
 
188
 
          @todo determine if this is valid.
189
187
        */
190
188
        if ((place != IN_HAVING ||
191
189
             (!select->with_sum_func &&
246
244
              } while (outer_context && outer_context->select_lex &&
247
245
                       cached_table->select_lex != outer_context->select_lex);
248
246
            }
249
 
            prev_subselect_item->used_tables_cache|= from_field->getTable()->map;
 
247
            prev_subselect_item->used_tables_cache|= from_field->table->map;
250
248
            prev_subselect_item->const_item_cache= 0;
251
249
            break;
252
250
          }
451
449
    switch (result_field->result_type()) {
452
450
    case INT_RESULT:
453
451
      return result_field->val_int() != 0;
454
 
 
455
452
    case DECIMAL_RESULT:
456
 
      {
457
 
        my_decimal decimal_value;
458
 
        my_decimal *val= result_field->val_decimal(&decimal_value);
459
 
        if (val)
460
 
          return !my_decimal_is_zero(val);
461
 
        return 0;
462
 
      }
463
 
 
 
453
    {
 
454
      my_decimal decimal_value;
 
455
      my_decimal *val= result_field->val_decimal(&decimal_value);
 
456
      if (val)
 
457
        return !my_decimal_is_zero(val);
 
458
      return 0;
 
459
    }
464
460
    case REAL_RESULT:
465
461
    case STRING_RESULT:
466
462
      return result_field->val_real() != 0.0;
467
 
 
468
463
    case ROW_RESULT:
 
464
    default:
469
465
      assert(0);
470
466
    }
471
467
  }
472
 
 
473
468
  return val_bool();
474
469
}
475
470