From 2bdeaff849f4b9f012b6098b74f6c6082c1b8f5d Mon Sep 17 00:00:00 2001 From: cliu Date: Fri, 12 Sep 2025 15:45:54 +0800 Subject: [PATCH] fix(data/odbc): change the preparing of uuid column type so that isNull() can properly get the actual size and check if it is null. --- Data/ODBC/include/Poco/Data/ODBC/Preparator.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Data/ODBC/include/Poco/Data/ODBC/Preparator.h b/Data/ODBC/include/Poco/Data/ODBC/Preparator.h index 7030ab0bd..07b9ba428 100644 --- a/Data/ODBC/include/Poco/Data/ODBC/Preparator.h +++ b/Data/ODBC/include/Poco/Data/ODBC/Preparator.h @@ -554,7 +554,7 @@ private: case MetaColumn::FDT_UUID: if (pVal) - return prepareFixedSize(pos, SQL_C_BINARY, 16); + return prepareFixedSize(pos, SQL_C_BINARY, pVal->size()); else return prepareFixedSize(pos, SQL_C_BINARY); @@ -1185,7 +1185,7 @@ inline void Preparator::prepare(std::size_t pos, const std::list inline void Preparator::prepare(std::size_t pos, const Poco::UUID&) { - prepareCharArray(pos, SQL_C_BINARY, 16, 16); + prepareVariableLen(pos, SQL_C_BINARY, 16, DT_CHAR); }