FirebirdSQL / firebird

Firebird server, client and tools
https://www.firebirdsql.org/
1.19k stars 204 forks source link

[FB5] Unusual behavior observed with the 'IN' clause. #8093

Closed AyrtonMendes closed 3 weeks ago

AyrtonMendes commented 3 weeks ago

I am using Firebird 5.0 to test our current application and we have encountered the following situation:

When using the query with IDs as integer, it returns all the requested existing IDs, as shown in the example:

SELECT *
FROM TEST_NEW_FIREBIRD_USER
WHERE
    TEST_NEW_FIREBIRD_USER.ID IN (1, 2, 3, 5, 10, 50, 35);
Results: ID NAME UUID
1 Noe Ratke 3fb12076-6c2d-4785-ad37-fc2ca532803e
2 Hester Kozey 6c5bf3b4-2d40-4279-9041-1a03dfa7950c
3 Mr. Enrique Schoen ceb684d4-fc6b-411f-bed2-38a4a709c993
5 Joanne Nicolas 2c3dd8c8-69e8-4972-a1ac-48498484ae2f
10 Porter Frami ced1274b-04bf-4112-8043-3f392473f167
35 Haley Connelly PhD 676577c9-2064-4eb6-8fe1-039f9ff14641
50 Dr. Kara Upton 998e4bb5-3713-40f2-85cb-4c177ece188e

However, when performing the same query on the same table, but using IDs as strings, the database simply ignores records. I couldn't identify a pattern, as shown in the example:

SELECT *
FROM TEST_NEW_FIREBIRD_USER
WHERE
    TEST_NEW_FIREBIRD_USER.ID IN ('1', '2', '3', '5', '10', '50', '35');
Results: ID NAME UUID
1 Noe Ratke 3fb12076-6c2d-4785-ad37-fc2ca532803e
50 Dr. Kara Upton 998e4bb5-3713-40f2-85cb-4c177ece188e

This behavior does not occur with our current version of Firebird 3.x.

aafemt commented 3 weeks ago

Duplication of #8086.