From 384e51dc0bfbac087dbe082f7ea7752f7f128d87 Mon Sep 17 00:00:00 2001 From: Hernan Martinez Date: Tue, 28 Dec 2021 22:24:08 -0700 Subject: [PATCH 1/4] Declared JSON as string data # Conflicts: # Data/include/Poco/Data/MetaColumn.h # Data/src/RecordSet.cpp # Data/src/StatementImpl.cpp --- Data/MySQL/src/ResultMetadata.cpp | 3 +++ Data/include/Poco/Data/LOB.h | 2 +- Data/include/Poco/Data/MetaColumn.h | 1 + Data/src/RecordSet.cpp | 1 + Data/src/StatementImpl.cpp | 2 ++ 5 files changed, 8 insertions(+), 1 deletion(-) diff --git a/Data/MySQL/src/ResultMetadata.cpp b/Data/MySQL/src/ResultMetadata.cpp index 14839f13b4..3d631c0d37 100644 --- a/Data/MySQL/src/ResultMetadata.cpp +++ b/Data/MySQL/src/ResultMetadata.cpp @@ -71,6 +71,7 @@ namespace case MYSQL_TYPE_MEDIUM_BLOB: case MYSQL_TYPE_LONG_BLOB: case MYSQL_TYPE_BLOB: + case MYSQL_TYPE_JSON: return field.length; default: @@ -128,6 +129,8 @@ namespace case MYSQL_TYPE_LONG_BLOB: case MYSQL_TYPE_BLOB: return Poco::Data::MetaColumn::FDT_BLOB; + case MYSQL_TYPE_JSON: + return Poco::Data::MetaColumn::FDT_JSON; default: return Poco::Data::MetaColumn::FDT_UNKNOWN; } diff --git a/Data/include/Poco/Data/LOB.h b/Data/include/Poco/Data/LOB.h index 3ca80463d2..ea8e842f39 100644 --- a/Data/include/Poco/Data/LOB.h +++ b/Data/include/Poco/Data/LOB.h @@ -221,7 +221,7 @@ class LOB using BLOB = LOB; using CLOB = LOB; - +using JSON = std::string; // // inlines diff --git a/Data/include/Poco/Data/MetaColumn.h b/Data/include/Poco/Data/MetaColumn.h index 2952ed83db..0351766f10 100644 --- a/Data/include/Poco/Data/MetaColumn.h +++ b/Data/include/Poco/Data/MetaColumn.h @@ -51,6 +51,7 @@ class Data_API MetaColumn FDT_TIME, FDT_TIMESTAMP, FDT_UUID, + FDT_JSON, FDT_UNKNOWN }; diff --git a/Data/src/RecordSet.cpp b/Data/src/RecordSet.cpp index a84c35fdf6..20e978b0a9 100644 --- a/Data/src/RecordSet.cpp +++ b/Data/src/RecordSet.cpp @@ -160,6 +160,7 @@ Poco::Dynamic::Var RecordSet::value(std::size_t col, std::size_t row, bool useFi case MetaColumn::FDT_TIME: return value