library/src/databases/bpdb/BP-DBSQLSyntaxGenerators.cc
// This cleans out all dangling data that could possibly be generated as a result of
// the attempted or comleted prepare of a select statement.  It should be noted that
// all potentially dangling memory isn't allocated in the master hash table.  This is
// to prevent any need for contentious locking of the table itself.
This cleans out all dangling data that could possibly be generated as a result of
the attempted or comleted prepare of a select statement.  It should be noted that
all potentially dangling memory isn't allocated in the master hash table.  This is
to prevent any need for contentious locking of the table itself.
This cleans out all dangling data that could possibly be generated as a result of the attempted or comleted prepare of a select statement . It should be noted that all potentially dangling memory isn ' t allocated in the master hash table . This is to prevent any need for contentious locking of the table itself .
BP_ERROR_T BP_DBSelectInfoCleanResidualData
(
	P_BPDB_SQLGEN_SELECT select_info,
	BP_BOOL              destroy_bind_results,
	BP_BOOL              destroy_bind_parameters,
	BP_BOOL              destroy_field_name_list,
	BP_BOOL              destroy_table_name_list
)
{
	if(!select_info)
		return ERR_FAILURE;
		 table to select from
		char *                 table_name;
	 where clause
		P_BPDB_SELECT_WHERE    select_where;
		size_t                 select_where_entry_n;
	 limits to impose on the query tail
		P_BPDB_SELECT_LIMITS   limits;
	 join clauses
		P_BPDB_SELECT_JOIN     join_on;
		size_t                 join_on_entry_n;
		 order by clause
		P_BPDB_SELECT_ORDER_BY order_by;
	 group by clause
		P_BPDB_SELECT_GROUP_BY group_by;
	 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
	 %%% Cleanup Internally Allocated Lists %%%%%%%
	 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
	 destroy table name list
	if(destroy_table_name_list)
	if(select_info->table_name_list)
	{
		BP_DestroyLinkL(select_info->table_name_list, BP_TRUE);
		select_info->table_name_list = NULL;
	}
	 destroy field name list
	if(destroy_field_name_list)
	if(select_info->field_name_list)
	{
		BP_DestroyLinkL(select_info->field_name_list, BP_TRUE);
		select_info->field_name_list = NULL;
	}
	 destroy the bind parameters list
	if(destroy_bind_parameters)
	if(select_info->bind_parameters_tq_allocator)
	{
		BP_DestroyLinkL(select_info->bind_parameters_tq_allocator, BP_TRUE);
		select_info->bind_parameters_tq_allocator = NULL;
		select_info->bind_parameters              = NULL;
		select_info->bind_parameters_n            = 0;
	}
	 destroy the bind results list
	if(destroy_bind_results)
	if(select_info->bind_results_tq_allocator)
	{
		BP_DestroyLinkL(select_info->bind_results_tq_allocator, BP_TRUE);
		select_info->bind_results_tq_allocator = NULL;
		select_info->bind_results              = NULL;
		select_info->bind_results_n            = 0;
	}
	 return indicating success
	return ERR_SUCCESS;
}
BP_ERROR_T BP_DBSelectInfoCleanResidualData ( P_BPDB_SQLGEN_SELECT select_info , BP_BOOL destroy_bind_results , BP_BOOL destroy_bind_parameters , BP_BOOL destroy_field_name_list , BP_BOOL destroy_table_name_list ) { if ( ! select_info ) return ERR_FAILURE ; if ( destroy_table_name_list ) if ( select_info -> table_name_list ) { BP_DestroyLinkL ( select_info -> table_name_list , BP_TRUE ) ; select_info -> table_name_list = NULL ; } if ( destroy_field_name_list ) if ( select_info -> field_name_list ) { BP_DestroyLinkL ( select_info -> field_name_list , BP_TRUE ) ; select_info -> field_name_list = NULL ; } if ( destroy_bind_parameters ) if ( select_info -> bind_parameters_tq_allocator ) { BP_DestroyLinkL ( select_info -> bind_parameters_tq_allocator , BP_TRUE ) ; select_info -> bind_parameters_tq_allocator = NULL ; select_info -> bind_parameters = NULL ; select_info -> bind_parameters_n = 0 ; } if ( destroy_bind_results ) if ( select_info -> bind_results_tq_allocator ) { BP_DestroyLinkL ( select_info -> bind_results_tq_allocator , BP_TRUE ) ; select_info -> bind_results_tq_allocator = NULL ; select_info -> bind_results = NULL ; select_info -> bind_results_n = 0 ; } return ERR_SUCCESS ; }
This cleans out all dangling data that could possibly be generated as a result of
the attempted or comleted prepare of a select statement.
This cleans out all dangling data that could possibly be generated as a result of the attempted or comleted prepare of a select statement .
// ensure we have select info to work with // PROTECTED FIELDS / DO NOT DESTROY: // fields to be selected //	char **                field_names; // //	// table to select from //	char *                 table_name; // // where clause //	P_BPDB_SELECT_WHERE    select_where; //	size_t                 select_where_entry_n; // // limits to impose on the query tail //	P_BPDB_SELECT_LIMITS   limits; // // join clauses //	P_BPDB_SELECT_JOIN     join_on; //	size_t                 join_on_entry_n; // //	// order by clause //	P_BPDB_SELECT_ORDER_BY order_by; // // group by clause //	P_BPDB_SELECT_GROUP_BY group_by; // %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% // %%% Cleanup Internally Allocated Lists %%%%%%% // %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% // destroy table name list // destroy field name list // destroy the bind parameters list // destroy the bind results list // return indicating success