Closed SvenSeemann closed 3 years ago
Hi,
Wops... that is a huge bug (I hate silent bugs).
I narrowed it down... it seems to happen when there is one of your OR
operands that evaluates to NULL
.
CREATE TABLE IF NOT EXISTS test(
id varchar(100) not null,
val text
);
INSERT INTO test(id, val) VALUES ('a', null), ('b', 'row b');
SELECT * FROM test
WHERE id in ('a', 'b') OR val = 'SOMETHING_IRRELEVANT';
👉 This only returns row B
This is too important not to be fixed right now, I just shipped pg-mem@1.9.11
which should solve this.
Reopen if it is not the case !
Thanks for this report 😱
Hey,
I'm building a test case for my app and it occurred that there is different behaviour when executing a query with pg-mem and a postgres docker container.
I create my table and fill it with some test values:
My tests case then basically runs this query (which should return the second row):
Running this query with pg-mem returns an empty result, running the same code on a postgres docker container returns the second row (as expected).
Here is the example code to display the different behaviour: https://github.com/SvenSeemann/pg-mem-bug