SELECT "foo"."id",
T3."name"
FROM "foo"
INNER JOIN "bar" T3 ON ("foo"."bar_id" = T3."id")
WHERE ("foo"."tenant_id" = 1
AND "foo"."bar_id" = 2
AND T3."tenant_id" = 1);
Observed query:
SELECT "foo"."id",
T3."name"
FROM "foo"
INNER JOIN "bar" T3 ON ("foo"."bar_id" = T3."id")
WHERE ("foo"."tenant_id" = 1
AND "foo"."bar_id" = 2
AND "T3"."tenant_id" = 1); -- quotes around "T3" here breaks table alias
Expected query:
Observed query: