~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to sql/item_timefunc.h

Removed DBUG symbols and fixed TRUE/FALSE

Show diffs side-by-side

added added

removed removed

Lines of Context:
93
93
  Item_func_month(Item *a) :Item_func(a) {}
94
94
  longlong val_int();
95
95
  double val_real()
96
 
  { DBUG_ASSERT(fixed == 1); return (double) Item_func_month::val_int(); }
 
96
  { assert(fixed == 1); return (double) Item_func_month::val_int(); }
97
97
  String *val_str(String *str) 
98
98
  {
99
99
    str->set(val_int(), &my_charset_bin);
256
256
  Item_func_weekday(Item *a,bool type_arg)
257
257
    :Item_func(a), odbc_type(type_arg) {}
258
258
  longlong val_int();
259
 
  double val_real() { DBUG_ASSERT(fixed == 1); return (double) val_int(); }
 
259
  double val_real() { assert(fixed == 1); return (double) val_int(); }
260
260
  String *val_str(String *str)
261
261
  {
262
 
    DBUG_ASSERT(fixed == 1);
 
262
    assert(fixed == 1);
263
263
    str->set(val_int(), &my_charset_bin);
264
264
    return null_value ? 0 : str;
265
265
  }
349
349
  {
350
350
    return tmp_table_field_from_field_type(table, 0);
351
351
  }
352
 
  bool result_as_longlong() { return TRUE; }
 
352
  bool result_as_longlong() { return true; }
353
353
  my_decimal *val_decimal(my_decimal *decimal_value)
354
354
  {
355
 
    DBUG_ASSERT(fixed == 1);
 
355
    assert(fixed == 1);
356
356
    return  val_decimal_from_date(decimal_value);
357
357
  }
358
358
  int save_in_field(Field *field,
375
375
  {
376
376
    return tmp_table_field_from_field_type(table, 0);
377
377
  }
378
 
  bool result_as_longlong() { return TRUE; }
 
378
  bool result_as_longlong() { return true; }
379
379
  double val_real() { return (double) val_int(); }
380
380
  my_decimal *val_decimal(my_decimal *decimal_value)
381
381
  {
382
 
    DBUG_ASSERT(fixed == 1);
 
382
    assert(fixed == 1);
383
383
    return  val_decimal_from_date(decimal_value);
384
384
  }
385
385
  int save_in_field(Field *field,
410
410
  double val_real() { return val_real_from_decimal(); }
411
411
  my_decimal *val_decimal(my_decimal *decimal_value)
412
412
  {
413
 
    DBUG_ASSERT(fixed == 1);
 
413
    assert(fixed == 1);
414
414
    return  val_decimal_from_time(decimal_value);
415
415
  }
416
416
  int save_in_field(Field *field,
431
431
public:
432
432
  Item_func_curtime() :Item_str_timefunc() {}
433
433
  Item_func_curtime(Item *a) :Item_str_timefunc(a) {}
434
 
  double val_real() { DBUG_ASSERT(fixed == 1); return (double) value; }
435
 
  longlong val_int() { DBUG_ASSERT(fixed == 1); return value; }
 
434
  double val_real() { assert(fixed == 1); return (double) value; }
 
435
  longlong val_int() { assert(fixed == 1); return value; }
436
436
  String *val_str(String *str);
437
437
  void fix_length_and_dec();
438
438
  /* 
441
441
    MYSQL_TIME representation using UTC-SYSTEM or per-thread time zone.
442
442
  */
443
443
  virtual void store_now_in_TIME(MYSQL_TIME *now_time)=0;
444
 
  bool result_as_longlong() { return TRUE; }
 
444
  bool result_as_longlong() { return true; }
445
445
};
446
446
 
447
447
 
473
473
  MYSQL_TIME ltime;
474
474
public:
475
475
  Item_func_curdate() :Item_date() {}
476
 
  longlong val_int() { DBUG_ASSERT(fixed == 1); return (value) ; }
 
476
  longlong val_int() { assert(fixed == 1); return (value) ; }
477
477
  String *val_str(String *str);
478
478
  void fix_length_and_dec();
479
479
  bool get_date(MYSQL_TIME *res, uint fuzzy_date);
512
512
  Item_func_now() :Item_date_func() {}
513
513
  Item_func_now(Item *a) :Item_date_func(a) {}
514
514
  enum Item_result result_type () const { return STRING_RESULT; }
515
 
  longlong val_int() { DBUG_ASSERT(fixed == 1); return value; }
 
515
  longlong val_int() { assert(fixed == 1); return value; }
516
516
  int save_in_field(Field *to, bool no_conversions);
517
517
  String *val_str(String *str);
518
518
  void fix_length_and_dec();
649
649
  Item_func_sec_to_time(Item *item) :Item_str_timefunc(item) {}
650
650
  double val_real()
651
651
  {
652
 
    DBUG_ASSERT(fixed == 1);
 
652
    assert(fixed == 1);
653
653
    return (double) Item_func_sec_to_time::val_int();
654
654
  }
655
655
  longlong val_int();
661
661
    maybe_null=1;
662
662
  }
663
663
  const char *func_name() const { return "sec_to_time"; }
664
 
  bool result_as_longlong() { return TRUE; }
 
664
  bool result_as_longlong() { return true; }
665
665
};
666
666
 
667
667
 
709
709
  Item_typecast(Item *a) :Item_str_func(a) {}
710
710
  String *val_str(String *a)
711
711
  {
712
 
    DBUG_ASSERT(fixed == 1);
 
712
    assert(fixed == 1);
713
713
    String *tmp=args[0]->val_str(a);
714
714
    null_value=args[0]->null_value;
715
715
    if (tmp)
778
778
    max_length= 10;
779
779
    maybe_null= 1;
780
780
  }
781
 
  bool result_as_longlong() { return TRUE; }
 
781
  bool result_as_longlong() { return true; }
782
782
  longlong val_int();
783
783
  double val_real() { return (double) val_int(); }
784
784
  my_decimal *val_decimal(my_decimal *decimal_value)
785
785
  {
786
 
    DBUG_ASSERT(fixed == 1);
 
786
    assert(fixed == 1);
787
787
    return  val_decimal_from_date(decimal_value);
788
788
  }
789
789
  int save_in_field(Field *field,
807
807
  {
808
808
    return tmp_table_field_from_field_type(table, 0);
809
809
  }
810
 
  bool result_as_longlong() { return TRUE; }
 
810
  bool result_as_longlong() { return true; }
811
811
  longlong val_int();
812
812
  double val_real() { return val_real_from_decimal(); }
813
813
  my_decimal *val_decimal(my_decimal *decimal_value)
814
814
  {
815
 
    DBUG_ASSERT(fixed == 1);
 
815
    assert(fixed == 1);
816
816
    return  val_decimal_from_time(decimal_value);
817
817
  }
818
818
  int save_in_field(Field *field,
842
842
    max_length= MAX_DATETIME_FULL_WIDTH * MY_CHARSET_BIN_MB_MAXLEN;
843
843
    decimals= DATETIME_DEC;
844
844
  }
845
 
  bool result_as_longlong() { return TRUE; }
 
845
  bool result_as_longlong() { return true; }
846
846
  longlong val_int();
847
847
  double val_real() { return val_real_from_decimal(); }
848
848
  double val() { return (double) val_int(); }
849
849
  my_decimal *val_decimal(my_decimal *decimal_value)
850
850
  {
851
 
    DBUG_ASSERT(fixed == 1);
 
851
    assert(fixed == 1);
852
852
    return  val_decimal_from_date(decimal_value);
853
853
  }
854
854
  int save_in_field(Field *field,
896
896
  double val_real() { return val_real_from_decimal(); }
897
897
  my_decimal *val_decimal(my_decimal *decimal_value)
898
898
  {
899
 
    DBUG_ASSERT(fixed == 1);
 
899
    assert(fixed == 1);
900
900
    if (cached_field_type == MYSQL_TYPE_TIME)
901
901
      return  val_decimal_from_time(decimal_value);
902
902
    if (cached_field_type == MYSQL_TYPE_DATETIME)
933
933
  Item_func_maketime(Item *a, Item *b, Item *c)
934
934
    :Item_str_timefunc(a, b, c) 
935
935
  {
936
 
    maybe_null= TRUE;
 
936
    maybe_null= true;
937
937
  }
938
938
  String *val_str(String *str);
939
939
  const char *func_name() const { return "maketime"; }