-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Description
DateTime is not bind/extract correctly from MySQL database. Milisecond and microseconds are corrupted.
Binding
Miliseconds are bind by this code:
poco/Data/MySQL/src/Binder.cpp
Line 172 in 238306a
| mt.second_part = val.millisecond(); |
But MYSQL_TIME::second_part contains both milisecond and microsecond as one number. So the previous code makes microseconds from miliseconds. For example 0.333555 seconds (333 miliseconds and 555 microseconds) is bind as mt.second_part = 333 (it means 333 microseconds), but it should be bind as mt.second_part = 333555.
Extraction
Extraction is done by code:
poco/Data/MySQL/src/Extractor.cpp
Line 211 in 238306a
| val.assign(mt.year, mt.month, mt.day, mt.hour, mt.minute, mt.second, mt.second_part, 0); |
Assigment mt.second_part to DateTime causes assertion violation, because miliseconds in DateTime must be smaller or equal 999. But mt.second_part may contains much bigger values.