deep copy stmt need copy user var exprs
This commit is contained in:
		| @ -635,6 +635,9 @@ int ObDMLStmt::deep_copy_stmt_struct( | ||||
|   } else if (OB_FAIL(ObRawExprUtils::copy_expr( | ||||
|                  expr_factory, other.limit_percent_expr_, limit_percent_expr_, COPY_REF_DEFAULT))) { | ||||
|     LOG_WARN("deep copy limit percent expr failed", K(ret)); | ||||
|   } else if (OB_FAIL( | ||||
|                  ObRawExprUtils::copy_exprs(expr_factory, other.user_var_exprs_, user_var_exprs_, COPY_REF_DEFAULT))) { | ||||
|     LOG_WARN("deep copy user var exprs failed", K(ret)); | ||||
|   } else if (OB_FAIL(from_items_.assign(other.from_items_))) { | ||||
|     LOG_WARN("assign from items failed", K(ret)); | ||||
|   } else if (OB_FAIL(stmt_hint_.assign(other.stmt_hint_))) { | ||||
|  | ||||
| @ -2151,14 +2151,26 @@ int ObRawExprUtils::copy_expr(ObRawExprFactory& expr_factory, const ObRawExpr* o | ||||
|         break; | ||||
|       } | ||||
|       case ObRawExpr::EXPR_CONST: { | ||||
|         ObConstRawExpr* dest_const = NULL; | ||||
|         const ObConstRawExpr* origin_const = static_cast<const ObConstRawExpr*>(origin); | ||||
|         if (OB_FAIL(expr_factory.create_raw_expr(origin->get_expr_type(), dest_const)) || OB_ISNULL(dest_const)) { | ||||
|           LOG_WARN("failed to allocate raw expr", K(dest_const), K(ret)); | ||||
|         } else if (OB_FAIL(dest_const->deep_copy(expr_factory, *origin_const, COPY_REF_DEFAULT, use_new_allocator))) { | ||||
|           LOG_WARN("failed to deep copy const expr", K(ret)); | ||||
|         if (T_USER_VARIABLE_IDENTIFIER == origin->get_expr_type()) { | ||||
|           ObUserVarIdentRawExpr* dest_expr = NULL; | ||||
|           const ObUserVarIdentRawExpr* origin_expr = static_cast<const ObUserVarIdentRawExpr*>(origin); | ||||
|           if (OB_FAIL(expr_factory.create_raw_expr(origin->get_expr_type(), dest_expr)) || OB_ISNULL(dest_expr)) { | ||||
|             LOG_WARN("failed to allocate raw expr", K(dest_expr), K(ret)); | ||||
|           } else if (OB_FAIL(dest_expr->deep_copy(expr_factory, *origin_expr, COPY_REF_DEFAULT, use_new_allocator))) { | ||||
|             LOG_WARN("failed to deep copy const expr", K(ret)); | ||||
|           } else { | ||||
|             dest = dest_expr; | ||||
|           } | ||||
|         } else { | ||||
|           dest = dest_const; | ||||
|           ObConstRawExpr *dest_const = NULL; | ||||
|           const ObConstRawExpr *origin_const = static_cast<const ObConstRawExpr *>(origin); | ||||
|           if (OB_FAIL(expr_factory.create_raw_expr(origin->get_expr_type(), dest_const)) || OB_ISNULL(dest_const)) { | ||||
|             LOG_WARN("failed to allocate raw expr", K(dest_const), K(ret)); | ||||
|           } else if (OB_FAIL(dest_const->deep_copy(expr_factory, *origin_const, COPY_REF_DEFAULT, use_new_allocator))) { | ||||
|             LOG_WARN("failed to deep copy const expr", K(ret)); | ||||
|           } else { | ||||
|             dest = dest_const; | ||||
|           } | ||||
|         } | ||||
|         break; | ||||
|       } | ||||
|  | ||||
		Reference in New Issue
	
	Block a user
	 yb0
					yb0