MXS-1216: Fix crash on MariaDB 10.0 DATETIME(n)
When a MariaDB 10.0 DATETIME field with a custom length was defined, the field offsets weren't calculated properly. As there is no metadata for pre-10.1 DATETIME types with decimal precision, the metadata (i.e. decimal count) needs to be gathered from the CREATE TABLE statement. This information is then used to calculate the correct field length when the value is decoded. This change does not fix the incorrect interpretation of the old DATETIME value. The converted values are still garbled due to the fact that the value needs to be shifted out of the decimal format before it can be properly converted.
This commit is contained in:
@ -83,7 +83,7 @@ bool column_is_decimal(uint8_t type);
|
||||
bool fixed_string_is_enum(uint8_t type);
|
||||
|
||||
/** Value unpacking */
|
||||
size_t unpack_temporal_value(uint8_t type, uint8_t *ptr, uint8_t* metadata, struct tm *tm);
|
||||
size_t unpack_temporal_value(uint8_t type, uint8_t *ptr, uint8_t* metadata, int length, struct tm *tm);
|
||||
size_t unpack_enum(uint8_t *ptr, uint8_t *metadata, uint8_t *dest);
|
||||
size_t unpack_numeric_field(uint8_t *ptr, uint8_t type, uint8_t* metadata, uint8_t* val);
|
||||
size_t unpack_bit(uint8_t *ptr, uint8_t *null_mask, uint32_t col_count,
|
||||
|
Reference in New Issue
Block a user