diff --git a/src/backend/codegen/codegen_wrapper.cc b/src/backend/codegen/codegen_wrapper.cc index c1c76d7bac1f6e565aed1e3a52e13bd564a9e872..ba069e93ed192af755aa3b80ee3e9a6f7aa0215d 100644 --- a/src/backend/codegen/codegen_wrapper.cc +++ b/src/backend/codegen/codegen_wrapper.cc @@ -102,6 +102,11 @@ void SetActiveCodeGeneratorManager(void* manager) { ActiveCodeGeneratorManager = manager; } +Datum +slot_getattr_regular(TupleTableSlot *slot, int attnum, bool *isnull) { + return slot_getattr(slot, attnum, isnull); +} + void* ExecVariableListCodegenEnroll( ExecVariableListFn regular_func_ptr, ExecVariableListFn* ptr_to_chosen_func_ptr, diff --git a/src/backend/codegen/exec_eval_expr_codegen.cc b/src/backend/codegen/exec_eval_expr_codegen.cc index ee4f44accf65adadf5e4a7218e6673b139e40561..e43f49099f9a83460dc2ae39836db58dcc7bf9bd 100644 --- a/src/backend/codegen/exec_eval_expr_codegen.cc +++ b/src/backend/codegen/exec_eval_expr_codegen.cc @@ -123,8 +123,8 @@ bool ExecEvalExprCodegen::GenerateExecEvalExpr( if (nullptr == slot_getattr_codegen_ || false == slot_getattr_codegen_->GenerateCode(codegen_utils)) { gen_info_.llvm_slot_getattr_func = - codegen_utils->GetOrRegisterExternalFunction(slot_getattr, - "slot_getattr"); + codegen_utils->GetOrRegisterExternalFunction(slot_getattr_regular, + "slot_getattr_regular"); } else { gen_info_.llvm_slot_getattr_func = slot_getattr_codegen_->GetGeneratedFunction(); diff --git a/src/backend/codegen/include/codegen/codegen_manager.h b/src/backend/codegen/include/codegen/codegen_manager.h index 0ada9cfecea7723debad0dbd5ddaf1a03a65fd5b..38dfff17c5274885c9c237e9698a7e54e274fe35 100644 --- a/src/backend/codegen/include/codegen/codegen_manager.h +++ b/src/backend/codegen/include/codegen/codegen_manager.h @@ -81,13 +81,12 @@ class CodegenManager { FuncType regular_func_ptr, FuncType* ptr_to_chosen_func_ptr, Args&&... args) { // NOLINT(build/c++11) - - assert(nullptr != regular_func_ptr); - assert(nullptr != ptr_to_chosen_func_ptr); + assert(nullptr != regular_func_ptr); + assert(nullptr != ptr_to_chosen_func_ptr); bool can_enroll = // manager may be NULL if ExecInitNode/ExecProcNode weren't previously - // called. This happens e.g during gpinitsystem. + // called. This happens e.g during gpinitsystem. (nullptr != manager) && codegen && // if codegen guc is false // if generator is disabled diff --git a/src/backend/codegen/include/codegen/slot_getattr_codegen.h b/src/backend/codegen/include/codegen/slot_getattr_codegen.h index c3b0ae73f3e6c080db8d5a7aec8e0485f853e1a3..aa16bfd7bad8061577bbcf524c7ddb7e70a94d0c 100644 --- a/src/backend/codegen/include/codegen/slot_getattr_codegen.h +++ b/src/backend/codegen/include/codegen/slot_getattr_codegen.h @@ -104,7 +104,8 @@ class SlotGetAttrCodegen : public BaseCodegen { SlotGetAttrCodegen(gpcodegen::CodegenManager* manager, TupleTableSlot* slot, int max_attr) - : BaseCodegen(manager, kSlotGetAttrPrefix, slot_getattr, &dummy_func_), + : BaseCodegen( + manager, kSlotGetAttrPrefix, slot_getattr_regular, &dummy_func_), slot_(slot), max_attr_(max_attr), llvm_function_(nullptr) { diff --git a/src/backend/codegen/slot_getattr_codegen.cc b/src/backend/codegen/slot_getattr_codegen.cc index f900f07768324ced4b953ef197e4ca6a1a021c9b..7321144e79fb39111dc3278b231fa704be33f0ab 100644 --- a/src/backend/codegen/slot_getattr_codegen.cc +++ b/src/backend/codegen/slot_getattr_codegen.cc @@ -685,8 +685,8 @@ bool SlotGetAttrCodegen::GenerateSlotGetAttr( llvm_error); codegen_utils->CreateFallback( - codegen_utils->GetOrRegisterExternalFunction(slot_getattr, - "slot_getattr"), + codegen_utils->GetOrRegisterExternalFunction(slot_getattr_regular, + "slot_getattr_regular"), slot_getattr_func); return true; } diff --git a/src/include/codegen/codegen_wrapper.h b/src/include/codegen/codegen_wrapper.h index f93b9ea0589d7457733a6350a268be2bd9d1908b..116fa7931187eb92bae96e9f6984555bc46e8036 100644 --- a/src/include/codegen/codegen_wrapper.h +++ b/src/include/codegen/codegen_wrapper.h @@ -161,6 +161,12 @@ GetActiveCodeGeneratorManager(); void SetActiveCodeGeneratorManager(void* manager); +/* + * Wrapper function for slot_getattr. + */ +Datum +slot_getattr_regular(struct TupleTableSlot *slot, int attnum, bool *isnull); + /* * returns the pointer to the ExecVariableList */