From f5338e1cdd30341a3d9632b3cf322a77d1f05d51 Mon Sep 17 00:00:00 2001 From: obdev Date: Mon, 13 Feb 2023 05:14:19 +0000 Subject: [PATCH] Fix: replace into generated column return -4016 --- src/sql/code_generator/ob_dml_cg_service.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/sql/code_generator/ob_dml_cg_service.cpp b/src/sql/code_generator/ob_dml_cg_service.cpp index 7b0ac65028..e7c3d72f0f 100644 --- a/src/sql/code_generator/ob_dml_cg_service.cpp +++ b/src/sql/code_generator/ob_dml_cg_service.cpp @@ -649,8 +649,11 @@ int ObDmlCgService::convert_data_table_rowkey_info(ObLogDelUpd &op, for (int64_t i = 0; OB_SUCC(ret) && i < rowkey_exprs.count(); ++i) { ObRawExpr *expr = rowkey_exprs.at(i); if (!expr->is_column_ref_expr()) { - ret = OB_ERR_UNEXPECTED; - LOG_WARN("expr type is not column_ref expr", K(ret), KPC(expr)); + // do nothing. + // For a 4.x partition table without a primary key, there is no redundant partition key in the primary key, + // so its unique_key is a hidden auto-increment column + partition key. For replace and insert_up scenarios, + // here will be no primary key conflicts when writing the primary table , so the main table does not need to bring back unique_key + // (self-increment column + partition construction) } else { ObColumnRefRawExpr *col_expr = static_cast(expr); uint64_t base_cid = OB_INVALID_ID;