XE7 FireDAC mapped widestring truncation

99 Views Asked by At

I'm using Delphi XE7 and FireDAC to connect to Firebird 2.5 database.

If there is active (inherited) type mapping rule dtAnsiString -> dtWideString the contents of long string fields (>60 char) is truncated. Truncation occurs both in FDQuery and Cn.ExecSQLScalar function.

Details: FB2.5 ANSI (Win1250) field (varchar(100)) contains local disk path without accented or special characters. The truncation occurs on same position regardless of characters in contents. If field content length is shorter then 68 characters, evrything is OK. If it is longer than 67 character (char_length(field)>=68) then truncation occurs, and first 67 caharcters are returned. Both in IDE and runtime. And invalid pointer operation or access violation exceptions are raised.

Moreover this truncation results to Access violation or Invalid pointer operation errors later.

Example: Field in database varchar(100). Content length 82 characters. Result length 67 characters If I delete the mapping rule, the result is correct.

Mapping rule is important for migration. Same delphi code has to work with old FireBird 2.5 database with ANSI (Win1250) collation string fields, and Firebird 4.0 UTF8 string fields.

Any suggestion?

0

There are 0 best solutions below