Bug #60018 Report deprecated options in error log (some old options are missing)
Submitted: 8 Feb 2011 19:13
Reporter: Leandro Morgado Email Updates:
Status: Verified Impact on me:
None 
Category:MySQL Server: Options Severity:S3 (Non-critical)
Version:4.1 and above OS:Any
Assigned to: CPU Architecture:Any

[8 Feb 2011 19:13] Leandro Morgado
Description:
Usually deprecated options are documented and a warning is given in the error log. For example, if we use --log_slow_queries with 5.1/5.5 we get:

110208 19:54:13 mysqld_safe Starting mysqld daemon with databases from /home/lmorgado/sandboxes/msb_5_1_33/data
110208 19:54:13 [Warning] The syntax '--log_slow_queries' is deprecated and will be removed in MySQL 7.0. Please use '--slow_query_log'/'--slow_query_log_file' instead.

110208 19:58:08 mysqld_safe Starting mysqld daemon with databases from /home/lmorgado/sandboxes/rsandbox_5_5_8/master/data
110208 19:58:08 [Warning] The syntax '--log-slow-queries' is deprecated and will be removed in a future release. Please use '--slow-query-log'/'--slow-query-log-file' instead.

This is also documented in both manual entries:

 http://dev.mysql.com/doc/refman/5.1/en/server-options.html#option_mysqld_log-slow-queries
 http://dev.mysql.com/doc/refman/5.1/en/server-system-variables.html#sysvar_slow_query_log

However, for a number of very old options, they are documented as deprecated but no warning is given:

"The following startup variables and options were renamed:
Name in 3.23 	Name in 4.0 (and above)
myisam_bulk_insert_tree_size 	bulk_insert_buffer_size
query_cache_startup_type 	query_cache_type
record_buffer 	read_buffer_size
record_rnd_buffer 	read_rnd_buffer_size
sort_buffer 	sort_buffer_size
--warnings 	--log-warnings
--err-log 	--log-error (for mysqld_safe)

The startup options record_buffer, sort_buffer, and warnings still work in MySQL 4.0 but are deprecated."

 http://dev.mysql.com/doc/refman/4.1/en/upgrading-from-3-23.html

How to repeat:
For example:

shell>grep sort_buffer my.cnf 
sort_buffer=1234567

shell> restart mysql
110208 20:07:53 mysqld_safe mysqld from pid file /home/lmorgado/sandboxes/rsandbox_5_5_8/master/data/mysql_sandbox13213.pid ended
.110208 20:07:54 mysqld_safe Starting mysqld daemon with databases from /home/lmorgado/sandboxes/rsandbox_5_5_8/master/data
110208 20:07:54 [Warning] The syntax '--log-slow-queries' is deprecated and will be removed in a future release. Please use '--slow-query-log'/'--slow-query-log-file' instead.
110208 20:07:54 [Note] Plugin 'FEDERATED' is disabled.
InnoDB: The InnoDB memory heap is disabled
InnoDB: Mutexes and rw_locks use GCC atomic builtins
InnoDB: Compressed tables use zlib 1.2.3
110208 20:07:54  InnoDB: Using Linux native AIO
110208 20:07:54  InnoDB: Initializing buffer pool, size = 128.0M
110208 20:07:54  InnoDB: Completed initialization of buffer pool
110208 20:07:54  InnoDB: highest supported file format is Barracuda.
110208 20:07:54  InnoDB: 1.1.4 started; log sequence number 1599024
110208 20:07:54 [Note] Semi-sync replication initialized for transactions.
110208 20:07:54 [Note] Semi-sync replication enabled on the master.
110208 20:07:54 [Note] Event Scheduler: Loaded 0 events
110208 20:07:54 [Note] /home/lmorgado/5.5.8/bin/mysqld: ready for connections.
Version: '5.5.8-log'  socket: '/tmp/mysql_sandbox13213.sock'  port: 13213  MySQL Community Server (GPL)
 sandbox server started

mysql> SHOW VARIABLES LIKE "sort_buffer%";
+------------------+---------+
| Variable_name    | Value   |
+------------------+---------+
| sort_buffer_size | 1234567 |
+------------------+---------+
1 row in set (0.00 sec)

master [localhost] {msandbox} ((none)) > SHOW VARIABLES LIKE "log_slow_queries" ;
+------------------+-------+
| Variable_name    | Value |
+------------------+-------+
| log_slow_queries | ON    |
+------------------+-------+
1 row in set (0.00 sec)

master [localhost] {msandbox} ((none)) > SHOW VARIABLES LIKE "slow_query_log" ;
+----------------+-------+
| Variable_name  | Value |
+----------------+-------+
| slow_query_log | ON    |
+----------------+-------+
1 row in set (0.00 sec)

We see that both variables (sort_buffer and log_slow_queries) are set and accepted (both are deprecated) but only one warning is given.

Suggested fix:
*) Add warnings to the error log for all the old variables renamed in:
 http://dev.mysql.com/doc/refman/4.1/en/upgrading-from-3-23.html

*) Perhaps mention in the manual entry for sort_buffer_size that this is the "new" name for sort_buffer.
[8 Feb 2011 19:17] MySQL Verification Team
I fully agree with this request and think that this should be done even before 7.0, if possible .....
[8 Feb 2011 20:23] Simon Mudd
Also

read_buffer -> read_buffer_size
key_buffer  -> key_buffer_size

It's likely there are several other variables missing from this list.

My suggestion: put warnings in 5.5 (and remove in 5.6). If you're really paranoid put warnings in 5.6 and remove in the version afterwards.
[9 Feb 2011 11:01] Leandro Morgado
I believe most (if not all) the renamed variables are included in the manual page I linked above:

"The mysqld startup options --skip-locking and --enable-locking were renamed to --skip-external-locking and --external-locking. --skip-locking and --enable-locking are deprecated."

"The following startup variables and options were renamed:
Name in 3.23 	Name in 4.0 (and above)
myisam_bulk_insert_tree_size 	bulk_insert_buffer_size
query_cache_startup_type 	query_cache_type
record_buffer 	read_buffer_size
record_rnd_buffer 	read_rnd_buffer_size
sort_buffer 	sort_buffer_size
--warnings 	--log-warnings
--err-log 	--log-error (for mysqld_safe)"

"The following SQL variables have been renamed:
Name in 3.23 	Name in 4.0 and above
sql_big_tables 	big_tables
sql_low_priority_updates 	low_priority_updates
sql_max_join_size 	max_join_size
sql_query_cache_type 	query_cache_type"

 http://dev.mysql.com/doc/refman/4.1/en/upgrading-from-3-23.html