Context:
 When introducing the optimize rest API tests and manually testing them against MySQL we found out that there's an issue. A support case SUPPORT-7162 opened by Nokia shows that they're already affected by it. 
A similar issue was already fixed with CAM-10513.
Steps to reproduce:
- given:
	- I have MySQL as a database connected to the engine
- I have several decision instances evaluated
- In total, I have more than 2100 decision variables created in the engine
 
- when:
	- I use the Optimize rest API or the engine history decision instance endpoint to fetch all the decision instances with their decision variables at once
 
- then:
	- I get the following error in the engine (see the full log attached full_error.txt ) )
 
- I get the following error in the engine (see the full log attached full_error.txt
- expected:
	- I can fetch all the data without any problems
 
AT:
- the bug is fixed