~drizzle-trunk/drizzle/development

« back to all changes in this revision

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

  • Committer: patrick crews
  • Date: 2010-09-16 14:38:00 UTC
  • mfrom: (1768 staging)
  • mto: (1771.1.1 pcrews)
  • mto: This revision was merged to the branch mainline in revision 1772.
  • Revision ID: gleebix@gmail.com-20100916143800-hyu1tcfnjcowfnpb
Merge with trunk

Show diffs side-by-side

added added

removed removed

Lines of Context:
78
78
          return false;
79
79
        }
80
80
 
81
 
        if (! temporal.from_string(res->c_ptr(), res->length()))
 
81
        if (res != &tmp)
 
82
        {
 
83
          tmp.copy(*res);
 
84
        }
 
85
 
 
86
        if (! temporal.from_string(tmp.c_ptr(), tmp.length()))
82
87
        {
83
88
          /* 
84
89
          * Could not interpret the function argument as a temporal value, 
85
90
          * so throw an error and return 0
86
91
          */
87
 
          my_error(ER_INVALID_DATETIME_VALUE, MYF(0), res->c_ptr());
 
92
          my_error(ER_INVALID_DATETIME_VALUE, MYF(0), tmp.c_ptr());
88
93
          return false;
89
94
        }
90
95
      }
116
121
          return false;
117
122
        }
118
123
 
119
 
        my_error(ER_INVALID_DATETIME_VALUE, MYF(0), res->c_ptr());
 
124
        if (res != &tmp)
 
125
        {
 
126
          tmp.copy(*res);
 
127
        }
 
128
 
 
129
        my_error(ER_INVALID_DATETIME_VALUE, MYF(0), tmp.c_ptr());
120
130
        return false;
121
131
      }
122
132
  }