We've found some scopes generating bad sql, seems the change happened from the jump to v4->v5.
v4 generates the desired sql.
grammar is mssql.
repro and results we're seeing:
/*
writedump(getInstance("RMME_C").withFoo().toSql());
v4.1.3
SELECT [RMME_C].[id_c] FROM [RMME_C] WHERE (([id] = ? AND [id] != ?) OR ([id] = ? AND [id] != ?))
v5.2.0
SELECT [RMME_C].[id_c] FROM [RMME_C] WHERE [id] = ? AND [id] != ? AND [id] = ? AND [id] != ?
v5.2.7
SELECT [RMME_C].[id_c] FROM [RMME_C] WHERE [id] = ? AND [id] != ? AND [id] = ? AND [id] != ?
*/
We've found some scopes generating bad sql, seems the change happened from the jump to v4->v5.
v4 generates the desired sql.
grammar is mssql.
repro and results we're seeing: