summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorDan Goodliffe <dan@randomdan.homeip.net>2021-08-27 20:25:21 +0100
committerDan Goodliffe <dan@randomdan.homeip.net>2021-08-27 20:25:21 +0100
commit88dd0d8650e44e8e2439ba9ef51c5bd3b7393fb6 (patch)
tree62b0e4e4d30e26d422ac2d012b88ef746fc1829f /lib
parentTest of getenv wrapper (diff)
downloadmygrate-88dd0d8650e44e8e2439ba9ef51c5bd3b7393fb6.tar.bz2
mygrate-88dd0d8650e44e8e2439ba9ef51c5bd3b7393fb6.tar.xz
mygrate-88dd0d8650e44e8e2439ba9ef51c5bd3b7393fb6.zip
Fix parsing of date type
Diffstat (limited to 'lib')
-rw-r--r--lib/mysql_types.cpp8
1 files changed, 4 insertions, 4 deletions
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<MYSQL_TYPE_DATE>::C
Type<MYSQL_TYPE_DATE>::read(RawDataReader &, RawDataReader & data)
{
- auto dint {data.readValue<uint32_t, 3>()};
+ const auto dint {data.readValue<uint32_t, 3>()};
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;
}