Added a few comments about field->length and data truncation. Corrected data truncated handling. Explicitly check for MYSQL_NO_DATA.
For MySQL count, use db_type_uint32_t and check bind->length.