fix feature-service bug#1581
Conversation
Problem
For example: SELECT derived.id
FROM (
SELECT id FROM constraint_requires
UNION ALL
SELECT id FROM constraint_excludes
) derived
WHERE derived.id = 2The previous implementation called ParenthesedSelect#getPlainSelect(). However, a UNION query is represented by a SetOperationList, so getPlainSelect() can return null, resulting in a NullPointerException. The alias was also read from the inner FROM item, although derived belongs to the enclosing ParenthesedSelect. FixThe alias is now read directly from the ParenthesedSelect. Parenthesized subqueries are represented as UNNAMED_TABLE, and their aliases are mapped to that value. This avoids incorrectly assuming that every parenthesized SELECT contains a PlainSelect and allows qualified columns such as derived.id to be resolved correctly. |
No description provided.