ocaml-mysql icon indicating copy to clipboard operation
ocaml-mysql copied to clipboard

Fail the query if the results were truncated

Open Leonidas-from-XIV opened this issue 6 years ago • 1 comments

Closes #12.

Leonidas-from-XIV avatar Oct 14 '19 13:10 Leonidas-from-XIV

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?

ygrek avatar Nov 12 '19 17:11 ygrek