library/src/blockclass/BP-BlockClass.cc
// binds result configuration to a statement
binds result configuration to a statement
binds result configuration to a statement
BP_ERROR_T Block::mysqlBindResults()
{
	if(!this->mysqlSession)
		return ERR_FAILURE;
	BP_BLOCK_MARIADB_ENTER_CRITICAL_SECTION;
	if(!this->mysqlSession->connected)
	{
		printf("\n MySQL not connected in %s, %u", __FILE__, __LINE__);
		BP_BLOCK_MARIADB_LEAVE_CRITICAL_SECTION_AND_RETURN_FROM_FUNC(ERR_FAILURE);
	}
	if (!this->mysql_stmt)
	{
		this->AddErrorToStack((char*) "Error in Block::mysqlBindResults(): Statement unset.");
		BP_BLOCK_MARIADB_LEAVE_CRITICAL_SECTION_AND_RETURN_FROM_FUNC(ERR_FAILURE);
	}
	if (BP_MySQLBindResult(this->mysql_stmt, this->mysql_results, this->mysql_results_count, this->mysqlSession) != ERR_SUCCESS)
	{
		this->AddErrorToStack((char*) "Error in Block::mysqlBindResults(): Bind failed.");
		BP_BLOCK_MARIADB_LEAVE_CRITICAL_SECTION_AND_RETURN_FROM_FUNC(ERR_FAILURE);
	}
	BP_BLOCK_MARIADB_LEAVE_CRITICAL_SECTION_AND_RETURN_FROM_FUNC(ERR_SUCCESS);
}
BP_ERROR_T Block :: mysqlBindResults ( ) { if ( ! this -> mysqlSession ) return ERR_FAILURE ; BP_BLOCK_MARIADB_ENTER_CRITICAL_SECTION ; if ( ! this -> mysqlSession -> connected ) { printf ( " \n " , __FILE__ , __LINE__ ) ; BP_BLOCK_MARIADB_LEAVE_CRITICAL_SECTION_AND_RETURN_FROM_FUNC ( ERR_FAILURE ) ; } if ( ! this -> mysql_stmt ) { this -> AddErrorToStack ( ( char * ) " " ) ; BP_BLOCK_MARIADB_LEAVE_CRITICAL_SECTION_AND_RETURN_FROM_FUNC ( ERR_FAILURE ) ; } if ( BP_MySQLBindResult ( this -> mysql_stmt , this -> mysql_results , this -> mysql_results_count , this -> mysqlSession ) != ERR_SUCCESS ) { this -> AddErrorToStack ( ( char * ) " " ) ; BP_BLOCK_MARIADB_LEAVE_CRITICAL_SECTION_AND_RETURN_FROM_FUNC ( ERR_FAILURE ) ; } BP_BLOCK_MARIADB_LEAVE_CRITICAL_SECTION_AND_RETURN_FROM_FUNC ( ERR_SUCCESS ) ; }
binds result configuration to a statement
binds result configuration to a statement
// ensure we have a mysql session // enter critical section // attempt reconnect if necessary // return indicating success