This is an automated email from the ASF dual-hosted git repository.

morrysnow pushed a commit to branch branch-2.1
in repository https://gitbox.apache.org/repos/asf/doris.git


The following commit(s) were added to refs/heads/branch-2.1 by this push:
     new 490e04a88aa branch-2.1: [fix](Nereids) bind schema table qualified 
column failed #46960 (#47156)
490e04a88aa is described below

commit 490e04a88aa19c6baf56eb627561ab82eef9ca58
Author: github-actions[bot] 
<41898282+github-actions[bot]@users.noreply.github.com>
AuthorDate: Fri Jan 17 17:30:10 2025 +0800

    branch-2.1: [fix](Nereids) bind schema table qualified column failed #46960 
(#47156)
    
    Cherry-picked from #46960
    
    Co-authored-by: morrySnow <[email protected]>
---
 .../java/org/apache/doris/nereids/rules/analysis/BindRelation.java    | 4 +++-
 regression-test/suites/nereids_syntax_p0/information_schema.groovy    | 2 +-
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git 
a/fe/fe-core/src/main/java/org/apache/doris/nereids/rules/analysis/BindRelation.java
 
b/fe/fe-core/src/main/java/org/apache/doris/nereids/rules/analysis/BindRelation.java
index 63ed75684d7..d412348973f 100644
--- 
a/fe/fe-core/src/main/java/org/apache/doris/nereids/rules/analysis/BindRelation.java
+++ 
b/fe/fe-core/src/main/java/org/apache/doris/nereids/rules/analysis/BindRelation.java
@@ -416,7 +416,9 @@ public class BindRelation extends OneAnalysisRuleFactory {
                             qualifierWithoutTableName, 
unboundRelation.getTableSample(),
                             unboundRelation.getTableSnapshot());
                 case SCHEMA:
-                    return new 
LogicalSchemaScan(unboundRelation.getRelationId(), table, 
qualifierWithoutTableName);
+                    // schema table's name is case-insensitive, we need save 
its name in SQL text to get correct case.
+                    return new LogicalSubQueryAlias<>(qualifiedTableName,
+                            new 
LogicalSchemaScan(unboundRelation.getRelationId(), table, 
qualifierWithoutTableName));
                 case JDBC_EXTERNAL_TABLE:
                 case JDBC:
                     return new 
LogicalJdbcScan(unboundRelation.getRelationId(), table, 
qualifierWithoutTableName);
diff --git a/regression-test/suites/nereids_syntax_p0/information_schema.groovy 
b/regression-test/suites/nereids_syntax_p0/information_schema.groovy
index 59ab91ab97d..a86146b559e 100644
--- a/regression-test/suites/nereids_syntax_p0/information_schema.groovy
+++ b/regression-test/suites/nereids_syntax_p0/information_schema.groovy
@@ -27,5 +27,5 @@ suite("information_schema") {
 
     // INFORMATION_SCHEMA
     sql "SELECT table_name FROM INFORMATION_SCHEMA.TABLES where 
table_schema=\"test%\" and TABLE_TYPE = \"BASE TABLE\" order by table_name"
-    sql "SELECT COLUMN_NAME, DATA_TYPE, IS_NULLABLE, COLUMN_DEFAULT FROM 
INFORMATION_SCHEMA.COLUMNS WHERE table_name = \"test%\" AND column_name LIKE 
\"k%\""
+    sql "SELECT COLUMNS.COLUMN_NAME, DATA_TYPE, IS_NULLABLE, COLUMN_DEFAULT 
FROM INFORMATION_SCHEMA.COLUMNS WHERE table_name = \"test%\" AND column_name 
LIKE \"k%\""
 }


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to