From 20da72c3ab370b973ed0542fdfaa4391df7f8ca1 Mon Sep 17 00:00:00 2001 From: zzg19950727 <1071026277@qq.com> Date: Thu, 8 Dec 2022 08:06:37 +0000 Subject: [PATCH] [CP] fix reconstruct sql for insert all bug --- src/sql/ob_insert_all_stmt_printer.cpp | 5 +++-- src/sql/ob_insert_stmt_printer.cpp | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/sql/ob_insert_all_stmt_printer.cpp b/src/sql/ob_insert_all_stmt_printer.cpp index 1ffcc689a4..8c92bdd8fd 100644 --- a/src/sql/ob_insert_all_stmt_printer.cpp +++ b/src/sql/ob_insert_all_stmt_printer.cpp @@ -211,7 +211,7 @@ int ObInsertAllStmtPrinter::print_subquery(const ObInsertAllStmt *insert_stmt) } else { ObSelectStmtPrinter printer(buf_, buf_len_, pos_, static_cast(sub_select_stmt), - print_params_, NULL, false); + print_params_, NULL, false, false, true); if (OB_FAIL(printer.do_print())) { LOG_WARN("failed to print sub select printer", K(ret)); } @@ -256,7 +256,8 @@ int ObInsertAllStmtPrinter::print_into_table_values(const ObInsertAllStmt *inser DATA_PRINTF("("); for (int64_t p = 0; OB_SUCC(ret) && p < col_count; ++p) { if (OB_FAIL(expr_printer_.do_print(table_info.values_vector_.at(k * col_count + p), - T_INSERT_SCOPE))) { + T_INSERT_SCOPE, + true))) { LOG_WARN("fail to print where expr", K(ret)); } else { DATA_PRINTF(","); diff --git a/src/sql/ob_insert_stmt_printer.cpp b/src/sql/ob_insert_stmt_printer.cpp index 40a0ff3715..7e9dd552c2 100644 --- a/src/sql/ob_insert_stmt_printer.cpp +++ b/src/sql/ob_insert_stmt_printer.cpp @@ -231,7 +231,7 @@ int ObInsertStmtPrinter::print_subquery(const ObInsertStmt *insert_stmt) } else { ObSelectStmtPrinter printer(buf_, buf_len_, pos_, static_cast(sub_select_stmt), - print_params_, NULL, false); + print_params_, NULL, false, false, true); if (OB_FAIL(printer.do_print())) { LOG_WARN("failed to print sub select printer", K(ret)); } -- GitLab