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
Markiert in:             

10 Gedanken zu „Advantage returning wrong value on Null in Delphi Tokyo

  • 2. November 2017 um 17:05
    Permalink

    Can you explain why only Tokyo is affected or does this fix apply to other versions as well?

    Antworten
    • 2. November 2017 um 17:55
      Permalink

      Looks like only Tokyo is affected. I didn’t get the same issues compiling with Seattle or Berlin.

      Antworten
      • 2. November 2017 um 17:56
        Permalink

        Strange, but good to know. Thank you very much.

        Antworten
  • 3. November 2017 um 7:38
    Permalink

    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?

    Antworten
    • 3. November 2017 um 7:51
      Permalink

      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;)

      Antworten
      • 3. November 2017 um 7:56
        Permalink

        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.

        Antworten
  • 6. November 2017 um 15:24
    Permalink

    Nice one. Works even with Version 10 TDataSet Components (though I’ve had to modify ace.pas too)

    Antworten
  • 16. Januar 2018 um 15:04
    Permalink

    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

    Antworten
    • 16. Januar 2018 um 16:26
      Permalink

      folgende Typ-Definitionen aus der ace.pas (V12):
      UNSIGNED64 = UInt64;
      PUNSIGNED64 = ^UNSIGNED64;
      Hilft Dir das weiter?

      Antworten

Schreibe einen Kommentar

Deine E-Mail-Adresse wird nicht veröffentlicht. Erforderliche Felder sind mit * markiert.