Details
-
Bug
-
Status: Resolved
-
Major
-
Resolution: Fixed
-
1.11.0
-
My mac running the latest drill in embedded mode.
Description
If there are two tables in Postgres that share column names, incorrect results are returned when a join is done between the two tables.
For example if we have two tables: categories and categories2 with the following contents:
+----------------+--------------------++--------------- |categoryguid|categoryparentguid|categoryname| +----------------+--------------------++--------------- |id1|null|restaurants| |null|id1|food&Dining| |id2|null|Coffee Shops| |null|id2|food&Dining| +----------------+--------------------++---------------
Then the following join query returns incorrectly names columns and incorrect null values:
select cat.categoryname, cat2.categoryname from postgres.public.categories cat join postgres.public.categories2 cat2 on (cat.categoryguid = cat2.categoryguid) where cat.categoryguid IS NOT NULL;
+----------------+---------------+ |categoryname|categoryname0| +----------------+---------------+ |restaurants|null| |Coffee Shops|null| +----------------+---------------+