1
0
mirror of https://github.com/mariadb-corporation/mariadb-columnstore-engine.git synced 2025-11-27 08:21:15 +03:00

MCOL-3680 mysqld will abort if Columnstore.xml is missing

Add try-catch blocks in the plugin code to prevent mysqld
from aborting if configcpp cannot access Columnstore.xml.
This commit is contained in:
Gagan Goel
2020-01-23 17:41:02 +00:00
parent d62600c647
commit d0ffede135
4 changed files with 277 additions and 71 deletions

View File

@@ -114,19 +114,17 @@ Config* Config::makeConfig(const char* cf)
Config::Config(const string& configFile) :
fDoc(0), fConfigFile(configFile), fMtime(0), fParser()
{
for ( int i = 0 ; i < 20 ; i++ )
int i = 0;
for ( ; i < 2 ; i++ )
{
if (access(fConfigFile.c_str(), R_OK) != 0)
{
if ( i >= 15 )
throw runtime_error("Config::Config: error accessing config file " + fConfigFile);
sleep (1);
}
else
if (access(fConfigFile.c_str(), R_OK) == 0)
break;
sleep (1);
}
if ( i == 2 )
throw runtime_error("Config::Config: error accessing config file " + fConfigFile);
struct stat statbuf;
if (stat(configFile.c_str(), &statbuf) == 0)