~ubuntu-branches/ubuntu/trusty/drizzle/trusty

« back to all changes in this revision

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

  • Committer: Bazaar Package Importer
  • Author(s): Monty Taylor
  • Date: 2010-10-02 14:17:48 UTC
  • mfrom: (1.1.1 upstream)
  • mto: (2.1.17 sid)
  • mto: This revision was merged to the branch mainline in revision 3.
  • Revision ID: james.westby@ubuntu.com-20101002141748-m6vbfbfjhrw1153e
Tags: 2010.09.1802-1
* New upstream release.
* Removed pid-file argument hack.
* Updated GPL-2 address to be new address.
* Directly copy in drizzledump.1 since debian doesn't have sphinx 1.0 yet.
* Link to jquery from libjs-jquery. Add it as a depend.
* Add drizzled.8 symlink to the install files.

Show diffs side-by-side

added added

removed removed

Lines of Context:
82
82
          return false;
83
83
        }
84
84
 
85
 
        if (! temporal.from_string(res->c_ptr(), res->length()))
 
85
        if (res != &tmp)
 
86
        {
 
87
          tmp.copy(*res);
 
88
        }
 
89
 
 
90
        if (! temporal.from_string(tmp.c_ptr(), tmp.length()))
86
91
        {
87
92
          /* 
88
93
          * Could not interpret the function argument as a temporal value, 
89
94
          * so throw an error and return 0
90
95
          */
91
 
          my_error(ER_INVALID_DATETIME_VALUE, MYF(0), res->c_ptr());
 
96
          my_error(ER_INVALID_DATETIME_VALUE, MYF(0), tmp.c_ptr());
92
97
          return 0;
93
98
        }
94
99
      }
120
125
          return false;
121
126
        }
122
127
 
123
 
        my_error(ER_INVALID_DATETIME_VALUE, MYF(0), res->c_ptr());
 
128
        if (res != &tmp)
 
129
        {
 
130
          tmp.copy(*res);
 
131
        }
 
132
 
 
133
        my_error(ER_INVALID_DATETIME_VALUE, MYF(0), tmp.c_ptr());
124
134
        return 0;
125
135
      }
126
136
  }
174
184
          return 0;
175
185
        }
176
186
 
177
 
        if (! temporal.from_string(res->c_ptr(), res->length()))
 
187
        if (res != &tmp)
 
188
        {
 
189
          tmp.copy(*res);
 
190
        }
 
191
 
 
192
        if (! temporal.from_string(tmp.c_ptr(), tmp.length()))
178
193
        {
179
194
          /* 
180
195
          * Could not interpret the function argument as a temporal value, 
181
196
          * so throw an error and return 0
182
197
          */
183
 
          my_error(ER_INVALID_DATETIME_VALUE, MYF(0), res->c_ptr());
 
198
          my_error(ER_INVALID_DATETIME_VALUE, MYF(0), tmp.c_ptr());
184
199
          return 0;
185
200
        }
186
201
      }
212
227
          return 0;
213
228
        }
214
229
 
215
 
        my_error(ER_INVALID_DATETIME_VALUE, MYF(0), res->c_ptr());
 
230
        if (res != &tmp)
 
231
        {
 
232
          tmp.copy(*res);
 
233
        }
 
234
 
 
235
        my_error(ER_INVALID_DATETIME_VALUE, MYF(0), tmp.c_ptr());
216
236
        return 0;
217
237
      }
218
238
  }