morrySnow commented on code in PR #37879: URL: https://github.com/apache/doris/pull/37879#discussion_r1683934639
########## fe/fe-core/src/main/java/org/apache/doris/datasource/InternalCatalog.java: ########## @@ -1259,14 +1259,22 @@ public void createTableLike(CreateTableLikeStmt stmt) throws DdlException { } finally { table.readUnlock(); } - CreateTableStmt parsedCreateTableStmt = (CreateTableStmt) SqlParserUtils.parseAndAnalyzeStmt( - createTableStmt.get(0), ConnectContext.get()); - parsedCreateTableStmt.setTableName(stmt.getTableName()); - parsedCreateTableStmt.setIfNotExists(stmt.isIfNotExists()); - createTable(parsedCreateTableStmt); + try { + // analyze CreateTableStmt will check create_priv of existedTable, create table like only need + // create_priv of newTable, and select_priv of existedTable, and priv check has done in + // CreateTableStmt/CreateTableCommand, so we skip it + ConnectContext.get().setSkipAuth(true); Review Comment: check ConnectContext.get() != null -- 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: commits-unsubscr...@doris.apache.org 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