From a185139b901450589ad16b9eed79e86925ccb2df Mon Sep 17 00:00:00 2001 From: obdev Date: Sun, 29 Jan 2023 16:41:26 +0800 Subject: [PATCH] fix mysqltest --- src/sql/optimizer/ob_log_link_dml.cpp | 17 +++++++++++++++++ src/sql/optimizer/ob_log_link_dml.h | 1 + .../r/mysql/cte_without_explain_mysql.result | 12 ++---------- 3 files changed, 20 insertions(+), 10 deletions(-) diff --git a/src/sql/optimizer/ob_log_link_dml.cpp b/src/sql/optimizer/ob_log_link_dml.cpp index ad7fb6a389..63a4486d9b 100644 --- a/src/sql/optimizer/ob_log_link_dml.cpp +++ b/src/sql/optimizer/ob_log_link_dml.cpp @@ -45,5 +45,22 @@ int ObLogLinkDml::get_explain_name_internal(char *buf, const int64_t buf_len, in return ret; } +int ObLogLinkDml::get_plan_item_info(PlanText &plan_text, + ObSqlPlanItem &plan_item) +{ + int ret = OB_SUCCESS; + if (OB_FAIL(ObLogicalOperator::get_plan_item_info(plan_text, plan_item))) { + LOG_WARN("failed to get plan item info", K(ret)); + } else { + BEGIN_BUF_PRINT; + if (OB_FAIL(get_explain_name_internal(buf, buf_len, pos))) { + LOG_WARN("failed to get explain name", K(ret)); + } + END_BUF_PRINT(plan_item.operation_, plan_item.operation_len_); + } + return ret; +} + + } // namespace sql } // namespace oceanbase diff --git a/src/sql/optimizer/ob_log_link_dml.h b/src/sql/optimizer/ob_log_link_dml.h index 49dd43eb46..c4b54df1e5 100644 --- a/src/sql/optimizer/ob_log_link_dml.h +++ b/src/sql/optimizer/ob_log_link_dml.h @@ -16,6 +16,7 @@ public: virtual ~ObLogLinkDml() {} virtual int compute_op_ordering() override; virtual int get_explain_name_internal(char *buf, const int64_t buf_len, int64_t &pos) override; + virtual int get_plan_item_info(PlanText &plan_text, ObSqlPlanItem &plan_item) override; inline void set_dml_type(stmt::StmtType type) { dml_type_ = type; } private: stmt::StmtType dml_type_; diff --git a/tools/deploy/mysql_test/test_suite/with_clause_mysql/r/mysql/cte_without_explain_mysql.result b/tools/deploy/mysql_test/test_suite/with_clause_mysql/r/mysql/cte_without_explain_mysql.result index ae5c9d0b89..db5e1e9351 100644 --- a/tools/deploy/mysql_test/test_suite/with_clause_mysql/r/mysql/cte_without_explain_mysql.result +++ b/tools/deploy/mysql_test/test_suite/with_clause_mysql/r/mysql/cte_without_explain_mysql.result @@ -588,11 +588,7 @@ select (with RECURSIVE qn as (select 'with RECURSIVE' from dual) select * from q from dual; show create view v; View Create View character_set_client collation_connection -<<<<<<< HEAD -v CREATE VIEW `v` AS select (WITH RECURSIVE `qn`(`with RECURSIVE`) as ((select 'with RECURSIVE')) select `qn`.`with RECURSIVE` from `qn`) AS `scal_subq` utf8mb4 utf8mb4_general_ci -======= -v CREATE VIEW `v` AS select (WITH RECURSIVE `qn` as (select 'with RECURSIVE' AS `with RECURSIVE`) select `qn`.`with RECURSIVE` from `qn`) AS `scal_subq` utf8mb4 utf8mb4_general_ci ->>>>>>> origin/master +v CREATE VIEW `v` AS select (WITH RECURSIVE `qn` as (select 'with RECURSIVE') select `qn`.`with RECURSIVE` from `qn`) AS `scal_subq` utf8mb4 utf8mb4_general_ci select * from v; +----------------+ | scal_subq | @@ -603,11 +599,7 @@ drop view v; create view v as select * from (with RECURSIVE qn as (select 'with RECURSIVE' from dual) select * from qn) dt; show create view v; View Create View character_set_client collation_connection -<<<<<<< HEAD -v CREATE VIEW `v` AS select `dt`.`with RECURSIVE` AS `with RECURSIVE` from (WITH RECURSIVE `qn`(`with RECURSIVE`) as (select 'with RECURSIVE' AS `with RECURSIVE`) select `qn`.`with RECURSIVE` AS `with RECURSIVE` from `qn`) `dt` utf8mb4 utf8mb4_general_ci -======= -v CREATE VIEW `v` AS select `dt`.`with RECURSIVE` AS `with RECURSIVE` from (WITH RECURSIVE `qn` as (select 'with RECURSIVE' AS `with RECURSIVE`) select `qn`.`with RECURSIVE` AS `with RECURSIVE` from `qn`) dt utf8mb4 utf8mb4_general_ci ->>>>>>> origin/master +v CREATE VIEW `v` AS select `dt`.`with RECURSIVE` AS `with RECURSIVE` from (WITH RECURSIVE `qn` as (select 'with RECURSIVE') select `qn`.`with RECURSIVE` AS `with RECURSIVE` from `qn`) `dt` utf8mb4 utf8mb4_general_ci select * from v; +----------------+ | with RECURSIVE | -- GitLab