From be1fa3c31696080e81d8e72ceb77c5c24bf2e853 Mon Sep 17 00:00:00 2001 From: Dan Goodliffe Date: Sat, 19 Jun 2021 21:21:03 +0100 Subject: Treat blobs as text if they're not binary Seems *text fields are returned claiming to be blobs... so if they're blobs with a non-binary charset number (assumed that 63 is consistent for this) treated them as strings. --- lib/input/mysqlRecordSet.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'lib') diff --git a/lib/input/mysqlRecordSet.cpp b/lib/input/mysqlRecordSet.cpp index 71c5148..9eec30f 100644 --- a/lib/input/mysqlRecordSet.cpp +++ b/lib/input/mysqlRecordSet.cpp @@ -51,12 +51,14 @@ namespace MyGrate::Input { case MYSQL_TYPE_STRING: case MYSQL_TYPE_JSON: case MYSQL_TYPE_ENUM: - return std::make_unique>(b, f); case MYSQL_TYPE_TINY_BLOB: case MYSQL_TYPE_MEDIUM_BLOB: case MYSQL_TYPE_LONG_BLOB: case MYSQL_TYPE_BLOB: - return std::make_unique>(b, f); + if (f.charsetnr == 63) + return std::make_unique>(b, f); + else + return std::make_unique>(b, f); case MAX_NO_FIELD_TYPES: case MYSQL_TYPE_BIT: case MYSQL_TYPE_SET: -- cgit v1.2.3