shuke987 opened a new pull request, #66956:
URL: https://github.com/apache/doris/pull/66956

   ### What problem does this PR solve?
   
   Issue Number: N/A
   
   Related PR: #66112
   
   Problem Summary:
   
   `CREATE TEMPORARY TABLE ... AS SELECT` is allowed to use the same display
   name as an ordinary table or a temporary table owned by another session.
   The target-existence preflight added in #66112 looked up that display name
   directly, so it could report `Table already exists` before catalog creation
   translated the target to the current session's internal temporary-table
   name.
   
   This was observed in the muted Cloud P0 `test_temp_table` occurrence from
   [build 
1026654](http://43.132.222.7:8111/buildConfiguration/Doris_DorisRegression_CloudP0/1026654?buildTab=tests&status=muted):
 a second connection could not create
   its session-local `t_test_temp_table1` because an ordinary table with that
   display name existed.
   
   The fix makes the CTAS preflight use the same session-scoped internal name
   as temporary-table creation. A focused FE unit test verifies that the
   ordinary display name is not probed for temporary CTAS.
   
   ### Release note
   
   None
   
   ### Check List (For Author)
   
   - Test
       - [x] Unit Test
         - `./run-fe-ut.sh --run 
org.apache.doris.nereids.trees.plans.commands.CreateTableCommandTest`
         - 4 tests passed, 0 failures/errors
       - [ ] Regression test
         - The existing `temp_table_p0/test_temp_table.groovy` case covers the 
exact cross-session flow; no local Doris cluster was available for a runtime 
rerun.
       - [ ] Manual test
   - Behavior changed:
       - [x] Yes. Temporary CTAS now checks only the current session's target,
             allowing same-named ordinary tables and other sessions' temporary
             tables to coexist as designed.
   - Does this need documentation?
       - [x] No.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


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

Reply via email to