findstate-tt reports on FIND when unique index is used

Have following code:

DEFINE TEMP-TABLE ttAccount NO-UNDO
FIELD Id AS CHARACTER
INDEX i1 IS UNIQUE PRIMARY Id.

FIND ttAccount WHERE ttAccount.Id = "xyz" NO-ERROR.

The findstate-tt rule reports this and suggests a "FIRST/LAST" or "IF AMBIGUOUS" but the index is UNIQUE.

Is this expected behaviour?


Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
jurjen's picture

Re: findstate-tt reports on FIND when unique index is used

> Is this expected behaviour?

You are right, this is a false positive.

Unfortunately it will be a time consuming challenge to fix this, the rule currently does not even try to analyze the temp-table definition... interesting puzzle for a long rainy day.


Re: findstate-tt reports on FIND when unique index is used

ooh. I was hoping that might be an easy one...

Should I log this as an issue?
Perhaps you will you never have long enough rainy day to add all that extra code.

At least it will be on the list of known issues...