Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MySQL (incompatible change): handle !include directives in the middle of sections #245

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

lutter
Copy link
Member

@lutter lutter commented May 22, 2015

MySQL (incompatible change): handle !include directives in the middle…

CentOS 6.6 (at least) ships with a mysql.conf that has a !include directive
in the middle of a section. To accomodate that, we pull !include directives
into the sections in which they appear rather than having htem end the
section. That's the incompatible change: these directives now appear
underneath /target/!include rather than at /!include

Fixes #113

… of sections

CentOS 6.6 (at least) ships with a mysql.conf that has a !include directive
in the middle of a section. To accomodate that, we pull !include directives
into the sections in which they appear rather than having htem end the
section. That's the incompatible change: these directives now appear
underneath /target/!include rather than at /!include

Fixes hercules-team#113
@raphink
Copy link
Member

raphink commented May 27, 2015

Is that really necessary though?

@lutter
Copy link
Member Author

lutter commented Jun 1, 2015

I can't come up with another way to allow this sort of format. Would love to see a backwards compatible fix. Do you have any ideas on how ?

@raphink
Copy link
Member

raphink commented Jun 12, 2015

I'll have a look

@raphink
Copy link
Member

raphink commented Jun 12, 2015

I don't really get the issue. If I add !include statements in the middle of the file, they get parsed OK:

diff --git a/lenses/tests/test_mysql.aug b/lenses/tests/test_mysql.aug
index 9356204..8fe752f 100644
--- a/lenses/tests/test_mysql.aug
+++ b/lenses/tests/test_mysql.aug
@@ -110,6 +110,9 @@ quick
 quote-names
 max_allowed_packet     = 16M

+!includedir /etc/mysql/middle_include
+!include /etc/mysql/middle_include.conf
+
 [mysql]
 #no-auto-rehash        # faster start of mysql but no tab completition
$ augparsediff -c -I lenses/ lenses/tests/test_mysql.aug 
Syntax error in lens definition
Failed to load lenses/tests/test_mysql.aug
--- expected    2015-06-12 11:25:32.982707547 +0200
+++ actual  2015-06-12 11:25:32.986707733 +0200
@@ -113,6 +113,9 @@
     { "max_allowed_packet" = "16M" }
     {  }
   }
+  { "!includedir" = "/etc/mysql/middle_include" }
+  { "!include" = "/etc/mysql/middle_include.conf" }
+  {  }
   { "target" = "mysql"
     { "#comment" = "no-auto-rehash # faster start of mysql but no tab completition" }
     {  }

@raphink
Copy link
Member

raphink commented Jun 12, 2015

Ah sorry @lutter, @domcleal just explained to me what you meant… I see the issue now…

I guess there would be an option of allowing include statements inside sections but not at the end of the section, but that wouldn't be very intuitive. So if that's not an option, your fix is the only way.

@raphink
Copy link
Member

raphink commented Feb 25, 2019

@lutter should we merge this then?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

will not parse my.cnf if any !include directives are present
2 participants