~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to server/item_cmpfunc.h

  • Committer: Brian Aker
  • Date: 2008-07-11 00:33:12 UTC
  • mfrom: (51.1.83 remove-dbug)
  • Revision ID: brian@tangent.org-20080711003312-f4sf5n2z3obor1u8
Comming Jay's merge

Show diffs side-by-side

added added

removed removed

Lines of Context:
232
232
  Item_in_optimizer(Item *a, Item_in_subselect *b):
233
233
    Item_bool_func(a, my_reinterpret_cast(Item *)(b)), cache(0),
234
234
    save_cache(0), result_for_null_param(UNKNOWN)
235
 
  { with_subselect= TRUE; }
 
235
  { with_subselect= true; }
236
236
  bool fix_fields(THD *, Item **);
237
237
  bool fix_left(THD *thd, Item **ref);
238
238
  bool is_null();
330
330
 
331
331
public:
332
332
  Item_bool_func2(Item *a,Item *b)
333
 
    :Item_int_func(a,b), cmp(tmp_arg, tmp_arg+1), abort_on_null(FALSE) {}
 
333
    :Item_int_func(a,b), cmp(tmp_arg, tmp_arg+1), abort_on_null(false) {}
334
334
  void fix_length_and_dec();
335
335
  void set_cmp_func()
336
336
  {
349
349
  bool is_bool_func() { return 1; }
350
350
  CHARSET_INFO *compare_collation() { return cmp.cmp_collation.collation; }
351
351
  uint decimal_precision() const { return 1; }
352
 
  void top_level_item() { abort_on_null= TRUE; }
 
352
  void top_level_item() { abort_on_null= true; }
353
353
 
354
354
  friend class  Arg_comparator;
355
355
};
364
364
  Item *neg_transformer(THD *thd);
365
365
  virtual Item *negated_item();
366
366
  bool subst_argument_checker(uchar **arg __attribute__((__unused__)))
367
 
  { return TRUE; }
 
367
  { return true; }
368
368
};
369
369
 
370
370
class Item_func_not :public Item_bool_func
417
417
  longlong val_int() { return *trig_var ? args[0]->val_int() : 1; }
418
418
  enum Functype functype() const { return TRIG_COND_FUNC; };
419
419
  const char *func_name() const { return "trigcond"; };
420
 
  bool const_item() const { return FALSE; }
 
420
  bool const_item() const { return false; }
421
421
  bool *get_trig_var() { return trig_var; }
422
422
  /* The following is needed for ICP: */
423
423
  table_map used_tables() const { return args[0]->used_tables(); }
582
582
  }
583
583
  bool eq(const Item *item, bool binary_cmp) const;
584
584
  bool subst_argument_checker(uchar **arg __attribute__((__unused__)))
585
 
  { return TRUE; }
 
585
  { return true; }
586
586
};
587
587
 
588
588
 
597
597
  /* Comparators used for DATE/DATETIME comparison. */
598
598
  Arg_comparator ge_cmp, le_cmp;
599
599
  Item_func_between(Item *a, Item *b, Item *c)
600
 
    :Item_func_opt_neg(a, b, c), compare_as_dates(FALSE) {}
 
600
    :Item_func_opt_neg(a, b, c), compare_as_dates(false) {}
601
601
  longlong val_int();
602
602
  optimize_type select_optimize() const { return OPTIMIZE_KEY; }
603
603
  enum Functype functype() const   { return BETWEEN; }
906
906
  uchar *get_value(Item *item);
907
907
  Item *create_item()
908
908
  { 
909
 
    return new Item_decimal(0, FALSE);
 
909
    return new Item_decimal(0, false);
910
910
  }
911
911
  void value_to_item(uint pos, Item *item)
912
912
  {
1204
1204
 
1205
1205
  Item_func_in(List<Item> &list)
1206
1206
    :Item_func_opt_neg(list), array(0), have_null(0),
1207
 
    arg_types_compatible(FALSE)
 
1207
    arg_types_compatible(false)
1208
1208
  {
1209
1209
    bzero(&cmp_items, sizeof(cmp_items));
1210
1210
    allowed_arg_cols= 0;  // Fetch this value from first argument
1381
1381
  int escape;
1382
1382
 
1383
1383
  Item_func_like(Item *a,Item *b, Item *escape_arg, bool escape_used)
1384
 
    :Item_bool_func2(a,b), canDoTurboBM(FALSE), pattern(0), pattern_len(0), 
 
1384
    :Item_bool_func2(a,b), canDoTurboBM(false), pattern(0), pattern_len(0), 
1385
1385
     bmGs(0), bmBc(0), escape_item(escape_arg),
1386
1386
     escape_used_in_parsing(escape_used) {}
1387
1387
  longlong val_int();
1438
1438
  void neg_arguments(THD *thd);
1439
1439
  enum_field_types field_type() const { return MYSQL_TYPE_LONGLONG; }
1440
1440
  bool subst_argument_checker(uchar **arg __attribute__((__unused__)))
1441
 
  { return TRUE; }
 
1441
  { return true; }
1442
1442
  Item *compile(Item_analyzer analyzer, uchar **arg_p,
1443
1443
                Item_transformer transformer, uchar *arg_t);
1444
1444
};
1616
1616
inline bool is_cond_and(Item *item)
1617
1617
{
1618
1618
  if (item->type() != Item::COND_ITEM)
1619
 
    return FALSE;
 
1619
    return false;
1620
1620
 
1621
1621
  Item_cond *cond_item= (Item_cond*) item;
1622
1622
  return (cond_item->functype() == Item_func::COND_AND_FUNC);
1646
1646
inline bool is_cond_or(Item *item)
1647
1647
{
1648
1648
  if (item->type() != Item::COND_ITEM)
1649
 
    return FALSE;
 
1649
    return false;
1650
1650
 
1651
1651
  Item_cond *cond_item= (Item_cond*) item;
1652
1652
  return (cond_item->functype() == Item_func::COND_OR_FUNC);