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

complex(?) query forgets(?) column name #6443

Closed
monetdb-team opened this issue Nov 30, 2020 · 0 comments
Closed

complex(?) query forgets(?) column name #6443

monetdb-team opened this issue Nov 30, 2020 · 0 comments

Comments

@monetdb-team
Copy link

@monetdb-team monetdb-team commented Nov 30, 2020

Date: 2017-10-22 19:22:38 +0200
From: @drstmane
To: SQL devs <>
Version: 11.27.5 (Jul2017-SP1)
CC: @njnes

Last updated: 2017-12-14 14:46:03 +0100

Comment 25783

Date: 2017-10-22 19:22:38 +0200
From: @drstmane

Using the Jul2017-SP2 release candidate,
in the below example,
the first query works fine,
while the second one fails with "SELECT: identifier 'c' unknown",
which it IMHO should not.

start transaction;
create table "t" ( "c" int );
insert into "t" values (1),(2);
select * from "t";

-- works fine:
select
(
sum(
("c" - (select avg("c") from "t"))
*
("c" - (select avg("c") from "t"))
)
-- /
-- (select count("c") from "t")
)
/
(
stddev_pop(c)
*
stddev_pop(c)
)
/
(select count("c") from "t")
from
"t"
;

-- FAILS with "SELECT: identifier 'c' unknown"
select
(
sum(
("c" - (select avg("c") from "t"))
*
("c" - (select avg("c") from "t"))
)
/
(select count("c") from "t")
)
/
(
stddev_pop(c)
*
stddev_pop(c)
)
-- /
-- (select count("c") from "t")
from
"t"
;

rollback;

Comment 25908

Date: 2017-11-26 10:05:38 +0100
From: @njnes

fixed, we now keep the value returning 'relational expressions' in a dag of seperate relational operators (not a one big relation). This simplifies a lot (more simplification is still required)

Comment 25909

Date: 2017-11-26 10:06:33 +0100
From: MonetDB Mercurial Repository <>

Changeset df058ebf2575 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=df058ebf2575

Changeset description:

fixed bug #6443, keep value returning subqueries in a seperate list.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
1 participant