ygrek / ocaml-mysql

OCaml bindings to libmysqlclient
https://ygrek.org.ua/p/ocaml-mysql
GNU Lesser General Public License v2.1
23 stars 11 forks source link

Fail the query if the results were truncated #14

Open Leonidas-from-XIV opened 5 years ago

Leonidas-from-XIV commented 5 years ago

Closes #12.

ygrek commented 4 years ago

I believe this error is not for number of rows, but for the size of resulting columns. See https://dev.mysql.com/doc/refman/5.7/en/mysql-stmt-fetch.html

MYSQL_DATA_TRUNCATED is returned when truncation reporting is enabled. To determine which column values were truncated when this value is returned, check the error members of the MYSQL_BIND structures used for fetching values. Truncation reporting is enabled by default, but can be controlled by calling mysql_options() with the MYSQL_REPORT_DATA_TRUNCATION option.

But now we cannot fail the query (because compatibility) but should introduce one more function or carry some flag?