Bug #106122 [Tencent]session track of collation_connection missing character_set_connectioB
Submitted: 10 Jan 2022 8:25 Modified: 10 Jan 2022 9:42
Reporter: yuxiang jiang (OCA) Email Updates:
Status: Verified Impact on me:
None 
Category:MySQL Server: Options Severity:S3 (Non-critical)
Version:5.7.36 OS:Any
Assigned to: CPU Architecture:Any
Tags: Contribution

[10 Jan 2022 8:25] yuxiang jiang
Description:
After executing 'set collation_connection='utf8_general_ci'; ', system variable character_set_connection also changed. But server does not return character_set_connection's session track if session_track_system_variables is enabled.

How to repeat:
step 1
set global session_track_system_variables='time_zone,autocommit,character_set_client,character_set_results,character_set_connection,collation_connection';

step 2
set collation_connection='utf8_general_ci';

step 3
Check returned session track.

Suggested fix:
Check collation_connection variable when set session variables and mark character_set_connection change changed also.
[10 Jan 2022 8:30] yuxiang jiang
Contribute by Tencent
[10 Jan 2022 9:42] MySQL Verification Team
Hello yuxiang jiang,

Thank you for the report and feedback.

regards,
Umesh
[11 Jan 2022 2:15] yuxiang jiang
contribute from Tencent

(*) I confirm the code being submitted is offered under the terms of the OCA, and that I am authorized to contribute it.

Contribution: 0001-bugfix-session-track-of-collation_connection-missing.patch (application/octet-stream, text), 1.54 KiB.

[11 Jan 2022 5:02] MySQL Verification Team
Thank you for your contribution.

Sincerely,
Umesh
[12 Jan 2022 9:54] Georgi Kodinov
Thank you for trying to solve this valid problem. However this is not the right fix as it will be adding extra checks for all system variables being set. 

A better fix would be to update the tracker in a more specific place and not in the common function.