summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/mysql_types.cpp11
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)
{