Fixed ODBC WString size handling.

This fixes a bug where Poco would return a string 1 character shorter than is actually in the DB (when the string in the DB uses the full length of a CHAR(N) or VARCHAR(N) column).
This commit is contained in:
Matyas Dolak 2014-09-16 15:23:03 +02:00
parent ee25a49e9b
commit d434d3cb12

View File

@ -152,7 +152,8 @@ std::size_t Preparator::maxDataSize(std::size_t pos) const
sz = mc.length();
// accomodate for terminating zero (non-bulk only!)
if (!isBulk() && ODBCMetaColumn::FDT_STRING == mc.type()) ++sz;
MetaColumn::ColumnDataType type = mc.type();
if (!isBulk() && ((ODBCMetaColumn::FDT_WSTRING == type) || (ODBCMetaColumn::FDT_STRING == type))) ++sz;
}
catch (StatementException&) { }