~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/function/time/month.cc

  • Committer: Brian Aker
  • Date: 2009-01-29 20:05:14 UTC
  • mfrom: (813.1.14 new-temporal)
  • Revision ID: brian@tangent.org-20090129200514-84zoh7uc7bln6x0b
Merge Jay

Show diffs side-by-side

added added

removed removed

Lines of Context:
43
43
  {
44
44
    case STRING_RESULT:
45
45
      {
46
 
        char buff[40];
 
46
        char buff[DRIZZLE_MAX_LENGTH_DATETIME_AS_STRING];
47
47
        String tmp(buff,sizeof(buff), &my_charset_utf8_bin);
48
48
        String *res= args[0]->val_str(&tmp);
49
49
        if (! temporal.from_string(res->c_ptr(), res->length()))
58
58
      }
59
59
      break;
60
60
    case INT_RESULT:
61
 
      if (! temporal.from_int64_t(args[0]->val_int()))
62
 
      {
63
 
        /* 
64
 
        * Could not interpret the function argument as a temporal value, 
65
 
        * so throw an error and return 0
66
 
        */
67
 
        null_value= true;
68
 
        char buff[40];
69
 
        String tmp(buff,sizeof(buff), &my_charset_utf8_bin);
70
 
        String *res;
71
 
 
72
 
        res= args[0]->val_str(&tmp);
73
 
 
74
 
        my_error(ER_INVALID_DATETIME_VALUE, MYF(0), res->c_ptr());
75
 
        return 0;
76
 
      }
77
 
      break;
 
61
      if (temporal.from_int64_t(args[0]->val_int()))
 
62
        break;
 
63
      /* Intentionally fall-through on invalid conversion from integer */
78
64
    default:
79
65
      {
80
66
        /* 
82
68
        * so throw an error and return 0
83
69
        */
84
70
        null_value= true;
85
 
        char buff[40];
 
71
        char buff[DRIZZLE_MAX_LENGTH_DATETIME_AS_STRING];
86
72
        String tmp(buff,sizeof(buff), &my_charset_utf8_bin);
87
73
        String *res;
88
74