[MDEV-19678] Unknown Column in 'having clause' on qualified access Created: 2019-06-03 Updated: 2022-11-29 |
|
| Status: | Confirmed |
| Project: | MariaDB Server |
| Component/s: | Parser |
| Affects Version/s: | 5.5, 10.1, 10.4.5, 10.2, 10.3, 10.4, 10.5, 10.6, 10.7, 10.8, 10.9, 10.10 |
| Fix Version/s: | 10.4 |
| Type: | Bug | Priority: | Major |
| Reporter: | - | Assignee: | Oleksandr Byelkin |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | parser, sql, upstream-fixed | ||
| Environment: |
MariaDB 10.4.5-bionic in Docker on Ubuntu 19.04 |
||
| Description |
|
When I execute the following Code, I get the error message "Unknown column 'B.AJ' in 'having clause'". I expect that the column can be found (like in the GROUP BY clause or in the examples below) and the sql query can be executed properly.
If I delete the HAVING clause completely, the statement gets executed, so it knows the column name in the group by clause.
Additionally, If I use SUM(B.AJ) (and SUM(C.AJ)) instead, everything works fine and the query can be executed.
If I use the exact same condition in a WHERE clause, it also works properly:
|
| Comments |
| Comment by Elena Stepanova [ 2019-06-03 ] |
|
Reproducible on all of MariaDB 5.5-10.4 and MySQL 5.6. |