Bug #58121 different MySQL behavior while using open_files_limit vs open-files-limit my.cnf
Submitted: 10 Nov 2010 17:01 Modified: 11 Nov 2010 16:42
Reporter: DBA Lead Email Updates:
Status: Can't repeat Impact on me:
None 
Category:MySQL Server: Installing Severity:S2 (Serious)
Version:5.0/5.1 OS:Linux (CentOS/Debian)
Assigned to: CPU Architecture:Any
Tags: MySQL, open files

[10 Nov 2010 17:01] DBA Lead
Description:
I am kind of confused after seeing this strange MySQL behavior while using open-files-limit and open_files_limit. 

Other variables/options remaining constant:
Used open-files-limit first:

$ sudo grep limit /etc/my.cnf | grep open
open-files-limit=100000

#restarted Mysql 

$ mysql -uadmin -p -hlocalhost -e "SHOW VARIABLES LIKE 'open_files_limit'"
Enter password:
+------------------+--------+
| Variable_name    | Value  |
+------------------+--------+
| open_files_limit | 100000 |
+------------------+--------+

Then I used open_files_limit instead:

$ sudo grep limit /etc/my.cnf | grep open
#open-files-limit=100000
open_files_limit=100000

# Restarted MySQL

$ mysql -uadmin -p -hlocalhost -e "SHOW VARIABLES LIKE 'open_files_limit'"
Enter password:
+------------------+-------+
| Variable_name    | Value |
+------------------+-------+
| open_files_limit | 65535 |
+------------------+-------+

As you can see the open_files_limit variable has different values in both cases.  What I understood from http://dev.mysql.com/doc/refman/5.1/en/program-variables.html is that we can use underscores and hyphens interchangeably.

Please explain or fix this bug.
Thanks.

How to repeat:
Modify the configuration file each time using either open_files_limit or open-files-limit and restart mysql after each change. You should see different behavior in both cases.
[10 Nov 2010 17:07] Valeriy Kravchuk
Please, upload the entire my.cnf. I wonder what section open_files_limit is used at ([mysqld] or [mysqld_safe])...
[10 Nov 2010 17:14] DBA Lead
[mysqld] in both cases.
[10 Nov 2010 18:39] Valeriy Kravchuk
What exact versions, 5.0.x and 5.1.y, are we talking about? Check bug #47095.
[10 Nov 2010 18:50] DBA Lead
5.1.45 and 5.0.51a-24

So what exactly is the difference b/w '_' and '-' in variable/option names. Shouldn't they be the same thing as mentioned on the web page I shared above? Please explain.

Thanks.
[11 Nov 2010 4:19] Valeriy Kravchuk
We had the problem with open_files_limit as you can conclude from bug #47095. Only version with '-' was taken into account. It was a bug.

Please, check if the problem is repeatable with a recent version, 5.1.52.
[11 Nov 2010 16:32] DBA Lead
you are right

using open_files_limit and open-files-limit both have the same affect in mysql 5.1.52.

Thanks.
[11 Nov 2010 16:42] Valeriy Kravchuk
Not repeatable with 5.1.52.
[1 Dec 2010 7:17] Arjen Lentz
This sounds like a dup of http://bugs.mysql.com/40368

If you read that bug (as I reported), it's visual behaviour is very confusing and can easily lead to incorrect conclusions. However, the bug was there, can be verified, and was addressed in 5.0 OurDelta, MariaDB, and MySQL 5.5