[CONCPP-62] Statement would return incorrect fractional part for (DATE)TIME values Created: 2021-02-04  Updated: 2021-02-05  Resolved: 2021-02-05

Status: Closed
Project: MariaDB Connector/C++
Component/s: General
Affects Version/s: 0.9.4
Fix Version/s: 1.0.0

Type: Bug Priority: Major
Reporter: Lawrin Novitsky Assignee: Lawrin Novitsky
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Description   

The scenario
stmt->execute("CREATE TABLE concpp62(ts TIMESTAMP(6))");
stmt->execute("INSERT INTO concpp62(ts) values('2015-01-20 16:14:36.709649')");

res.reset(stmt->executeQuery("SELECT ts, TIME(ts) from bug68523"));
ASSERT(res->next());

ASSERT_EQUALS(res->getString(1), "2015-01-20 16:14:36.709649");
ASSERT_EQUALS(res->getString(2), "16:14:36.709649");

The result was nanoseconds instead of microseconds in fractional part in this case.
Both the testcase and fix have been already pushed in the commit 43d72ad


Generated at Thu Feb 08 03:08:03 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.