[MDEV-29077] The table "general_log" did not close when the config option general_log was set into OFF dynamically Created: 2022-07-10 Updated: 2023-09-19 |
|
| Status: | Open |
| Project: | MariaDB Server |
| Component/s: | Admin statements |
| Affects Version/s: | 10.3, 10.4, 10.5, 10.6, 10.7, 10.8 |
| Fix Version/s: | 10.4, 10.5, 10.6 |
| Type: | Bug | Priority: | Minor |
| Reporter: | Star | Assignee: | Unassigned |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Environment: |
Linux |
||
| Description |
|
When we set the config option "general_log" as ON, and "log_output" as TABLE in the config file, MySQL records the related general logs into the table named "general_log". However, if we dynamically update the option "general_log" into OFF, the table "general_log" is still keeping open until "flush tables" command is entered. The ideal situation is that when general_log turns into OFF, the table general_log should be closed right now. Otherwise, the big table would occupy lots of cache, which might affect the performance of the cache-related operations. Similar situations are option "slow_query_log" and table "slow_log". Similarly, the table "general_log/slow_log" should be closed when config "log_output" set into NONE or File. How to repeat:
suggest to fix: static bool fix_general_log_file(sys_var *self, THD *thd, enum_var_type type) |
| Comments |
| Comment by Daniel Black [ 2022-07-11 ] |
|
fix_log_output should also play its part if the log_output ii\s chagned. close_log_table is the call to make. Parachute did you want to attempt to implement this? |
| Comment by Star [ 2022-07-11 ] |
|
Of course! I would attempt to implement this patch. If pass my test, I would attach it then. |
| Comment by Daniel Black [ 2022-07-11 ] |
|
As a pull request would be appreciated - https://mariadb.org/get-involved/getting-started-for-developers/submitting-pull-request/ Ask on https://mariadb.zulipchat.com if you are stuck on something. other guides which guide the contribution process. |