Bug #82631 std::basic_string instantiation w/ PFS instrumentation for the DD
Submitted: 18 Aug 2016 11:45 Modified: 22 Aug 2016 15:38
Reporter: Dyre Tjeldvoll Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: DDL Severity:S3 (Non-critical)
Version:8.0.1 OS:Any
Assigned to: CPU Architecture:Any

[18 Aug 2016 11:45] Dyre Tjeldvoll
Description:
Currently the DD code uses std::string which really is an instantiation of std::basic_string using char as the character type and std::allocator<char> as the allocator. This means that the memory used to hold the strings is allocated directly on the system heap without performance schema instrumentation, which is undesirable.

How to repeat:
N/A

Suggested fix:
1. Create a typedef alias for the string and stringstream type to use in the DD code. Initially it will refer to std::string and std::stringstream.

2. Substitute the typedefs for all usage of std::string and std::stringstream in the DD code.

3. Create a new PFS key (or rename one not being used). Use it to create a callable type which allocates memory with this key. Use that to instantiate stateless_allocator. Use that to instantiate std::basic_string and create a typedef for this. 

4. Switch the typedef from 1. from std::string to the new type create in 3.

Each of these steps can be pushed separately. There should not be any change in behavior until step 4. and even then there should not be any functional change, since the interface to the string type is the same.
[22 Aug 2016 15:38] Paul Dubois
Posted by developer:
 
Fixed in 8.0.1.

No user-visible changes. No changelog entry needed.
[26 Aug 2016 15:09] Paul Dubois
Posted by developer:
 
Fixed in 8.0.1.

Code cleanup. No changelog entry needed.
[27 Aug 2016 14:31] Dyre Tjeldvoll
Posted by developer:
 
Setting to VERIFIED and clearing reviewed flag in preparation for the fourth
patch
[2 Sep 2016 6:52] Dyre Tjeldvoll
Posted by developer:
 
Setting to VERIFIED and clearing reviewed flag in preparation for the fifth
patch