1
0
mirror of https://github.com/mariadb-corporation/mariadb-columnstore-engine.git synced 2025-07-30 19:23:07 +03:00

MCOL-446: update myCnf-include-args.text to fix variable name. Modify mycnfUpgrade to use regex search instead of find for more accurate variable searches, this would cause problem with generic variable 'port'.

This commit is contained in:
Ben Thompson
2017-12-05 16:58:06 -06:00
parent b112e826a2
commit 252880ebdf
2 changed files with 8 additions and 10 deletions

View File

@ -1,7 +1,7 @@
# List of my.cnf arguments that should be checked and saved during upgrade install # List of my.cnf arguments that should be checked and saved during upgrade install
# #
infinidb_local_query infinidb_local_query
log-bin=mysql-bin log-bin
server-id server-id
max_length_for_sort_data max_length_for_sort_data
tmpdir tmpdir

View File

@ -47,7 +47,7 @@
#include <climits> #include <climits>
#include <cstring> #include <cstring>
#include <glob.h> #include <glob.h>
#include <boost/regex.hpp>
#include "liboamcpp.h" #include "liboamcpp.h"
#include "installdir.h" #include "installdir.h"
@ -107,6 +107,7 @@ int main(int argc, char *argv[])
{ {
includeArg = line; includeArg = line;
boost::regex icludeArgRegEx("^#*\\s*" + includeArg + "\\s*=");
//see if in my.cnf.rpmsave //see if in my.cnf.rpmsave
ifstream mycnfsavefile (mycnfsaveFile.c_str()); ifstream mycnfsavefile (mycnfsaveFile.c_str());
char line[200]; char line[200];
@ -114,8 +115,7 @@ int main(int argc, char *argv[])
while (mycnfsavefile.getline(line, 200)) while (mycnfsavefile.getline(line, 200))
{ {
oldbuf = line; oldbuf = line;
string::size_type pos = oldbuf.find(includeArg,0); if ( boost::regex_search(oldbuf.begin(),oldbuf.end(),icludeArgRegEx) ) {
if ( pos != string::npos ) {
//found in my.cnf.rpmsave, check if this is commented out //found in my.cnf.rpmsave, check if this is commented out
if ( line[0] != '#' ) if ( line[0] != '#' )
{ {
@ -129,8 +129,7 @@ int main(int argc, char *argv[])
while (mycnffile.getline(line1, 200)) while (mycnffile.getline(line1, 200))
{ {
newbuf = line1; newbuf = line1;
string::size_type pos = newbuf.find(includeArg,0); if ( boost::regex_search(newbuf.begin(),newbuf.end(),icludeArgRegEx) ) {
if ( pos != string::npos ) {
newbuf = oldbuf; newbuf = oldbuf;
cout << "Updated argument: " << includeArg << endl; cout << "Updated argument: " << includeArg << endl;
updated = true; updated = true;
@ -161,8 +160,8 @@ int main(int argc, char *argv[])
while (mycnffile.getline(line1, 200)) while (mycnffile.getline(line1, 200))
{ {
newbuf = line1; newbuf = line1;
string::size_type pos = newbuf.find("[mysqld]",0); boost::regex mysqldSectionRegEx("\\[mysqld\\]");
if ( pos != string::npos ) { if ( boost::regex_search(newbuf.begin(),newbuf.end(),mysqldSectionRegEx) ) {
lines.push_back(newbuf); lines.push_back(newbuf);
newbuf = oldbuf; newbuf = oldbuf;
cout << "Added argument: " << includeArg << endl; cout << "Added argument: " << includeArg << endl;
@ -183,10 +182,9 @@ int main(int argc, char *argv[])
newFile.close(); newFile.close();
close(fd); close(fd);
break;
} }
} }
break;
} }
} }
} }