Bug #89031 Need a stable API for handling dd::Properties
Submitted: 22 Dec 2017 11:57 Modified: 9 Oct 2018 18:46
Reporter: Sivert Sørumgård Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: Data Dictionary Severity:S3 (Non-critical)
Version: OS:Any
Assigned to: CPU Architecture:Any

[22 Dec 2017 11:57] Sivert Sørumgård
Description:
After WL#6378, some of the DD objects contain instances of a class 'dd::Properties', which is a list of key/value pairs. These instances are directly accessible through the API of the DD objects, allowing clients to e.g. add new key/value pairs. In one way, this exposes an implementation detail of the DD objects, and allows clients to add new attributes to the DD objects. Thus, the dd::Properties objects should be hidden behind a stable API, disallowing adding new keys on the fly.

How to repeat:
.

Suggested fix:
This can be improved by e.g. one of the following alternatives:

1. Wrapping the dd::Properties objects in set/get functions for each supported key.
2. Implementing generic set/get functions for the relevant types (String_type, integers, ...) and an enumeration of the valid keys. 

Some of the key/value lists are storage engine specific, so this must also be taken into account.
[8 Oct 2018 6:54] Sivert Sørumgård
Posted by developer:
 
Patch has been approved, setting to correct state manually.
[9 Oct 2018 18:46] Daniel Price
Posted by developer:
 
Fixed as of the upcoming 8.0.14 release, and here's the changelog entry:

The data dictionary properties interface (dd::Properties) and
implementation was revised to provide a new method of defining valid keys
for property objects.