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

Crash using order by alias in subquery #6527

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

Crash using order by alias in subquery #6527

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

Comments

@monetdb-team
Copy link

Date: 2018-01-31 00:15:17 +0100
From: Trevor <>
To: SQL devs <>
Version: 11.27.11 (Jul2017-SP3)
CC: @njnes

Last updated: 2018-02-12 16:12:09 +0100

Comment 26138

Date: 2018-01-31 00:15:17 +0100
From: Trevor <>

User-Agent: Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:58.0) Gecko/20100101 Firefox/58.0
Build Identifier:

A crash occurs when using an alias to a column in a subquery.

See the example below:

create table "t1" ("d1" int);
insert into "t1" values (1), (2), (3), (4), (5);

-- Works
select
"d1" as "value"
from "t1"
order by "value";

-- Works
select
a."value"
from (
select
"d1" as "value"
from "t1"
order by "d1"
) as a;

-- Crashes
select
a."value"
from (
select
"d1" as "value"
from "t1"
order by "value"
) as a;

From merovingian.log:
2018-01-30 17:10:15 ERR test[26999]: could not find L2.value
2018-01-30 17:10:15 ERR test[26999]: t1.d1
2018-01-30 17:10:15 ERR test[26999]: a.value
2018-01-30 17:10:15 ERR test[26999]: *** Error in `/usr/bin/mserver5': double free or corruption (out): 0x00007f95980cb810 ***

Reproducible: Always

Steps to Reproduce:

Run the queries in the details.

Actual Results:

Database crashes.

Expected Results:

Query should complete.

Comment 26151

Date: 2018-01-31 18:53:29 +0100
From: @njnes

fixed problem with table aliases

Comment 26152

Date: 2018-01-31 21:53:32 +0100
From: MonetDB Mercurial Repository <>

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

Changeset description:

fixed bug #6527 (be more carefull with order by and table aliases)
@monetdb-team monetdb-team added bug Something isn't working major 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 major SQL
Projects
None yet
Development

No branches or pull requests

2 participants