Subject | Re: [firebird-support] Re: NOT IN + sub-select + null value + inner join + index = bug ? |
---|---|
Author | Helen Borrie |
Post date | 2005-02-18T08:43:25Z |
At 06:36 AM 18/02/2005 +0000, you wrote:
milk!!
Replace this predicate with "WHERE NOT EXISTS(SELECT 1 FROM...". Not only
will the logic (and any potential illogic) be more obvious, but the
subquery will use an index if one is available.
Also, be very clear that the logic you dish out in your SQL is actually
exactly what you plan. There are usually better ways to arrive at at the
excluded set than to NOT its (apparent) opposite. Not is not always
not! Only True can be counted on to be true; False can be either false or
unknown.
Just a request to you, please. Don't use our bug tracker for your support
questions. That is NOT what the bug tracker is for. This is an abuse of
the project facilities that makes work for the maintainers and a lot of
automated traffic in the technical lists.
You should report a bug only after you have received confirmation that a
bug is a possibility. The route for that is (usually) support list
first; then, if recommended here, post the bug description in
Firebird-devel. If you get confirmation there that you might be seeing a
bug, THEN add it- along with a full test case, including data - to the bug
tracker.
./hb
>Hello Helen,Don't try to use "NOT IN...". The potential logic errors could curdle the
>Thanks for your answer.
>I agree with your explanation about NULL state. The only thing i
>don't understand is that i have used the clause 'NOT IN',
milk!!
Replace this predicate with "WHERE NOT EXISTS(SELECT 1 FROM...". Not only
will the logic (and any potential illogic) be more obvious, but the
subquery will use an index if one is available.
Also, be very clear that the logic you dish out in your SQL is actually
exactly what you plan. There are usually better ways to arrive at at the
excluded set than to NOT its (apparent) opposite. Not is not always
not! Only True can be counted on to be true; False can be either false or
unknown.
Just a request to you, please. Don't use our bug tracker for your support
questions. That is NOT what the bug tracker is for. This is an abuse of
the project facilities that makes work for the maintainers and a lot of
automated traffic in the technical lists.
You should report a bug only after you have received confirmation that a
bug is a possibility. The route for that is (usually) support list
first; then, if recommended here, post the bug description in
Firebird-devel. If you get confirmation there that you might be seeing a
bug, THEN add it- along with a full test case, including data - to the bug
tracker.
./hb