diff options
author | Dan Goodliffe <dan@randomdan.homeip.net> | 2021-06-19 21:21:03 +0100 |
---|---|---|
committer | Dan Goodliffe <dan@randomdan.homeip.net> | 2021-06-19 21:21:03 +0100 |
commit | be1fa3c31696080e81d8e72ceb77c5c24bf2e853 (patch) | |
tree | 2a37519bfffd7c6fb6eda24e7bc8c4a988e1d87b | |
parent | Add missing header to prevent recursion (diff) | |
download | mygrate-be1fa3c31696080e81d8e72ceb77c5c24bf2e853.tar.bz2 mygrate-be1fa3c31696080e81d8e72ceb77c5c24bf2e853.tar.xz mygrate-be1fa3c31696080e81d8e72ceb77c5c24bf2e853.zip |
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.
-rw-r--r-- | lib/input/mysqlRecordSet.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
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<ResultDataT<std::string_view>>(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<ResultDataT<Blob>>(b, f); + if (f.charsetnr == 63) + return std::make_unique<ResultDataT<Blob>>(b, f); + else + return std::make_unique<ResultDataT<std::string_view>>(b, f); case MAX_NO_FIELD_TYPES: case MYSQL_TYPE_BIT: case MYSQL_TYPE_SET: |