~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/function/time/to_days.h

  • Committer: Jay Pipes
  • Date: 2009-01-30 04:01:12 UTC
  • mto: This revision was merged to the branch mainline in revision 830.
  • Revision ID: jpipes@serialcoder-20090130040112-svbn774guj98pwi4
To remain in compatibility with MySQL, added ability to interpret
decimal arguments as datetime strings for temporal functions.

Fixed YEAR(), MONTH(), DAYOFMONTH(), DAYOFYEAR(), HOUR(), MINUTE(), SECOND(), and MICROSECOND()
to accept decimal parameters and interpret them the same way as MySQL.

Fixed an issue with the TemporalFormat::matches() method which was 
incorrectly assuming all microsecond arguments were specified as 6 digits.
Added power of 10 multiplier to usecond calculation. This fixes issues with
failures in type_date and func_sapdb test cases.

Show diffs side-by-side

added added

removed removed

Lines of Context:
20
20
#ifndef DRIZZLED_FUNCTION_TIME_TO_DAYS_H
21
21
#define DRIZZLED_FUNCTION_TIME_TO_DAYS_H
22
22
 
23
 
#include "drizzled/function/math/int.h"
24
 
 
25
 
namespace drizzled
26
 
{
 
23
#include <drizzled/function/math/int.h>
27
24
 
28
25
class Item_func_to_days :public Item_int_func
29
26
{
37
34
    max_length=6*MY_CHARSET_BIN_MB_MAXLEN;
38
35
    maybe_null=1;
39
36
  }
 
37
  enum_monotonicity_info get_monotonicity_info() const;
40
38
  int64_t val_int_endpoint(bool left_endp, bool *incl_endp);
 
39
  bool check_vcol_func_processor(unsigned char *)
 
40
  { return false; }
41
41
};
42
42
 
43
 
} /* namespace drizzled */
44
 
 
45
43
#endif /* DRIZZLED_FUNCTION_TIME_TO_DAYS_H */