Details
-
Bug
-
Status: Closed (View Workflow)
-
Major
-
Resolution: Fixed
-
6.4.13
-
None
-
RHEL/CentOS 7
Description
On RHEL/CentOS 7 systems the memory accounting done for the query classifier cache does not correctly shrink the SQL statement to fit into memory before storing it in the cache. The result of this is that the size calculation, which is correct on modern operating systems, is wrong and the actual amount of memory is much larger.
This happens as the size of the string, not the capacity, is used to calculate the resulting memory usage. Since it's correct on all systems that do not implement the CoW std::string, the fix is to make sure that the CoW mechanism is not used.
I've attached a test case that reproduces the problem. To use it, modify the connection information and compile it with:
c++ -g -O2 standalone_random_queries.cc -lmariadb
|