Skip to content

wrong field size calculation in ODBC code #1659

@nikkov

Description

@nikkov

I received the LengthExceededException when inserting records into a table with a binding std::vector<std::string>. But string sizes in vector was much less field size. A small investigation revealed that the problem is in the field size calculation code in function getMinValueSize (Data/ODBC/include/Poco/Data/ODBC/Binder.h):

...
std::size_t sz = it->size() * sizeof(T);
...

but T in my case is std::vector<std::string> and field size calculated as (length string) * (sizeof(std::vector<std::string>))

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions