Wrong string length in VariantToBuffer
Procedure TAbstractObjectDataset.VariantToBuffer for Field.DataType = ftString on Windows uses SysStringLen function. This function supposes that given string in [-1] item has number of bytes of the string (you can see it in disassembly of this function, at least on my Win8.1Pro). However it is stored using typical Delphi definition with number of characters, which is half the number of bytes for Unicode strings.
The result is shortened string recieved by TAbstractObjectDataset.GetFieldData and in any further operation.
Tested on commit 037bc65 (15.12.2014) of Marchmallow branch.
Comments (11)
-
reporter -
reporter - attached Bug62Screen.gif
Picture of the bug - lookup field has missing chacters
-
reporter - attached Project1.dpr
- attached Unit1.vlb
- attached Unit1.pas
- attached Unit1.dfm
Project with a bug reported
-
reporter Another interesting point: the issue accurs for LookupCache = True for lookup string column. For LookupCache = False, field has always value "False".
-
reporter - changed milestone to 1.2
-
- changed status to resolved
fixes
#62TObjectDataset changes: got rid of one IFDEF, implemented lookup.→ <<cset ec996ec47557>>
-
repo owner - changed version to 1.1 (released)
-
repo owner - changed version to 1.1 (master)
-
repo owner - changed version to 1.1
-
repo owner - changed milestone to 1.2 (next version)
-
repo owner - changed milestone to 1.2
- Log in to comment
The problem does not occur in all string fields. In my case it occurs only with lookup string fields, but direct data string field works. Transliterate must be On (default), with Off value "False" occurs. I'll post some minimalistic project, but today is too late.