library/src/databases/bpdb/query_helpers/BP-DBSelectQueryHelpers.cc
// Attempt to add a single field name.
Attempt to add a single field name.
Attempt to add a single field name .
BP_ERROR_T BP_DBSyntaxGenSelectInfoAddFieldName(P_BPDB_SQLGEN syngen, char *field)
{
	if(!syngen)
		return ERR_FAILURE;
	if(!field)
		return ERR_FAILURE;
	if(!syngen->select_info)
		return ERR_FAILURE;
	if(!syngen->select_info->select_query_parts_hreg)
		return ERR_FAILURE;
	if(!BP_StringIsReasonableForSelectFieldSpecifierDB(field, bpstrlen(field)))
		return ERR_FAILURE;
	char *add_path[] =
	{
			"field_names",
			NULL
	};
	if(
		!BP_HashRegAddDataToTableByPath
		(
			syngen->select_info->select_query_parts_hreg,
			(char **) &add_path,
			field,
			BP_HASH_TABLE_KEYED_ENTRY_TYPE_UTF8_STRING,
			field,
			bpstrlen(field)
		)
	)
	{
		return ERR_FAILURE;
	}
	return ERR_SUCCESS;
}
BP_ERROR_T BP_DBSyntaxGenSelectInfoAddFieldName ( P_BPDB_SQLGEN syngen , char * field ) { if ( ! syngen ) return ERR_FAILURE ; if ( ! field ) return ERR_FAILURE ; if ( ! syngen -> select_info ) return ERR_FAILURE ; if ( ! syngen -> select_info -> select_query_parts_hreg ) return ERR_FAILURE ; if ( ! BP_StringIsReasonableForSelectFieldSpecifierDB ( field , bpstrlen ( field ) ) ) return ERR_FAILURE ; char * add_path [ ] = { " " , NULL } ; if ( ! BP_HashRegAddDataToTableByPath ( syngen -> select_info -> select_query_parts_hreg , ( char * * ) & add_path , field , BP_HASH_TABLE_KEYED_ENTRY_TYPE_UTF8_STRING , field , bpstrlen ( field ) ) ) { return ERR_FAILURE ; } return ERR_SUCCESS ; }
Attempt to add a single field name.
Attempt to add a single field name .
// run basic null checks // ensure field is reasonable // set add path // add the field entry, exit with failure code if it cannot be added // return indicating success