~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/item/ref.cc

  • Committer: Brian Aker
  • Date: 2011-01-25 05:20:15 UTC
  • mto: (2109.1.6 drizzle-build)
  • mto: This revision was merged to the branch mainline in revision 2112.
  • Revision ID: brian@tangent.org-20110125052015-nw5jhmiq0at1qt9u
Merge in reference from pointer.

Show diffs side-by-side

added added

removed removed

Lines of Context:
247
247
                       cached_table->select_lex != outer_context->select_lex);
248
248
            }
249
249
            prev_subselect_item->used_tables_cache|= from_field->getTable()->map;
250
 
            prev_subselect_item->const_item_cache= 0;
 
250
            prev_subselect_item->const_item_cache= false;
251
251
            break;
252
252
          }
253
253
        }
255
255
 
256
256
        /* Reference is not found => depend on outer (or just error). */
257
257
        prev_subselect_item->used_tables_cache|= OUTER_REF_TABLE_BIT;
258
 
        prev_subselect_item->const_item_cache= 0;
 
258
        prev_subselect_item->const_item_cache= false;
259
259
 
260
260
        outer_context= outer_context->outer_context;
261
261
      } while (outer_context);
430
430
}
431
431
 
432
432
 
433
 
my_decimal *Item_ref::val_decimal_result(my_decimal *decimal_value)
 
433
type::Decimal *Item_ref::val_decimal_result(type::Decimal *decimal_value)
434
434
{
435
435
  if (result_field)
436
436
  {
454
454
 
455
455
    case DECIMAL_RESULT:
456
456
      {
457
 
        my_decimal decimal_value;
458
 
        my_decimal *val= result_field->val_decimal(&decimal_value);
 
457
        type::Decimal decimal_value;
 
458
        type::Decimal *val= result_field->val_decimal(&decimal_value);
459
459
        if (val)
460
 
          return !my_decimal_is_zero(val);
 
460
          return not val->is_zero();
461
461
        return 0;
462
462
      }
463
463
 
517
517
}
518
518
 
519
519
 
520
 
bool Item_ref::get_date(DRIZZLE_TIME *ltime,uint32_t fuzzydate)
 
520
bool Item_ref::get_date(type::Time &ltime,uint32_t fuzzydate)
521
521
{
522
522
  return (null_value=(*ref)->get_date_result(ltime,fuzzydate));
523
523
}
524
524
 
525
525
 
526
 
my_decimal *Item_ref::val_decimal(my_decimal *decimal_value)
 
526
type::Decimal *Item_ref::val_decimal(type::Decimal *decimal_value)
527
527
{
528
 
  my_decimal *val= (*ref)->val_decimal_result(decimal_value);
 
528
  type::Decimal *val= (*ref)->val_decimal_result(decimal_value);
529
529
  null_value= (*ref)->null_value;
530
530
  return val;
531
531
}