システム変数実装方法@set_var.ccの違い
mysql-5.0とmysql-5.1で異なっているようなので貼りつけておきます。
mysql-5.0での方法
- Use one of the 'sys_var... classes from set_var.h or write a specific one for the variable type. - Define it in the 'variable definition list' in this file. - If the variable should be changeable or one should be able to access it with @@variable_name, it should be added to the 'list of all variables' list (sys_variables) in this file. - If the variable is thread specific, add it to 'system_variables' struct. If not, add it to mysqld.cc and an declaration in 'mysql_priv.h' - If the variable should be changed from the command line, add a definition of it in the my_option structure list in mysqld.cc - Don't forget to initialize new fields in global_system_variables and max_system_variables! - If the variable should show up in 'show variables' add it to the init_vars[] struct in this file
mysql-5.1での方法
- Use one of the 'sys_var... classes from set_var.h or write a specific one for the variable type. - Define it in the 'variable definition list' in this file. - If the variable is thread specific, add it to 'system_variables' struct. If not, add it to mysqld.cc and an declaration in 'mysql_priv.h' - If the variable should be changed from the command line, add a definition of it in the my_option structure list in mysqld.cc - Don't forget to initialize new fields in global_system_variables and max_system_variables!
赤で色を付けた部分がなくなっています。mysql-5.0の改造をしていた時、このあたりが冗長だなぁと思っていたのですが、それがmysql-5.1ですっきり簡潔になったということかもしれません。