From 88dd0d8650e44e8e2439ba9ef51c5bd3b7393fb6 Mon Sep 17 00:00:00 2001 From: Dan Goodliffe Date: Fri, 27 Aug 2021 20:25:21 +0100 Subject: Fix parsing of date type --- lib/mysql_types.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'lib') diff --git a/lib/mysql_types.cpp b/lib/mysql_types.cpp index b96fdaa..4480d23 100644 --- a/lib/mysql_types.cpp +++ b/lib/mysql_types.cpp @@ -193,11 +193,11 @@ namespace MyGrate::MySQL { typename Type::C Type::read(RawDataReader &, RawDataReader & data) { - auto dint {data.readValue()}; + const auto dint {data.readValue()}; Date d {}; - d.day = bitslice<6>(dint, 0); - d.month = bitslice<4>(dint, 6); - d.year = bitslice<14>(dint, 10); + d.day = bitslice<5>(dint, 0); + d.month = bitslice<4>(dint, 5); + d.year = bitslice<14>(dint, 9); return d; } -- cgit v1.2.3