Page 1 of 1

Error on filtering Null values locally

Posted: Wed 15 Oct 2014 08:11
by CISDL
We wanted to filter a SmartQuery locally, so we set a filter expression like 'UPPER(MyColumn) like UPPER(MyValue)'.

When it comes to null values in the Column "MyColumn" an
“Could not convert variant of type (Null) into type (OleStr)” exception raises.

As we debugged, it seems the error occurs in MemData.pas in

Code: Select all

function TData.Eval(Node: TExpressionNode): boolean;
between the lines 5807 and 5813:

Code: Select all

  if (Node.LeftOperand.NodeType in [ntField, ntValue]) and Assigned(Node.LeftOperand.LeftOperand) then
    case Node.LeftOperand.LeftOperand.NodeType of
      ntLower:
        V1 := AnsiLowerCase(V1);
      ntUpper:
        V1 := AnsiUpperCase(V1);
    end;
So if the field value is a null value the AnsiLowerCase statement trys to convert and the described error occurs. I believe a simple AnsiLowerCase(VarToStr(V1)) instead of AnsiLowerCase(V1) could fix the problem.

Re: Error on filtering Null values locally

Posted: Wed 15 Oct 2014 09:30
by AlexP
Hello,

Thank you, we will add the appropriate changes to support null value.

Re: Error on filtering Null values locally

Posted: Wed 15 Oct 2014 11:02
by CISDL
Thank you for your fast response.
So the fix will be included in the next version which should be 9.4.13, right?
If so, in my opinion the topic can be closed.

Thank you!

Re: Error on filtering Null values locally

Posted: Wed 15 Oct 2014 12:18
by AlexP
Yes, this fix will be included in the next ODAC build.