~drizzle-trunk/drizzle/development

« back to all changes in this revision

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

  • Committer: LinuxJedi
  • Date: 2010-09-09 06:14:45 UTC
  • mto: (1750.1.1 build)
  • mto: This revision was merged to the branch mainline in revision 1751.
  • Revision ID: linuxjedi@linuxjedi-laptop-20100909061445-1jz91d5eed932616
Fix another wrong header, grr...

Show diffs side-by-side

added added

removed removed

Lines of Context:
57
57
        char buff[DRIZZLE_MAX_LENGTH_DATETIME_AS_STRING];
58
58
        String tmp(buff,sizeof(buff), &my_charset_utf8_bin);
59
59
        String *res= args[0]->val_str(&tmp);
60
 
 
61
 
        if (res && (res != &tmp))
62
 
        {
63
 
          tmp.copy(*res);
64
 
        }
65
 
 
66
 
        if (! temporal.from_string(tmp.c_ptr(), tmp.length()))
 
60
        if (! temporal.from_string(res->c_ptr(), res->length()))
67
61
        {
68
62
          /* 
69
63
          * Could not interpret the function argument as a temporal value, 
70
64
          * so throw an error and return 0
71
65
          */
72
 
          my_error(ER_INVALID_DATETIME_VALUE, MYF(0), tmp.c_ptr());
 
66
          my_error(ER_INVALID_DATETIME_VALUE, MYF(0), res->c_ptr());
73
67
          return 0;
74
68
        }
75
69
      }
91
85
 
92
86
        res= args[0]->val_str(&tmp);
93
87
 
94
 
        if (res && (res != &tmp))
95
 
        {
96
 
          tmp.copy(*res);
97
 
        }
98
 
 
99
 
        my_error(ER_INVALID_DATETIME_VALUE, MYF(0), tmp.c_ptr());
 
88
        my_error(ER_INVALID_DATETIME_VALUE, MYF(0), res->c_ptr());
100
89
        return 0;
101
90
      }
102
91
  }