Hi,

PostgreSQL allows to use version-specific configuration files, which allows to change some settings only for particular version of DB.

I think a similar enhancement would be nice and usable for administrators of MySQL as well.

Please, consider the attached patch as a simple proposal. Any comments are welcome.

Cheers,

Honza
diff -up mysql-5.5.22/mysys/default.c.versionedcnf mysql-5.5.22/mysys/default.c
--- mysql-5.5.22/mysys/default.c.versionedcnf	2012-03-02 20:44:47.000000000 +0100
+++ mysql-5.5.22/mysys/default.c	2012-04-25 14:51:32.824181063 +0200
@@ -37,6 +37,7 @@
 #include "m_string.h"
 #include "m_ctype.h"
 #include <my_dir.h>
+#include "mysql_version.h"
 #ifdef __WIN__
 #include <winbase.h>
 #endif
@@ -94,10 +95,10 @@ static my_bool defaults_already_read= FA
 static const char **default_directories = NULL;
 
 #ifdef __WIN__
-static const char *f_extensions[]= { ".ini", ".cnf", 0 };
+static const char *f_extensions[]= { ".ini", ".cnf", ".ini-" MYSQL_SERVER_VERSION, ".cnf-" MYSQL_SERVER_VERSION, 0 };
 #define NEWLINE "\r\n"
 #else
-static const char *f_extensions[]= { ".cnf", 0 };
+static const char *f_extensions[]= { ".cnf",  ".cnf-" MYSQL_SERVER_VERSION, 0 };
 #define NEWLINE "\n"
 #endif
 

-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/mysql

Reply via email to