[MDEV-25191] Replace sys schema configuration table (sys_config) with system variables. Created: 2021-03-18  Updated: 2021-12-28  Resolved: 2021-12-28

Status: Closed
Project: MariaDB Server
Component/s: OTHER
Fix Version/s: N/A

Type: Task Priority: Major
Reporter: Vladislav Vaintroub Assignee: Sergei Golubchik
Resolution: Won't Fix Votes: 0
Labels: None


 Description   

Right now, sys schema is using a table sys.sys_config to store own settings.
This is more or less reimplementation of global variables.
Presumably, sys_config a workaround that allowed sys schema to be used standalone, without any changes to existing server.
But since it is now integrated, there is no need to keep this "settings in a table" twist.



 Comments   
Comment by Sergei Golubchik [ 2021-03-19 ]

on the other hand, existing documentation and tools that work with sys schema rely on configuration table.

perhaps it might be better to keep it for compatibility reasons

Comment by Ralf Gebhardt [ 2021-03-19 ]

serg, do you mean to keep the table as a system view while adding system variables, like table GLOBAL_VARIABLES

Comment by Sergei Golubchik [ 2021-03-21 ]

no, I mean to preserve the table-based config like in the original sys schema

Comment by Vladislav Vaintroub [ 2021-03-21 ]

From examining how it is used , I do not think that this functionality (sys_config) is so important that it will make any problem if table-based is replaced with session variables.

I mean, we can speculate whether compatibility reasons are important or not, and continue to live with "session variables emulation in SQL" Frankensteinian creation, or try to remove it and see if anyone complains.

At least we can remove the code like this from the sources,

  -- Check if we have the configured length, if not, init it
  IF @sys.statement_truncate_len IS NULL THEN
      SET @sys.statement_truncate_len = sys_get_config('statement_truncate_len', 64);
  END IF;

Comment by Federico Razzoli [ 2021-12-28 ]

I don't believe this will make a huge difference for tooling and users, because currently sys doesn't have many, or superuseful, configuration variable.

But why is the table a "twist"? performance_schema has configuration tables, too. (Yes, I understand the reason and the difference, but still it has configuration written into tables)

You say that sys schema is now integrated. I'd say it's not integrated, it's just installed by default. In my opinion this is great, because it allows to make changes easily without changing MariaDB code.

Generated at Thu Feb 08 09:35:50 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.