~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/temporal_format.cc

  • Committer: Padraig O'Sullivan
  • Date: 2009-07-12 06:38:23 UTC
  • mfrom: (1093 staging)
  • mto: (1093.1.25 captain)
  • mto: This revision was merged to the branch mainline in revision 1099.
  • Revision ID: osullivan.padraig@gmail.com-20090712063823-baa8sosar2qdq2lh
MergeĀ fromĀ trunk.

Show diffs side-by-side

added added

removed removed

Lines of Context:
248
248
, {"^(\\d{1,2})\\.(\\d{1,6})$", 0, 0, 0, 0, 0, 1, 2, 0} /* [S]S.uuuuuu */
249
249
};
250
250
 
251
 
std::vector<drizzled::TemporalFormat*> known_datetime_formats;
252
 
std::vector<drizzled::TemporalFormat*> known_date_formats;
253
 
std::vector<drizzled::TemporalFormat*> known_time_formats;
 
251
std::vector<drizzled::TemporalFormat *> known_datetime_formats;
 
252
std::vector<drizzled::TemporalFormat *> known_date_formats;
 
253
std::vector<drizzled::TemporalFormat *> known_time_formats;
 
254
std::vector<drizzled::TemporalFormat *> all_temporal_formats;
254
255
 
255
256
/**
256
257
 * We allocate and initialize all known date/time formats.
276
277
    tmp->set_second_part_index(current_format_args.second_part_index);
277
278
    tmp->set_usecond_part_index(current_format_args.usecond_part_index);
278
279
    tmp->set_nsecond_part_index(current_format_args.nsecond_part_index);
 
280
    
 
281
    /* 
 
282
     * We store the pointer in all_temporal_formats because we 
 
283
     * delete pointers from that vector and only that vector
 
284
     */
 
285
    all_temporal_formats.push_back(tmp); 
279
286
 
280
287
    if (current_format_args.year_part_index > 0) /* A date must have a year */
281
288
    {
289
296
  }
290
297
  return true;
291
298
}
 
299
 
 
300
/** Free all allocated temporal formats */
 
301
void deinit_temporal_formats()
 
302
{
 
303
  std::vector<drizzled::TemporalFormat *>::iterator p= all_temporal_formats.begin();
 
304
  while (p != all_temporal_formats.end())
 
305
  {
 
306
    delete *p;
 
307
    ++p;
 
308
  }
 
309
  known_date_formats.clear();
 
310
  known_datetime_formats.clear();
 
311
  known_time_formats.clear();
 
312
  all_temporal_formats.clear();
 
313
}