Add support for "some_col = ? or ? IS NULL" conditions [CORE2298] #2722
Submitted by: Roman Rokytskyy (rrokytskyy)
Is related to QA319
This construct is very often used to switch on/off some part of the search condition, especially in filtering on per-column basis:
In Delphi you would have something like this:
WHERE col1 = :param1 OR :param1 IS NULL
IBO or other components pre-processes this query and replace the :param1 with ? marks and later simply set the correct values to different parameters.
The idea is to introduce new data type and change Firebird to return the columns data type for the first parameter and a newly created one (SQL_NULL) for the second parameter. Firebird would need to detect such constructs and act accordingly.
If the "param1" is not NULL, driver/application is required to set the correct data for the first parameter and set the XSQLVAR.sqlind to not null and leave XSQLVAR.sqldata empty/null.
If the "param2" is NULL, driver/application is required to set the XSQLVAR.sqlind of the first and second parameters to null and leave the XSQLVAR.sqldata empty/null.
====== Test Details ======
See test for CORE3076
The text was updated successfully, but these errors were encountered: