HAWQ-1137. Remove banned api mechanism in Orca gporca has a set of banned API calls which needs to be allowed with the ALLOW_xxx macro in order for gpopt to compile. But it should be the library caller (HAWQ)'s responsibility to take care of the function call.
Project: http://git-wip-us.apache.org/repos/asf/incubator-hawq/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-hawq/commit/31ea7d08 Tree: http://git-wip-us.apache.org/repos/asf/incubator-hawq/tree/31ea7d08 Diff: http://git-wip-us.apache.org/repos/asf/incubator-hawq/diff/31ea7d08 Branch: refs/heads/master Commit: 31ea7d08ede7d5bc3108454731ba11bdcf1092d1 Parents: 56b44f8 Author: Haisheng Yuan <[email protected]> Authored: Wed Nov 2 14:26:55 2016 +0800 Committer: Wen Lin <[email protected]> Committed: Wed Nov 2 17:41:50 2016 +0800 ---------------------------------------------------------------------- src/backend/gpopt/gpdbwrappers.cpp | 183 ------------------- src/backend/gpopt/translate/CCTEListEntry.cpp | 5 - .../gpopt/translate/CMappingColIdVarQuery.cpp | 5 - .../gpopt/translate/CMappingVarColId.cpp | 5 - .../translate/CTranslatorRelcacheToDXL.cpp | 28 --- .../gpopt/translate/CTranslatorScalarToDXL.cpp | 6 - src/backend/gpopt/utils/COptTasks.cpp | 2 - src/backend/gpopt/utils/funcs.cpp | 2 - 8 files changed, 236 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/31ea7d08/src/backend/gpopt/gpdbwrappers.cpp ---------------------------------------------------------------------- diff --git a/src/backend/gpopt/gpdbwrappers.cpp b/src/backend/gpopt/gpdbwrappers.cpp index 489d6b6..8ec72cd 100644 --- a/src/backend/gpopt/gpdbwrappers.cpp +++ b/src/backend/gpopt/gpdbwrappers.cpp @@ -32,189 +32,6 @@ // //--------------------------------------------------------------------------- -#define ALLOW_sigsetjmp -#define ALLOW_DatumGetBool -#define ALLOW_BoolGetDatum -#define ALLOW_DatumGetChar -#define ALLOW_CharGetDatum -#define ALLOW_DatumGetInt8 -#define ALLOW_Int8GetDatum -#define ALLOW_DatumGetUInt8 -#define ALLOW_UInt8GetDatum -#define ALLOW_DatumGetInt16 -#define ALLOW_Int16GetDatum -#define ALLOW_DatumGetUInt16 -#define ALLOW_UInt16GetDatum -#define ALLOW_DatumGetInt32 -#define ALLOW_Int32GetDatum -#define ALLOW_DatumGetUInt32 -#define ALLOW_UInt32GetDatum -#define ALLOW_DatumGetInt64 -#define ALLOW_Int64GetDatum -#define ALLOW_DatumGetUInt64 -#define ALLOW_UInt64GetDatum -#define ALLOW_DatumGetObjectId -#define ALLOW_DatumGetPointer -#define ALLOW_DatumGetFloat4 -#define ALLOW_DatumGetFloat8 -#define ALLOW_PointerGetDatum -#define ALLOW_aggregate_exists -#define ALLOW_bms_add_member -#define ALLOW_copyObject -#define ALLOW_datumGetSize -#define ALLOW_deconstruct_array -#define ALLOW_expression_tree_mutator -#define ALLOW_expression_tree_walker -#define ALLOW_exprType -#define ALLOW_exprTypmod -#define ALLOW_extract_nodes_plan -#define ALLOW_extract_nodes_expression -#define ALLOW_free_attstatsslot -#define ALLOW_func_strict -#define ALLOW_func_volatile -#define ALLOW_func_data_access -#define ALLOW_FuncnameGetCandidates -#define ALLOW_function_exists -#define ALLOW_function_oids -#define ALLOW_get_agg_transtype -#define ALLOW_flatten_join_alias_var_optimizer -#define ALLOW_get_aggregate -#define ALLOW_is_agg_ordered -#define ALLOW_has_agg_prelimfunc -#define ALLOW_get_array_type -#define ALLOW_get_attstatsslot -#define ALLOW_get_att_stats -#define ALLOW_get_commutator -#define ALLOW_trigger_exists -#define ALLOW_get_trigger_name -#define ALLOW_get_trigger_relid -#define ALLOW_get_trigger_funcid -#define ALLOW_get_trigger_type -#define ALLOW_trigger_enabled -#define ALLOW_get_func_name -#define ALLOW_get_func_output_arg_types -#define ALLOW_get_func_arg_types -#define ALLOW_get_func_retset -#define ALLOW_get_func_rettype -#define ALLOW_get_negator -#define ALLOW_get_opcode -#define ALLOW_get_opname -#define ALLOW_get_partition_attrs -#define ALLOW_rel_is_leaf_partition -#define ALLOW_rel_partition_get_master -#define ALLOW_BuildLogicalIndexInfo -#define ALLOW_get_parts -#define ALLOW_countLeafPartTables -#define ALLOW_get_relation_keys -#define ALLOW_get_typ_typrelid -#define ALLOW_get_type_name -#define ALLOW_getgpsegmentCount -#define ALLOW_heap_attisnull -#define ALLOW_heap_freetuple -#define ALLOW_index_exists -#define ALLOW_isGreenplumDbHashable -#define ALLOW_lappend -#define ALLOW_lappend_int -#define ALLOW_lappend_oid -#define ALLOW_lcons -#define ALLOW_lcons_int -#define ALLOW_lcons_oid -#define ALLOW_list_concat -#define ALLOW_list_copy -#define ALLOW_list_head -#define ALLOW_list_tail -#define ALLOW_list_length -#define ALLOW_list_nth -#define ALLOW_list_free -#define ALLOW_list_nth_int -#define ALLOW_list_nth_oid -#define ALLOW_list_member_oid -#define ALLOW_freeListAndNull -#define ALLOW_lookup_type_cache -#define ALLOW_makeString -#define ALLOW_makeInteger -#define ALLOW_makeBoolConst -#define ALLOW_makeTargetEntry -#define ALLOW_makeVar -#define ALLOW_MemoryContextAllocImpl -#define ALLOW_MemoryContextAllocZeroAlignedImpl -#define ALLOW_MemoryContextAllocZeroImpl -#define ALLOW_MemoryContextFreeImpl -#define ALLOW_MemoryContextReallocImpl -#define ALLOW_MemoryContextStrdup -#define ALLOW_nodeToString -#define ALLOW_numeric_to_double_no_overflow -#define ALLOW_convert_timevalue_to_scalar -#define ALLOW_convert_network_to_scalar -#define ALLOW_op_hashjoinable -#define ALLOW_op_mergejoinable -#define ALLOW_op_strict -#define ALLOW_op_input_types -#define ALLOW_operator_exists -#define ALLOW_palloc -#define ALLOW_pfree -#define ALLOW_equal -#define ALLOW_pg_detoast_datum -#define ALLOW_query_or_expression_tree_walker -#define ALLOW_query_or_expression_tree_mutator -#define ALLOW_query_tree_mutator -#define ALLOW_range_table_mutator -#define ALLOW_rel_part_status -#define ALLOW_relation_exists -#define ALLOW_relation_oids -#define ALLOW_RelationClose -#define ALLOW_RelationGetIndexList -#define ALLOW_RelationBuildTriggers -#define ALLOW_RelationIdGetRelation -#define ALLOW_tlist_member -#define ALLOW_tlist_members -#define ALLOW_type_exists -#define ALLOW_GetExtTableEntry -#define ALLOW_ParseExternalTableUri -#define ALLOW_getCdbComponentDatabases -#define ALLOW_pg_strcasecmp -#define ALLOW_makeRandomSegMap -#define ALLOW_initStringInfoOfSize -#define ALLOW_makeStringInfo -#define ALLOW_appendStringInfo -#define ALLOW_appendStringInfoString -#define ALLOW_appendStringInfoChar -#define ALLOW_get_cast_func -#define ALLOW_get_relation_part_constraints -#define ALLOW_get_operator_type -#define ALLOW_get_comparison_operator -#define ALLOW_find_nodes -#define ALLOW_char_to_parttype -#define ALLOW_makeNullConst -#define ALLOW_coerce_to_common_type -#define ALLOW_resolve_generic_type -#define ALLOW_has_subclass -#define ALLOW_cdbhash_const -#define ALLOW_cdbhash_const_list - -#define ALLOW_ExecCheckRTPerms -#define ALLOW_is_pxf_protocol -#define ALLOW_pxf_calc_participating_segments -#define ALLOW_map_hddata_2gp_segments -#define ALLOW_free_hddata_2gp_segments -#define ALLOW_evaluate_expr -#define ALLOW_get_operator_opclasses -#define ALLOW_get_index_opclasses - -#define ALLOW_interpretOidsOption -#define ALLOW_defGetString -#define ALLOW_fold_arrayexpr_constants -#define ALLOW_has_parquet_children -#define ALLOW_relation_policy -#define ALLOW_child_distribution_mismatch -#define ALLOW_child_triggers -#define ALLOW_static_part_selection -#define ALLOW_isMotionGather -#define ALLOW_estimate_rel_size -#define ALLOW_rel_partitioning_is_uniform -#define ALLOW_GetActiveRelType -#define ALLOW_GetActiveQueryResource - #include "gpopt/utils/gpdbdefs.h" #include "gpos/base.h" http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/31ea7d08/src/backend/gpopt/translate/CCTEListEntry.cpp ---------------------------------------------------------------------- diff --git a/src/backend/gpopt/translate/CCTEListEntry.cpp b/src/backend/gpopt/translate/CCTEListEntry.cpp index 372b4c5..60faa37 100644 --- a/src/backend/gpopt/translate/CCTEListEntry.cpp +++ b/src/backend/gpopt/translate/CCTEListEntry.cpp @@ -30,11 +30,6 @@ // //--------------------------------------------------------------------------- -#define ALLOW_DatumGetPointer -#define ALLOW_ntohl -#define ALLOW_memset -#define ALLOW_printf - #include "postgres.h" #include "gpopt/translate/CCTEListEntry.h" http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/31ea7d08/src/backend/gpopt/translate/CMappingColIdVarQuery.cpp ---------------------------------------------------------------------- diff --git a/src/backend/gpopt/translate/CMappingColIdVarQuery.cpp b/src/backend/gpopt/translate/CMappingColIdVarQuery.cpp index e059f02..b1697ba 100644 --- a/src/backend/gpopt/translate/CMappingColIdVarQuery.cpp +++ b/src/backend/gpopt/translate/CMappingColIdVarQuery.cpp @@ -30,11 +30,6 @@ // //--------------------------------------------------------------------------- -#define ALLOW_DatumGetPointer -#define ALLOW_ntohl -#define ALLOW_memset -#define ALLOW_printf - #include "postgres.h" #include "gpopt/translate/CMappingColIdVarQuery.h" http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/31ea7d08/src/backend/gpopt/translate/CMappingVarColId.cpp ---------------------------------------------------------------------- diff --git a/src/backend/gpopt/translate/CMappingVarColId.cpp b/src/backend/gpopt/translate/CMappingVarColId.cpp index 4745517..0b75b28 100644 --- a/src/backend/gpopt/translate/CMappingVarColId.cpp +++ b/src/backend/gpopt/translate/CMappingVarColId.cpp @@ -29,11 +29,6 @@ // //--------------------------------------------------------------------------- -#define ALLOW_DatumGetPointer -#define ALLOW_ntohl -#define ALLOW_memset -#define ALLOW_printf - #include "postgres.h" #include "gpopt/translate/CMappingVarColId.h" #include "gpopt/translate/CTranslatorUtils.h" http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/31ea7d08/src/backend/gpopt/translate/CTranslatorRelcacheToDXL.cpp ---------------------------------------------------------------------- diff --git a/src/backend/gpopt/translate/CTranslatorRelcacheToDXL.cpp b/src/backend/gpopt/translate/CTranslatorRelcacheToDXL.cpp index 8cb468a..a49f248 100644 --- a/src/backend/gpopt/translate/CTranslatorRelcacheToDXL.cpp +++ b/src/backend/gpopt/translate/CTranslatorRelcacheToDXL.cpp @@ -29,20 +29,6 @@ // //--------------------------------------------------------------------------- -#define ALLOW_DatumGetPointer -#define ALLOW_ntohl -#define ALLOW_memset -#define ALLOW_printf -#define ALLOW_offsetof -#define ALLOW_PointerGetDatum -#define ALLOW_Int32GetDatum -#define ALLOW_Int16GetDatum -#define ALLOW_DatumGetInt32 -#define ALLOW_MemoryContextAllocImpl -#define ALLOW_pfree -#define ALLOW_MemoryContextFreeImpl -#define ALLOW_CharGetDatum - #include "postgres.h" #include "naucrates/md/CMDIdCast.h" #include "naucrates/md/CMDIdScCmp.h" @@ -75,20 +61,6 @@ #include "catalog/namespace.h" #include "catalog/pg_statistic.h" -#undef ALLOW_DatumGetPointer -#undef ALLOW_ntohl -#undef ALLOW_memset -#undef ALLOW_printf -#undef ALLOW_offsetof -#undef ALLOW_PointerGetDatum -#undef ALLOW_Int32GetDatum -#undef ALLOW_Int16GetDatum -#undef ALLOW_DatumGetInt32 -#undef ALLOW_CharGetDatum -#undef ALLOW_pfree -#undef ALLOW_MemoryContextAllocImpl -#undef ALLOW_MemoryContextFreeImpl - #define GPDB_COUNT_AGG_OID 2147 #include "gpos/base.h" http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/31ea7d08/src/backend/gpopt/translate/CTranslatorScalarToDXL.cpp ---------------------------------------------------------------------- diff --git a/src/backend/gpopt/translate/CTranslatorScalarToDXL.cpp b/src/backend/gpopt/translate/CTranslatorScalarToDXL.cpp index 0a9dcfa..b1bfbb0 100644 --- a/src/backend/gpopt/translate/CTranslatorScalarToDXL.cpp +++ b/src/backend/gpopt/translate/CTranslatorScalarToDXL.cpp @@ -29,12 +29,6 @@ // //--------------------------------------------------------------------------- -#define ALLOW_DatumGetPointer -#define ALLOW_ntohl -#define ALLOW_memset -#define ALLOW_printf - -#define ALLOW_isnan #include "postgres.h" #include "gpopt/translate/CTranslatorScalarToDXL.h" #include "gpopt/translate/CTranslatorQueryToDXL.h" http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/31ea7d08/src/backend/gpopt/utils/COptTasks.cpp ---------------------------------------------------------------------- diff --git a/src/backend/gpopt/utils/COptTasks.cpp b/src/backend/gpopt/utils/COptTasks.cpp index 1adba9c..61d5b1b 100644 --- a/src/backend/gpopt/utils/COptTasks.cpp +++ b/src/backend/gpopt/utils/COptTasks.cpp @@ -29,8 +29,6 @@ // //--------------------------------------------------------------------------- -#define ALLOW_strcasecmp - #include "gpopt/utils/gpdbdefs.h" #include "gpopt/utils/CConstExprEvaluatorProxy.h" #include "gpopt/utils/COptTasks.h" http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/31ea7d08/src/backend/gpopt/utils/funcs.cpp ---------------------------------------------------------------------- diff --git a/src/backend/gpopt/utils/funcs.cpp b/src/backend/gpopt/utils/funcs.cpp index d39d65c..91eed51 100644 --- a/src/backend/gpopt/utils/funcs.cpp +++ b/src/backend/gpopt/utils/funcs.cpp @@ -29,8 +29,6 @@ // //--------------------------------------------------------------------------- -#define ALLOW_appendStringInfo - #include <sys/stat.h> #include "gpopt/utils/nodeutils.h" #include "gpopt/utils/CCatalogUtils.h"
