library/src/databases/bpdb/BP-DBSQLSyntaxGenerators.cc
// display mariadb parameters for a provided select info
display mariadb parameters for a provided select info
display mariadb parameters for a provided select info
BP_ERROR_T BP_DBDisplaySelectInfoMariadbBindParameter(MYSQL_BIND * bind_parameter, size_t tab_depth, size_t parameter_index)
{
	if(!bind_parameter)
		return ERR_FAILURE;
	char * tab_buff = "";
	P_BP_LINKL tab_linkl = BP_CreateLinkL(".", BP_TRUE);
	if(tab_depth)
	{
		size_t n = 0;
		for(; n < tab_depth; n++)
		{
			tq_strdup(tab_linkl, "\t", BPLN);
		}
		BP_LinkLFlattenJoinStringElements(tab_linkl);
		tab_buff = (char *) tab_linkl->flat_buff;
	}
	size_t bind_parameter_iter = 0;
	printf("\n%s [+] Bind Parameter %p (idx: %u)", tab_buff, bind_parameter, parameter_index);
	printf("\n%s     length:             %p", tab_buff, bind_parameter->length);
	if(bind_parameter->length)
		printf(" val: %u", *bind_parameter->length);
	printf("\n%s     is_null:            %p", tab_buff, bind_parameter->is_null);
	printf("\n%s     buffer:             %p", tab_buff, bind_parameter->buffer);
	printf("\n%s     error:              %p", tab_buff, bind_parameter->error);
	printf("\n%s     row_ptr:            %p", tab_buff, bind_parameter->row_ptr);
	printf("\n%s     store_param_func:   %p", tab_buff, bind_parameter->store_param_func);
	printf("\n%s     fetch_result:       %p", tab_buff, bind_parameter->fetch_result);
	printf("\n%s     skip_result:        %p", tab_buff, bind_parameter->skip_result);
	printf("\n%s     buffer_length:      %u", tab_buff, bind_parameter->buffer_length);
	printf("\n%s     offset:             %u", tab_buff, bind_parameter->offset);
	printf("\n%s     length_value:       %u", tab_buff, bind_parameter->length_value);
	printf("\n%s     pack_length:        %u", tab_buff, bind_parameter->pack_length);
	char * buffer_type_str = BP_MySQLTypeToString(bind_parameter->buffer_type);
	printf("\n%s     buffer_type:        %s (%u)", tab_buff, buffer_type_str, bind_parameter->buffer_type);
	if(buffer_type_str)
		bpfree(buffer_type_str);
	printf("\n%s     error_value:        %u", tab_buff, bind_parameter->error_value);
	printf("\n%s     is_unsigned:        %u", tab_buff, bind_parameter->is_unsigned);
	printf("\n%s     long_data_used:     %u", tab_buff, bind_parameter->long_data_used);
	printf("\n%s     is_null_value:      %u", tab_buff, bind_parameter->is_null_value);
	printf("\n%s     extension:          %p", tab_buff, bind_parameter->extension);
	BP_DestroyLinkL(tab_linkl, BP_TRUE);
	return ERR_SUCCESS;
}
BP_ERROR_T BP_DBDisplaySelectInfoMariadbBindParameter ( MYSQL_BIND * bind_parameter , size_t tab_depth , size_t parameter_index ) { if ( ! bind_parameter ) return ERR_FAILURE ; char * tab_buff = " " ; P_BP_LINKL tab_linkl = BP_CreateLinkL ( " " , BP_TRUE ) ; if ( tab_depth ) { size_t n = 0 ; for ( ; n < tab_depth ; n ++ ) { tq_strdup ( tab_linkl , " \t " , BPLN ) ; } BP_LinkLFlattenJoinStringElements ( tab_linkl ) ; tab_buff = ( char * ) tab_linkl -> flat_buff ; } size_t bind_parameter_iter = 0 ; printf ( " \n " , tab_buff , bind_parameter , parameter_index ) ; printf ( " \n " , tab_buff , bind_parameter -> length ) ; if ( bind_parameter -> length ) printf ( " " , * bind_parameter -> length ) ; printf ( " \n " , tab_buff , bind_parameter -> is_null ) ; printf ( " \n " , tab_buff , bind_parameter -> buffer ) ; printf ( " \n " , tab_buff , bind_parameter -> error ) ; printf ( " \n " , tab_buff , bind_parameter -> row_ptr ) ; printf ( " \n " , tab_buff , bind_parameter -> store_param_func ) ; printf ( " \n " , tab_buff , bind_parameter -> fetch_result ) ; printf ( " \n " , tab_buff , bind_parameter -> skip_result ) ; printf ( " \n " , tab_buff , bind_parameter -> buffer_length ) ; printf ( " \n " , tab_buff , bind_parameter -> offset ) ; printf ( " \n " , tab_buff , bind_parameter -> length_value ) ; printf ( " \n " , tab_buff , bind_parameter -> pack_length ) ; char * buffer_type_str = BP_MySQLTypeToString ( bind_parameter -> buffer_type ) ; printf ( " \n " , tab_buff , buffer_type_str , bind_parameter -> buffer_type ) ; if ( buffer_type_str ) bpfree ( buffer_type_str ) ; printf ( " \n " , tab_buff , bind_parameter -> error_value ) ; printf ( " \n " , tab_buff , bind_parameter -> is_unsigned ) ; printf ( " \n " , tab_buff , bind_parameter -> long_data_used ) ; printf ( " \n " , tab_buff , bind_parameter -> is_null_value ) ; printf ( " \n " , tab_buff , bind_parameter -> extension ) ; BP_DestroyLinkL ( tab_linkl , BP_TRUE ) ; return ERR_SUCCESS ; }
display mariadb parameters for a provided select info
display mariadb parameters for a provided select info
// check if we have a bind parameter // %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% // %%% Create Tab Buffer %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% // %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% // set tab_buff init to empty string // create a linkl // if tab depth is set, generate tab string // add tab elements // create flat buffer // set the tab buffer // %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% // %%% Display Bind Data %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% // %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% // iterator for bind parameters // bind_parameter, // (MEMBER REMOVED IN LATER VERSIONS OF MARIADB) // printf("\n%s     param_number:       %u", tab_buff, bind_parameter->param_number); // set buffer type string // destroy the linkl before exit // return indicating success