From 8d2b0e199a592522ea4576738d1f89e3f3eaef14 Mon Sep 17 00:00:00 2001 From: Dan Goodliffe Date: Fri, 27 Aug 2021 20:18:22 +0100 Subject: Fix parsing of year type --- lib/mysql_types.cpp | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'lib') 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::C + Type::read(RawDataReader &, RawDataReader & data) + { + auto y {data.readValue::C, 1>()}; + if (y) { + y += 1900; + }; + return y; + } + static Blob readBlob(RawDataReader & md, RawDataReader & data) { -- cgit v1.2.3