mirror of
				https://github.com/Icinga/icinga2.git
				synced 2025-10-31 11:14:10 +01:00 
			
		
		
		
	Revert "DB IDO: Make sure that all result sets are processed before sending another query"
This reverts commit b028ff2c33cc580d6cb0c063575d77a2f18ad0b1. refs #12597 refs #13321
This commit is contained in:
		
							parent
							
								
									6c975dab5f
								
							
						
					
					
						commit
						d076617caa
					
				| @ -513,21 +513,20 @@ void IdoMysqlConnection::FinishAsyncQueries(void) | ||||
| 			); | ||||
| 		} | ||||
| 
 | ||||
| 		std::vector<IdoMysqlResultInfo> resultSets; | ||||
| 
 | ||||
| 		for (std::vector<IdoAsyncQuery>::size_type i = offset; i < offset + count; i++) { | ||||
| 			const IdoAsyncQuery& aq = queries[i]; | ||||
| 
 | ||||
| 			MYSQL_RES *result = mysql_store_result(&m_Connection); | ||||
| 
 | ||||
| 			int affectedRows = mysql_affected_rows(&m_Connection); | ||||
| 			m_AffectedRows = mysql_affected_rows(&m_Connection); | ||||
| 
 | ||||
| 			IdoMysqlResult iresult; | ||||
| 
 | ||||
| 			if (!result) { | ||||
| 				if (mysql_field_count(&m_Connection) > 0) { | ||||
| 					std::ostringstream msgbuf; | ||||
| 					String message = mysql_error(&m_Connection); | ||||
| 					msgbuf << "Error \"" << message << "\" when checking field count \"" << aq.Query << "\""; | ||||
| 					msgbuf << "Error \"" << message << "\" when executing query \"" << aq.Query << "\""; | ||||
| 					Log(LogCritical, "IdoMysqlConnection", msgbuf.str()); | ||||
| 
 | ||||
| 					BOOST_THROW_EXCEPTION( | ||||
| @ -539,11 +538,8 @@ void IdoMysqlConnection::FinishAsyncQueries(void) | ||||
| 			} else | ||||
| 				iresult = IdoMysqlResult(result, std::ptr_fun(mysql_free_result)); | ||||
| 
 | ||||
| 			IdoMysqlResultInfo resultInfo; | ||||
| 			resultInfo.Result = iresult; | ||||
| 			resultInfo.AffectedRows = affectedRows; | ||||
| 
 | ||||
| 			resultSets.push_back(resultInfo); | ||||
| 			if (aq.Callback) | ||||
| 				aq.Callback(iresult); | ||||
| 
 | ||||
| 			if (mysql_next_result(&m_Connection) > 0) { | ||||
| 				std::ostringstream msgbuf; | ||||
| @ -559,17 +555,6 @@ void IdoMysqlConnection::FinishAsyncQueries(void) | ||||
| 			} | ||||
| 		} | ||||
| 
 | ||||
| 		for (std::vector<IdoAsyncQuery>::size_type i = offset; i < offset + count; i++) { | ||||
| 			const IdoAsyncQuery& aq = queries[i]; | ||||
| 
 | ||||
| 			const IdoMysqlResultInfo ri = resultSets[i - offset]; | ||||
| 
 | ||||
| 			m_AffectedRows = ri.AffectedRows; | ||||
| 
 | ||||
| 			if (aq.Callback) | ||||
| 				aq.Callback(ri.Result); | ||||
| 		} | ||||
| 
 | ||||
| 		offset += count; | ||||
| 	} | ||||
| } | ||||
|  | ||||
| @ -39,12 +39,6 @@ struct IdoAsyncQuery | ||||
| 	IdoAsyncCallback Callback; | ||||
| }; | ||||
| 
 | ||||
| struct IdoMysqlResultInfo | ||||
| { | ||||
| 	IdoMysqlResult Result; | ||||
| 	int AffectedRows; | ||||
| }; | ||||
| 
 | ||||
| /**
 | ||||
|  * An IDO MySQL database connection. | ||||
|  * | ||||
|  | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user