Details
-
Bug
-
Status: Closed (View Workflow)
-
Minor
-
Resolution: Fixed
-
None
-
None
-
None
Description
If datetime value is represented by a string, and fetched to MYSQL_TIME buffer, the fractional part is converted incorrectly.
str_to_TIME simply read the number after decimal point, and save it to the second_part of the MYSQL_TIME structure, no matter of how many zeros it has. While it has to save number of microseconds, for 0.1 or 0.01 or 0.000000001 the second_part will be 1.
Attached is the diff against master branch with the testcase.
To fix this, str_to_TIME probably should memorize '.' position, and using it calculate number of decimal digits, compare it to 6, and then multiply or divide the number by 10 required number of times.
Attachments
Issue Links
- causes
-
ODBC-198 Incorrect second fraction number if string field is fetched into TIMESTAMP struct
- Closed