~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/ha_statistics.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:
20
20
#ifndef DRIZZLED_HA_STATISTICS_H
21
21
#define DRIZZLED_HA_STATISTICS_H
22
22
 
 
23
#include <stdint.h>
23
24
#include <drizzled/definitions.h>
24
25
#include <time.h>
25
26
 
26
 
namespace drizzled
27
 
{
28
 
 
29
27
class ha_statistics
30
28
{
31
29
public:
59
57
  {}
60
58
};
61
59
 
62
 
} /* namespace drizzled */
63
 
 
64
60
#endif /* DRIZZLED_HA_STATISTICS_H */