Possible bug with ftMemo bind variable.

Discussion of open issues, suggestions and bugs regarding ODAC (Oracle Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
MarkF
Posts: 211
Joined: Thu 02 Mar 2006 14:55

Possible bug with ftMemo bind variable.

Post by MarkF » Wed 10 Feb 2016 15:00

It appears that if a bind variable of type ftMemo or ftWideMemo is set to an empty string, then it will stay that way forever. This seems to have started with 9.6.21 (I think) and also exists in 9.6.22. Here's the code to reproduce:

Code: Select all

      Query := TOraQuery.Create(nil);
      try
        Query.Session := Session;
        Session.Connect;
        WriteLn('Connected');

        // Setup the SQL and params.
        Query.SQL.Text := 'begin :MyOutText := :MyInText; end;';
        Query.ParamByName('MyInText').AsString := 'Some Text';
        Query.ParamByName('MyInText').ParamType := ptInput;
        Query.ParamByName('MyOutText').DataType := ftMemo;  // also ftWideMemo with Unicode settings on;
        Query.ParamByName('MyOutText').ParamType := ptOutput;

        Query.Execute;
        WriteLn('');
        WriteLn(' Input: ' + Query.ParamByName('MyInText').AsString);
        WriteLn('Output: ' + Query.ParamByName('MyOutText').AsString);
        if Query.ParamByName('MyInText').AsString = Query.ParamByName('MyOutText').AsString then
          WriteLn(' Correct Results')
        else
          WriteLn(' ++++++ ERROR ++++++ ');

        Query.ParamByName('MyInText').AsString := '';
        Query.Execute;
        WriteLn('');
        WriteLn(' Input: ' + Query.ParamByName('MyInText').AsString);
        WriteLn('Output: ' + Query.ParamByName('MyOutText').AsString);
        if Query.ParamByName('MyInText').AsString = Query.ParamByName('MyOutText').AsString then
          WriteLn(' Correct Results')
        else
          WriteLn(' ++++++ ERROR ++++++ ');

        Query.ParamByName('MyInText').AsString := 'Different Text';
        Query.Execute;
        WriteLn('');
        WriteLn(' Input: ' + Query.ParamByName('MyInText').AsString);
        WriteLn('Output: ' + Query.ParamByName('MyOutText').AsString);
        if Query.ParamByName('MyInText').AsString = Query.ParamByName('MyOutText').AsString then
          WriteLn(' Correct Results')
        else
          WriteLn(' ++++++ ERROR ++++++ ');

        WriteLn('');
        Write('Press Enter to exit: ');
        ReadLn;

      finally
        Query.Free;
      end;
Output is:
Input: Some Text
Output: Some Text
Correct Results

Input:
Output:
Correct Results

Input: Different Text
Output:
++++++ ERROR ++++++

Let me know if you can't reproduce this. Thanks.

AlexP
Devart Team
Posts: 5530
Joined: Tue 10 Aug 2010 11:35

Re: Possible bug with ftMemo bind variable.

Post by AlexP » Thu 11 Feb 2016 09:34

Hello,

Thank you for the sample. We have reproduce the issue and will investigate the reasons for such behavior.

AlexP
Devart Team
Posts: 5530
Joined: Tue 10 Aug 2010 11:35

Re: Possible bug with ftMemo bind variable.

Post by AlexP » Fri 12 Feb 2016 10:10

We have already fixed the problem. The fix will be included in the next version.

Post Reply