library/src/blockclass/BP-BlockClass.cc
// Real query can contain binary data, specify query length appropriately
// or face the consequences.
Real query can contain binary data, specify query length appropriately
or face the consequences.
Real query can contain binary data specify query length appropriately or face the consequences .
int Block::MysqlRealQuery(char *query, size_t len)
{
	if(!this->mysqlSession)
		return BP_MYSQL_QUERY_ERROR_CODE_NO_SESSION;
	while(!this->mysqlSession->connected)
	{
		BP_MySQLAddErr(this->mysqlSession, BP_MYSQL_ERROR_CONNECT, 0, "Block is not connected to the database.", BPLN);
		this->MySQLReconnect();
	}
	int ret_val = BP_MySQLRealQuery(mysqlSession, query, len);
	BP_BLOCK_MARIADB_LEAVE_CRITICAL_SECTION_AND_RETURN_FROM_FUNC(ret_val);
}
int Block :: MysqlRealQuery ( char * query , size_t len ) { if ( ! this -> mysqlSession ) return BP_MYSQL_QUERY_ERROR_CODE_NO_SESSION ; while ( ! this -> mysqlSession -> connected ) { BP_MySQLAddErr ( this -> mysqlSession , BP_MYSQL_ERROR_CONNECT , 0 , " " , BPLN ) ; this -> MySQLReconnect ( ) ; } int ret_val = BP_MySQLRealQuery ( mysqlSession , query , len ) ; BP_BLOCK_MARIADB_LEAVE_CRITICAL_SECTION_AND_RETURN_FROM_FUNC ( ret_val ) ; }
Real query can contain binary data, specify query length appropriately
or face the consequences.
Real query can contain binary data specify query length appropriately or face the consequences .
// ensure we have a mysql session // attempt reconnect if necessary // attempt to run the query // leave critical section and return value of query