diff options
author | Dan Goodliffe <dan@randomdan.homeip.net> | 2021-08-27 20:18:22 +0100 |
---|---|---|
committer | Dan Goodliffe <dan@randomdan.homeip.net> | 2021-08-27 20:18:22 +0100 |
commit | 8d2b0e199a592522ea4576738d1f89e3f3eaef14 (patch) | |
tree | 1e7c7862f71ee5adb51b87b52d08705037770872 /lib | |
parent | Fix undef of INTEGER_TYPE macro (diff) | |
download | mygrate-8d2b0e199a592522ea4576738d1f89e3f3eaef14.tar.bz2 mygrate-8d2b0e199a592522ea4576738d1f89e3f3eaef14.tar.xz mygrate-8d2b0e199a592522ea4576738d1f89e3f3eaef14.zip |
Fix parsing of year type
Diffstat (limited to 'lib')
-rw-r--r-- | lib/mysql_types.cpp | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/lib/mysql_types.cpp b/lib/mysql_types.cpp index a220931..b96fdaa 100644 --- a/lib/mysql_types.cpp +++ b/lib/mysql_types.cpp @@ -68,9 +68,18 @@ namespace MyGrate::MySQL { } INTEGER_TYPE(MYSQL_TYPE_INT24, false, 3); INTEGER_TYPE(MYSQL_TYPE_INT24, true, 3); - INTEGER_TYPE(MYSQL_TYPE_YEAR, false, 2); #undef INTEGER_TYPE + typename Type<MYSQL_TYPE_YEAR, false>::C + Type<MYSQL_TYPE_YEAR, false>::read(RawDataReader &, RawDataReader & data) + { + auto y {data.readValue<typename Type<MYSQL_TYPE_YEAR, false>::C, 1>()}; + if (y) { + y += 1900; + }; + return y; + } + static Blob readBlob(RawDataReader & md, RawDataReader & data) { |