EnterpriseDB / mysql_fdw

PostgreSQL foreign data wrapper for MySQL
Other
531 stars 162 forks source link

Long string in text column induce missing row in results #92

Open vincentdesmares opened 8 years ago

vincentdesmares commented 8 years ago

See previous issue: https://github.com/EnterpriseDB/mysql_fdw/issues/27

I got the same problem with a longtext field in Mysql that block the selection of rows. If I unselect the field I got all my rows, If I select it, I only get 11 of them.

I tried to change the MAXDATALEN to 1024 * 128 and now it works. This is very strange as a longtext in Mysql should be 65535 bit long, so 1025 * 64 should be the good value.

Do you have an idea of what is happening? Why the MAXDATALEN is too short in this case?

vincentdesmares commented 8 years ago

My bad, longtext fields can contain a lot more characters in fact: http://dev.mysql.com/doc/refman/5.7/en/string-type-overview.html

The question is what should be the good value for this buffer in this case? I feel like 4,294,967,295 may cause memory issues but it's technically possible to have a text that big.

I guess the TODO you created in #27 was the good solution :)

/* TODO: Set the maximum data length based on the type of MySQL's column */

nextstopsun commented 6 years ago

Same here. Longtext doesn't get selected and all subsequent rows don't get selected either. Can this be set at runtime by a foreign column (table) options?