vinson0526 opened a new issue #6002:
URL: https://github.com/apache/incubator-doris/issues/6002


   **Describe the bug**
   Some toSql function generate incorrect sql because expand star used wrong 
table name in SelectStmt
   
   **To Reproduce**
   create a view and show create table on it
   
   1. create table like that
   `create table foo(bar int)`
   2. create view like that
   `create view v as select * from foo`
   3. show create table
   `show create table v`
   4. the result is like that
   ```
   *************************** 1. row ***************************
                   View: v
            Create View: CREATE VIEW `v` AS SELECT 
`default_cluster:default.foo`.`bar` AS `bar` FROM 
`default_cluster:default`.`foo`;
   character_set_client: utf8
   collation_connection: utf8_general_ci
   1 row in set (0.01 sec)
   ```
   
   **Expected behavior**
   correct sql should be
   ```
   CREATE VIEW `v` AS SELECT `default_cluster:default`.`foo`.`bar` AS `bar` 
FROM `default_cluster:default`.`foo`;
   ```
   


-- 
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.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org
For additional commands, e-mail: commits-h...@doris.apache.org

Reply via email to