~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/item.cc

  • Committer: Brian Aker
  • Date: 2011-01-25 00:16:39 UTC
  • mto: (2109.1.6 drizzle-build)
  • mto: This revision was merged to the branch mainline in revision 2112.
  • Revision ID: brian@tangent.org-20110125001639-lezc0b7obhbutj5l
Fix store_time to take reference.

Show diffs side-by-side

added added

removed removed

Lines of Context:
233
233
  /* Note that fix_fields may not be called for Item_avg_field items */
234
234
  int64_t result;
235
235
  type::Decimal value, *dec_val= val_decimal(&value);
 
236
 
236
237
  if (null_value)
237
238
    return 0;
238
239
  dec_val->val_int32(E_DEC_FATAL_ERROR, unsigned_flag, &result);
 
240
 
239
241
  return result;
240
242
}
241
243
 
242
244
int Item::save_time_in_field(Field *field)
243
245
{
244
246
  type::Time ltime;
 
247
 
245
248
  if (get_time(&ltime))
246
249
    return set_field_to_null(field);
 
250
 
247
251
  field->set_notnull();
248
 
  return field->store_time(&ltime, type::DRIZZLE_TIMESTAMP_TIME);
 
252
 
 
253
  return field->store_time(ltime, type::DRIZZLE_TIMESTAMP_TIME);
249
254
}
250
255
 
251
256
int Item::save_date_in_field(Field *field)
252
257
{
253
258
  type::Time ltime;
 
259
 
254
260
  if (get_date(&ltime, TIME_FUZZY_DATE))
255
261
    return set_field_to_null(field);
 
262
 
256
263
  field->set_notnull();
257
 
  return field->store_time(&ltime, type::DRIZZLE_TIMESTAMP_DATETIME);
 
264
 
 
265
  return field->store_time(ltime, type::DRIZZLE_TIMESTAMP_DATETIME);
258
266
}
259
267
 
260
268
/**
265
273
{
266
274
  if (null_value)
267
275
    return set_field_to_null(field);
 
276
 
268
277
  field->set_notnull();
 
278
 
269
279
  return field->store(result->ptr(), result->length(), collation.collation);
270
280
}
271
281