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

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


The following commit(s) were added to refs/heads/branch-3.1 by this push:
     new e0a2845bfe6 branch-3.1: [fix](temp_table) temp table should not 
present in sys tables #55334 (#55418)
e0a2845bfe6 is described below

commit e0a2845bfe6c1e004c619c6c575a37688ccdfad2
Author: github-actions[bot] 
<41898282+github-actions[bot]@users.noreply.github.com>
AuthorDate: Fri Aug 29 00:02:01 2025 +0800

    branch-3.1: [fix](temp_table) temp table should not present in sys tables 
#55334 (#55418)
    
    Cherry-picked from #55334
    
    Co-authored-by: morrySnow <[email protected]>
---
 .../src/main/java/org/apache/doris/service/FrontendServiceImpl.java | 6 ++++++
 regression-test/suites/temp_table_p0/test_temp_table.groovy         | 6 ++++++
 2 files changed, 12 insertions(+)

diff --git 
a/fe/fe-core/src/main/java/org/apache/doris/service/FrontendServiceImpl.java 
b/fe/fe-core/src/main/java/org/apache/doris/service/FrontendServiceImpl.java
index 67882a209a8..8f7e3613f69 100644
--- a/fe/fe-core/src/main/java/org/apache/doris/service/FrontendServiceImpl.java
+++ b/fe/fe-core/src/main/java/org/apache/doris/service/FrontendServiceImpl.java
@@ -654,6 +654,9 @@ public class FrontendServiceImpl implements 
FrontendService.Iface {
                         }
                     }
                     for (TableIf table : tables) {
+                        if (table.isTemporary()) {
+                            continue;
+                        }
                         if (!Env.getCurrentEnv().getAccessManager()
                                 .checkTblPriv(currentUser, catalogName, dbName,
                                         table.getName(), PrivPredicate.SHOW)) {
@@ -966,6 +969,9 @@ public class FrontendServiceImpl implements 
FrontendService.Iface {
         if (db != null) {
             for (String tableName : tables) {
                 TableIf table = db.getTableNullableIfException(tableName);
+                if (table.isTemporary()) {
+                    continue;
+                }
                 if (table != null) {
                     table.readLock();
                     try {
diff --git a/regression-test/suites/temp_table_p0/test_temp_table.groovy 
b/regression-test/suites/temp_table_p0/test_temp_table.groovy
index fe6699c3cf0..b09875c96a8 100644
--- a/regression-test/suites/temp_table_p0/test_temp_table.groovy
+++ b/regression-test/suites/temp_table_p0/test_temp_table.groovy
@@ -122,6 +122,12 @@ suite('test_temp_table', 'p0') {
     }
     assertFalse(hasTempTable)
 
+    def info_tables = "select * from information_schema.tables where 
table_name = 't_test_temp_table2'"
+    assertEquals(0, info_tables.size())
+    def info_columns = "select * from information_schema.columns  where 
table_name = 't_test_temp_table2'"
+    assertEquals(0, info_columns.size())
+
+
     // will create a normal olap table, not temporary table, even if source 
table is temporary
     sql "drop table if exists t_test_table3_0"
     sql "create table t_test_table3_0 like t_test_temp_table3"


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

Reply via email to