Hi,

when performing a simple join and duplicating the where clause I get invalid 
rows back.

SQLite version 3.25.2

CREATE TABLE user ( id INTEGER NOT NULL, active INTEGER NOT NULL, account 
INTEGER, PRIMARY KEY(id) );
CREATE TABLE account ( id INTEGER NOT NULL, name TEXT, PRIMARY KEY(id) );
INSERT INTO user VALUES (1, 0, 1);
INSERT INTO account VALUES (1, 'test');

-- returns user 1, expecting no results
SELECT user.id FROM user INNER JOIN account ON user.account = account.id WHERE 
user.active = 1 AND user.active = 1;
-- returns user 1, expecting no results
SELECT user.id FROM user INNER JOIN account ON user.account = account.id WHERE 
user.active = True AND user.active = True;
-- returns no results, expecting no results
SELECT user.id FROM user INNER JOIN account ON user.account = account.id WHERE 
user.active is True AND user.active is True;

INSERT INTO user VALUES (2, 1, 2);
INSERT INTO account VALUES (2, '');

-- returns [1, 2], expecting 1
SELECT user.id FROM user INNER JOIN account ON user.account = account.id WHERE 
user.active = 1 AND user.active = 1;

This only affects the in-memory db, file based is working correctly. Do I miss 
something?

Regards
Sebastian
_______________________________________________
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to