library/src/blockclass/BP-BlockClass.cc
// store results (optional, copies data locally before fetch is called)
store results (optional, copies data locally before fetch is called)
store results ( optional copies data locally before fetch is called )
BP_ERROR_T Block::mysqlStoreResults()
{
	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::mysqlStoreResults(): Statement unset.");
		BP_BLOCK_MARIADB_LEAVE_CRITICAL_SECTION_AND_RETURN_FROM_FUNC(ERR_FAILURE);
	}
	if (BP_MySQLStoreResults(this->mysql_stmt, this->mysqlSession) == ERR_FAILURE)
	{
		this->AddErrorToStack((char*) "Error in Block::mysqlStoreResults(): Failed to store local result.");
		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 :: mysqlStoreResults ( ) { 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_MySQLStoreResults ( this -> mysql_stmt , this -> mysqlSession ) == ERR_FAILURE ) { 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 ) ; }
store results (optional, copies data locally before fetch is called)
store results ( optional copies data locally before fetch is called )
// ensure we have a mysql session // enter critical section // attempt reconnect if necessary // ensure we have a prepared statement // attempt to store results // return indicating success