Posted by Sheeri Cabral on Jun 9, 2009
Today’s contradiction:
MySQL has server variables named new and old.
The new variable can be set per-session and globally, and is dynamic. The old variable is not dynamic, and only global in scope. Both default to FALSE in MySQL 5.1.
According to the manual, the new variable:
was used in MySQL 4.0 to turn on some 4.1 behaviors, and is retained for backward compatibility.
That same page notes the following about the old variable:
when old is enabled, it changes the default scope of index hints to that used prior to MySQL 5.1.17. That is, index hints with no FOR clause apply only to how indexes are used for row retrieval and not to resolution of ORDER BY or GROUP BY clauses.
That’s right — the old variable changes some index hint behavior to before 5.1.17, and the new variable is provided for backwards compatibility of a 4.0 function.
Perhaps now that they have already used the vague terms, MySQL will stick to descriptive names, such as old_index_hints and new_behavior (or, even better, specifying what that new behavior is. If not in the variable itself, at least in the manual!)
Posted by Sheeri Cabral on Jan 8, 2008
The listing of Dynamic System Variables on the MySQL Reference Manual’s page is supposed to show those variables you can change on-the-fly.
innodb_data_home_dir is listed there as a dynamic variable, but it is not one, and trying to change it on-the-fly doesn’t work:
mysql> set global innodb_data_home_dir="/data/mysql/data";
ERROR 1193 (HY000): Unknown system variable 'innodb_data_home_dir'
mysql> set session innodb_data_home_dir="/data/mysql/data";
ERROR 1193 (HY000): Unknown system variable 'innodb_data_home_dir'
The same goes when trying to use SET @@innodb_data_home_dir, and with log-slow-queries (changed to log_slow_queries as a parameter, of course). The irony is that innodb_data_home_dir shows up when SHOW VARIABLES is issued — so SHOW VARIABLES shows variables that MySQL is not aware of.
The link at the top is a link to the 4.1 version of the manual, just in case folks are thinking I’m using a newer manual version. Mind you, I have this problem with 5.0.45 as well as 4.1.20.
And of course the manual specifies, “The last column indicates for each variable whether GLOBAL or SESSION (or both) apply.” Which seems to be untrue.