You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Unable to use database filters on inner joins for nullable foreign keys
e.g.
from("tableA").select(", tableB()").eq("tableB.column", value) --> works
from("tableA").select(", tableB()").neq("tableB.column", value) --> does not work, always empty
To Reproduce
Schema:
create table "public"."cities" (
"id" uuid not null default gen_random_uuid(),
"created_at" timestamp with time zone not null default now(),
"country_id" uuid not null,
"name" text not null
);
create table "public"."countries" (
"id" uuid not null default gen_random_uuid(),
"created_at" timestamp with time zone not null default now(),
"active" boolean not null default true,
"name" text not null,
"random_id" uuid
);
create table "public"."random" (
"id" uuid not null default gen_random_uuid(),
"created_at" timestamp with time zone not null default now()
);
CREATE UNIQUE INDEX cities_pkey ON public.cities USING btree (id);
CREATE UNIQUE INDEX countries_pkey ON public.countries USING btree (id);
CREATE UNIQUE INDEX random_pkey ON public.random USING btree (id);
alter table "public"."cities" add constraint "cities_pkey" PRIMARY KEY using index "cities_pkey";
alter table "public"."countries" add constraint "countries_pkey" PRIMARY KEY using index "countries_pkey";
alter table "public"."random" add constraint "random_pkey" PRIMARY KEY using index "random_pkey";
alter table "public"."cities" add constraint "public_cities_country_id_fkey" FOREIGN KEY (country_id) REFERENCES countries(id) not valid;
alter table "public"."cities" validate constraint "public_cities_country_id_fkey";
alter table "public"."countries" add constraint "public_countries_random_id_fkey" FOREIGN KEY (random_id) REFERENCES random(id) not valid;
alter table "public"."countries" validate constraint "public_countries_random_id_fkey";
Bug report
Describe the bug
Unable to use database filters on inner joins for nullable foreign keys
e.g.
from("tableA").select(", tableB()").eq("tableB.column", value) --> works
from("tableA").select(", tableB()").neq("tableB.column", value) --> does not work, always empty
To Reproduce
Schema:
Test Code
Output
Expected behavior
use neq random, expect canada cities --> should return canadian cities
Screenshots
If applicable, add screenshots to help explain your problem.
System information
Additional context
Add any other context about the problem here.
The text was updated successfully, but these errors were encountered: