WL#8048: Non-intrusive refactoring of Refactoring of Security_context class code
Affects: Server-5.7 — Status: Complete — Priority: Medium
This WL is a step in refactoring of Security_context class code. It collects the source code changes which do not affect behavior (non-intrusive changes). These are like making a public class member and provide public getter/setter to it.
NF1: Code refactoring should not effect the current behavior. NF2: Should work on all platforms.
Most of the Security_context class members are public. Code accessing and modifying them is spread in many files of MySQL code. As part of this work log, all public data members of Security_context are converted to private ones and public accessor methods are introduced for them. THD::security_ctx is also converted to private data member of THD and public accessor methods are introduced. The code refactoring will be done in the following phases, Phase 1: -------- New getter method for "THD::security_ctx: member will be introduced. Places where "THD::security_ctx" is accessed directly will be changed to use the getter function "THD::security_context()". Phase 2: -------- All the public data members of Security_context class will be converted to private members of it and accessor methods are introduced for them. Following data members are converted to private members of Security_context class, * Security_context::user * Security_context::priv_user * Security_context::proxy_user * Security_context::priv_host * Security_context::host_or_ip * Security_context::master_access * Security_context::db_access * Security_context::password_expired. Getter methods for the char array type data members will return object of type LEX_CSTRING. So that caller can just access value but not modify. Code accessing Security_context::members directly will be replaced to use the getter method. And code modifying these members will be replaced with setter method.
Copyright (c) 2000, 2018, Oracle Corporation and/or its affiliates. All rights reserved.