Hi,

The TMySQLConnection.LoadField method from sqldb/mysql does not fetch the field 
lengths properly. It uses mysql_fetch_field_direct, but this only returns data 
about an entire column in your result set. It does not give valid field lengths 
for fields of variable length. Is should use mysql_fetch_lengths I think 
(http://dev.mysql.com/doc/mysql/en/mysql-fetch-lengths.html).

Example query causing an access violation:

 SELECT FORMAT(myDouble,2) FROM myTable

Actually, the field length reported by mysql_fetch_field_drect is 5592424 in my 
program.

The MySQLDataType method also uses length information from 
mysql_fetch_field_direct and pumps this into TFieldDef.Create.
I'm not sure about the meaning of the ASize parameter for TFieldDef.Create. 
What if a string can have arbitrary length?

I need answers to these questions if I want to make a (good) patch I think.

Greetings,

Bram

_______________________________________________
fpc-devel maillist  -  [email protected]
http://lists.freepascal.org/mailman/listinfo/fpc-devel

Reply via email to