[MDEV-16472] column aliases no longer available in joins Created: 2018-06-12  Updated: 2018-06-14  Resolved: 2018-06-14

Status: Closed
Project: MariaDB Server
Component/s: Data Manipulation - Subquery
Affects Version/s: 10.3.7
Fix Version/s: N/A

Type: Bug Priority: Major
Reporter: antoine Assignee: Alice Sherepa
Resolution: Duplicate Votes: 1
Labels: None
Environment:

debian9, tokudb


Issue Links:
Duplicate
duplicates MDEV-16420 View stop working after upgrade from ... Closed

 Description   

after upgrading to 10.3.7 from 10.2.something, some select queries that used no work no longer do

it seems that, in some cases but not always, where a subselect uses aliases for some of its fields and there is a join using those aliases, the alias isn't known and an error 'unknown column xxx in on clause' is thrown

example: the following could throw an error "column alias1 in on clause unknown" under 10.3.7 but would work under 10.2.xx

select *
from A
join ( select f1 as alias1, f2 as alias2 ) B on A.f1=B.alias1

whereas this one would work:

select *
from A
join ( select f1, f2 as alias2 ) B on A.f1=B.f1

more detailed examples here:
https://stackoverflow.com/questions/50766797/unknown-column-in-on-clause-column-alias-is-probably-causing-error/50816354#50816354



 Comments   
Comment by Alice Sherepa [ 2018-06-13 ]

It looks like it is the same problem as MDEV-16420.

Comment by antoine [ 2018-06-14 ]

yes indeed it does seem to be the same issue, thanks

Generated at Thu Feb 08 08:29:11 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.