Hi,

I am not sure if I found a bug in SQLite version 3.31.1 and 3.32. Could you
please check?

CREATE TABLE t (
  textid TEXT
);
INSERT INTO t
VALUES ('12');
INSERT INTO t
VALUES ('34');
CREATE TABLE i (
  intid INTEGER PRIMARY KEY
);
INSERT INTO i
VALUES (12);
INSERT INTO i
VALUES (34);
CREATE TABLE e (
  x INTEGER PRIMARY KEY NOT NULL,
  y TEXT                NOT NULL
);
-- Original query
select t1.textid a, i.intid b
from t t1,
     i i
where ((t1.textid = i.intid) and (t1.textid = 12));
-- Buggy query
select t1.textid a, i.intid b
from t t1,
     i i
where (((t1.textid = i.intid) and (t1.textid in (12)) and (t1.textid =
i.intid)) or ((t1.textid = null) IS NOT FALSE))
group by i.intid, t1.textid;

The result for the original query is 12|12 but the result for the buggy one
is 12|12, 34|12, 12|34, 34|34. If I change the IS NOT FALSE to IS TRUE, the
result will be 12|12, same to the original query.

Thanks!

Best,
Xinyue Chen
_______________________________________________
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to