This is an automated email from the ASF dual-hosted git repository.
morningman pushed a commit to branch branch-1.1-lts
in repository https://gitbox.apache.org/repos/asf/doris.git
The following commit(s) were added to refs/heads/branch-1.1-lts by this push:
new 95be319f31 [fix](planner) forbid inline view but not the subquery
resolve from parent tuples (#18136)
95be319f31 is described below
commit 95be319f31e4933b2a74ed0b384ba4f73e342285
Author: morrySnow <[email protected]>
AuthorDate: Thu Mar 30 16:13:07 2023 +0800
[fix](planner) forbid inline view but not the subquery resolve from parent
tuples (#18136)
pick from #18032 on master branch
---
fe/fe-core/src/main/java/org/apache/doris/analysis/Analyzer.java | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/fe/fe-core/src/main/java/org/apache/doris/analysis/Analyzer.java
b/fe/fe-core/src/main/java/org/apache/doris/analysis/Analyzer.java
index 274170693e..cf6c543ec7 100644
--- a/fe/fe-core/src/main/java/org/apache/doris/analysis/Analyzer.java
+++ b/fe/fe-core/src/main/java/org/apache/doris/analysis/Analyzer.java
@@ -143,6 +143,7 @@ public class Analyzer {
// Flag indicating if this analyzer instance belongs to a subquery.
private boolean isSubquery = false;
+ private boolean isFirstScopeInSubquery = false;
// Flag indicating if this analyzer instance belongs to an inlineview.
private boolean isInlineView = false;
@@ -167,6 +168,7 @@ public class Analyzer {
public void setIsSubquery() {
isSubquery = true;
+ isFirstScopeInSubquery = true;
globalState.containsSubquery = true;
}
@@ -789,7 +791,7 @@ public class Analyzer {
* This column could not be resolved because doris can only resolved
the parent column instead of grandpa.
* The exception of this query like that: Unknown column 'k1' in 'a'
*/
- if (d == null && hasAncestors() && isSubquery) {
+ if (d == null && hasAncestors() && isSubquery &&
isFirstScopeInSubquery) {
// analyzer father for subquery
if (newTblName == null) {
d = getParentAnalyzer().resolveColumnRef(colName);
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]