diff options
author | Dan Goodliffe <dan@randomdan.homeip.net> | 2021-08-27 20:25:21 +0100 |
---|---|---|
committer | Dan Goodliffe <dan@randomdan.homeip.net> | 2021-08-27 20:25:21 +0100 |
commit | 88dd0d8650e44e8e2439ba9ef51c5bd3b7393fb6 (patch) | |
tree | 62b0e4e4d30e26d422ac2d012b88ef746fc1829f | |
parent | Test of getenv wrapper (diff) | |
download | mygrate-88dd0d8650e44e8e2439ba9ef51c5bd3b7393fb6.tar.bz2 mygrate-88dd0d8650e44e8e2439ba9ef51c5bd3b7393fb6.tar.xz mygrate-88dd0d8650e44e8e2439ba9ef51c5bd3b7393fb6.zip |
Fix parsing of date type
-rw-r--r-- | lib/mysql_types.cpp | 8 |
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; } |