~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/item/float.h

Replace MAX_(DATE|TIME).*_WIDTH defines in definitions.h with real (and correct) static const members to Temporal types.

This fixes the buffer overflow in https://bugs.launchpad.net/drizzle/+bug/373468

It also removes a handwritten snprintf in field/datetime.cc
However... this caused us to have to change Temporal to have a way to not
"convert" the int64_t value (so 20090101 becomes 20090101000000 etc) as it
has already been converted and we just want the Temporal type to do the
to_string conversion.

This still causes a failure in 'metadata' test due to size of timestamp type. I need feedback from Jay on when the usecond code comes into play to know the correct fix for this.

Show diffs side-by-side

added added

removed removed

Lines of Context:
22
22
 
23
23
#include <drizzled/item/num.h>
24
24
 
25
 
namespace drizzled
26
 
{
27
 
 
28
25
class Item_float :public Item_num
29
26
{
30
27
  char *presentation;
77
74
  Item *safe_charset_converter(const CHARSET_INFO * const tocs);
78
75
};
79
76
 
80
 
} /* namespace drizzled */
81
 
 
82
77
#endif /* DRIZZLED_ITEM_FLOAT_H */
83
78