seznam / SuperiorMySqlpp

SuperiorMySQL++
GNU Lesser General Public License v3.0
31 stars 20 forks source link

Max string length is 1024 (in result binding) #11

Closed jschrotter closed 5 years ago

jschrotter commented 8 years ago

SuperiorMySqlpp::Sql::String is by default initialized to the length of 1024B. When binding such value to a varchar(1000) I got "Data truncated while fetching statement!" error. Would be nice to have String initialized to the lenght which is always big enough (even for UTF-8 values), ideally derived from actual data column length.

OpatrilPeter commented 5 years ago

Currently recommended solution is using type SuperiorMySqlpp::Sql::StringData<size>, you can see the usage in tests. In fact, SuperiorMySqlpp::Sql::String is just a convenient alias for that with arbitrary limit.

In a future version, we're planning to introduce support for proper dynamically sized container, just like you mentioned.