PDM API - IEdmSearch8 unexpected search results

Is anyone able to replicate this?  I'm currently on version 2019 SP5.

I'm creating a search with the following parameters:

        Dim search As IEdmSearch8 = vault.CreateSearch
        search.FindFiles = True
        search.FindFolders = False
        search.Recursive = True
        search.FindLockedFiles = True
        search.FindUnlockedFiles = True
        search.StartFolderID = vault.GetFolderFromPath(FOLDER_NAME).ID
        search.SetToken(EdmSearchToken.Edmstok_AllVersions, False)
        search.AddVariable2(VAR_NAME, VAR_VALUE, EdmVarOp.EdmVarOp_StringEqualTo)

When searching for a string variable value using the options EdmVarOp_StringEqualTo, if the value begins with the letter "N", I get no search results.

If I use the EdmVarOp_StringContains option, the search returns results as expected.

It is incredibly bizarre.

Comments 2
AB
AB 2021-06-04

I saw something like this a while back that was solved with using CreateSearch2 instead of CreateSearch.

https://cadforum.net/viewtopic.php?f=25&t=443&p=5240&hilit=createsearch2#p5240​​​​​​​

JS
JS 2021-06-04

I can duplicate this behavior with PDM2021. 

It's not so bizarre if you consider that the character 'N' has a special meaning in T-SQL when placed before a string literal.  Of course, the API should be properly handling this, but my suspicion is that they are passing arguments to a stored procedure that is misinterpreting the leading 'N'.