Description
The optimizer has been found to create logically incorrect query plans in some cases, which can cause incorrect query results. The bug can only occur in queries with an inner join, e.g.,t1 JOIN t2, if all of the following are true:
- The join contains an equality condition between columns of both tables, e.g.,
t1.a = t2.a. - A query filter or
CHECKconstraint constrains a column to a set of specific values, e.g.,t2.b IN (1, 2, 3). In the case of aCHECKconstraint, the column must beNOT NULL. - A query filter or
CHECKconstraint constrains a column to a range, e.g.,t2.c > 0. In the case of aCHECKconstraint, the column must beNOT NULL. - An index contains a column from each of the criteria above, e.g.,
INDEX t2(a, b, c).

