Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

columns aliases duplicates should not be allowed. automatic aliasing required. #6723

Closed
monetdb-team opened this issue Nov 30, 2020 · 0 comments
Labels
bug Something isn't working normal SQL

Comments

@monetdb-team
Copy link

Date: 2019-07-02 17:08:10 +0200
From: daniel.zvinca
To: SQL devs <>
Version: 11.33.3 (Apr2019)
CC: martin.van.dinther, @njnes

Last updated: 2020-06-03 16:58:52 +0200

Comment 27102

Date: 2019-07-02 17:08:10 +0200
From: daniel.zvinca

User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/75.0.3770.100 Safari/537.36
Build Identifier:

because duplicate names are allowed in queries (also in subqueries), any select on a subquery that has duplicates will fail.

Reproducible: Always

Steps to Reproduce:

1.select 1 as T, 2 as T;

result:
+------+------+
| t | t |
+======+======+
| 1 | 2 |
+------+------+

  1. select a.* from (select 1 as T, 2 as T) a;
    fails with error:
    Duplicate column name 'a.t'

The following also fails

select a.* from (select 1,2,3 as "L2") a;
fails with error:
Duplicate column name 'a.L2'

Expected Results:

I would expect a similar behavior with other SQL engines: automatic aliasing for columns with identical name.

Comment 27104

Date: 2019-07-03 13:58:54 +0200
From: MonetDB Mercurial Repository <>

Changeset 38951eeadde0 made by Martin van Dinther martin.van.dinther@monetdbsolutions.com in the MonetDB repo, refers to this bug.

For complete details, see https//devmonetdborg/hg/MonetDB?cmd=changeset;node=38951eeadde0

Changeset description:

Add test for bug #6723

Comment 27415

Date: 2019-11-20 10:38:29 +0100
From: @njnes

fix for labels has been added to the sq2default branch. Soon into default.
More fixes for the duplicate names are coming, allowing (useless) duplicate names at the result level. With in queries this will still need to fail.

Comment 27416

Date: 2019-11-20 10:39:46 +0100
From: MonetDB Mercurial Repository <>

Changeset 3e4b46fe6ec7 made by Niels Nes niels@cwi.nl in the MonetDB repo, refers to this bug.

For complete details, see https//devmonetdborg/hg/MonetDB?cmd=changeset;node=3e4b46fe6ec7

Changeset description:

add handling of duplicate column names at the result level, ie internaly rename
(label) expressions. Only use the alias on the result (when possible).
Solves bug #6723

Comment 27507

Date: 2020-01-08 17:56:41 +0100
From: Martin van Dinther <<martin.van.dinther>>

The fix was done in sq2default branch (which is merged into the default branch) and not in Nov2019-SP1 branch. Hence the fix will be included in the next feature release.

@monetdb-team monetdb-team added bug Something isn't working normal SQL labels Nov 30, 2020
@sjoerdmullender sjoerdmullender added this to the Ancient Release milestone Feb 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working normal SQL
Projects
None yet
Development

No branches or pull requests

2 participants