library/src/blockclass/BP-BlockClass.cc
// retrieves results from the last query
retrieves results from the last query
retrieves results from the last query
BP_ERROR_T Block::MysqlGetResults()
{
	if(!this->mysqlSession)
		return ERR_FAILURE;
	BP_BLOCK_MARIADB_ENTER_CRITICAL_SECTION;
	this->mysqlResults = BP_MySQLStoreResult(mysqlSession);
	if (!this->mysqlResults)
	{
		BP_MySQLAddErr
		(
			this->mysqlSession,
			BP_MYSQL_ERROR_CONNECT,
			0,
			"Block could not get results in block->MysqlGetResults.",
			BPLN
		);
		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 :: MysqlGetResults ( ) { if ( ! this -> mysqlSession ) return ERR_FAILURE ; BP_BLOCK_MARIADB_ENTER_CRITICAL_SECTION ; this -> mysqlResults = BP_MySQLStoreResult ( mysqlSession ) ; if ( ! this -> mysqlResults ) { BP_MySQLAddErr ( this -> mysqlSession , BP_MYSQL_ERROR_CONNECT , 0 , " " , BPLN ) ; BP_BLOCK_MARIADB_LEAVE_CRITICAL_SECTION_AND_RETURN_FROM_FUNC ( ERR_FAILURE ) ; } BP_BLOCK_MARIADB_LEAVE_CRITICAL_SECTION_AND_RETURN_FROM_FUNC ( ERR_SUCCESS ) ; }
retrieves results from the last query
retrieves results from the last query
// ensure we have a session // enter critical section // store results // return indicating failure // return indicating success