I was reported that the Advantage Delphi client doesn’t return NULL on MONEY data type in Delphi Tokyo. After some research, I’ve found a bug in adsdata.pas: Line 5996 compares the data buffer with the value that represents NULL in ADS. It casts the content to a Signed64 for the comparison:
if ( pSIGNED64 ( pcData )^ <> $8000000000000000 ) then
All other comparisons in that function (TAdsDataSet.IsFieldBlank) compare to Unsigned values instead. So modifying the above line with
if ( PUNSIGNED64 ( pcData )^ <> $8000000000000000 ) then
fixes the issue.
Advantage returning wrong value on Null in Delphi Tokyo
Can you explain why only Tokyo is affected or does this fix apply to other versions as well?
Looks like only Tokyo is affected. I didn’t get the same issues compiling with Seattle or Berlin.
Strange, but good to know. Thank you very much.
Hello Joachim, on my adsdata.pas i have that in line 5986.
Possible that we have an older file than you. Can you zip your tdataset source folder for Tokyo 10.2.1?
That might be. I’ve used V12, but did some modifications when trying to get it run under Linux. I’d suggest to use the official version, not mine;)
Ok and thanks Joachim.
We’re using 11.10.0.30 tdataset components and think that we will not switch to v12.
Lack of support will let us switch after 18 years away to another Db with ~2000 users.
Nice one. Works even with Version 10 TDataSet Components (though I’ve had to modify ace.pas too)
Wir verwenden Delphi 10.2 Update 2 und den ADS Client 11.10.30
Die Installation hat Dank deiner Hilfe perfekt funktioniert.
Die NULL Werte bei Money werden aber nicht korrekt angezeigt.
In der adsdata.pas ist der Wert punsigned64 nicht bekannt.
In der ace.pas wird dieser Wert auch nicht aufgeführt.
Welche Möglichkeiten gibt es hierzu noch ?
Eine Antwort wäre sehr nett.
Vielen Dank
folgende Typ-Definitionen aus der ace.pas (V12):
UNSIGNED64 = UInt64;
PUNSIGNED64 = ^UNSIGNED64;
Hilft Dir das weiter?
Hallo Joachim,
vielen Dank für die schnelle Antwort
funktioniert perfekt!
Hello Joachim.
Thanks for the fix.
Came from XE2 to Rio with the ADS 11.10.0.30.
Since i use the V11 and not the V12, for which you wrote that post, there are few more entries for ADS_MONEY with pSIGNED64. Should that to be replaced too?
Stefan,
I didn’t test with ADS V11 – which is fairly outdated btw 😉
Joachim, what advantages would it have to change to V12? What is different to V11 (for TAdsDataSet)?
There are still support releases and bug fixes?
Is it possible to use the V12 TAdsDataSet with an V11 server?
You need to update the server, too. V12 has some nice enhancements. See my post on V12.