~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/field/timestamp.cc

  • Committer: Brian Aker
  • Date: 2009-07-10 00:01:50 UTC
  • mto: (1090.1.1 staging)
  • mto: This revision was merged to the branch mainline in revision 1091.
  • Revision ID: brian@gaz-20090710000150-9ohs1x9ut0gt9skb
Fix protobuf to release memory. Add in assert() for wrong column usage. Fix
memory leak in temporal (from Jay)

Show diffs side-by-side

added added

removed removed

Lines of Context:
150
150
{
151
151
  drizzled::Timestamp temporal;
152
152
 
 
153
  ASSERT_COLUMN_MARKED_FOR_WRITE;
 
154
 
153
155
  if (! temporal.from_string(from, (size_t) len))
154
156
  {
155
157
    my_error(ER_INVALID_UNIX_TIMESTAMP_VALUE, MYF(ME_FATALERROR), from);
165
167
 
166
168
int Field_timestamp::store(double from)
167
169
{
 
170
  ASSERT_COLUMN_MARKED_FOR_WRITE;
 
171
 
168
172
  if (from < 0 || from > 99991231235959.0)
169
173
  {
170
174
    /* Convert the double to a string using stringstream */
181
185
 
182
186
int Field_timestamp::store(int64_t from, bool)
183
187
{
 
188
  ASSERT_COLUMN_MARKED_FOR_WRITE;
 
189
 
184
190
  /* 
185
191
   * Try to create a DateTime from the supplied integer.  Throw an error
186
192
   * if unable to create a valid DateTime.  
213
219
{
214
220
  uint32_t temp;
215
221
 
 
222
  ASSERT_COLUMN_MARKED_FOR_READ;
 
223
 
216
224
#ifdef WORDS_BIGENDIAN
217
225
  if (table && table->s->db_low_byte_first)
218
226
    temp= uint4korr(ptr);