Loading ndb/include/util/File.hpp +8 −0 Original line number Diff line number Diff line Loading @@ -28,6 +28,14 @@ class File_class { public: /** * Returns time for last contents modification of a file. * * @param aFileName a filename to check. * @return the time for last contents modificaton of the file. */ static time_t mtime(const char* aFileName); /** * Returns true if the file exist. * Loading ndb/include/util/ndb_opts.h +1 −1 Original line number Diff line number Diff line Loading @@ -49,7 +49,7 @@ my_bool opt_core; { "ndb-connectstring", OPT_NDB_CONNECTSTRING, \ "Set connect string for connecting to ndb_mgmd. " \ "Syntax: \"[nodeid=<id>;][host=]<hostname>[:<port>]\". " \ "Overides specifying entries in NDB_CONNECTSTRING and Ndb.cfg", \ "Overrides specifying entries in NDB_CONNECTSTRING and my.cnf", \ (gptr*) &opt_connect_str, (gptr*) &opt_connect_str, 0, \ GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0 },\ { "ndb-shm", OPT_NDB_SHM,\ Loading ndb/src/common/logger/FileLogHandler.cpp +10 −1 Original line number Diff line number Diff line Loading @@ -147,6 +147,7 @@ FileLogHandler::createNewFile() bool rc = true; int fileNo = 1; char newName[PATH_MAX]; time_t newMtime, preMtime = 0; do { Loading @@ -159,7 +160,15 @@ FileLogHandler::createNewFile() } BaseString::snprintf(newName, sizeof(newName), "%s.%d", m_pLogFile->getName(), fileNo++); newMtime = File_class::mtime(newName); if (newMtime < preMtime) { break; } else { preMtime = newMtime; } } while (File_class::exists(newName)); m_pLogFile->close(); Loading ndb/src/common/util/File.cpp +12 −0 Original line number Diff line number Diff line Loading @@ -24,6 +24,18 @@ // // PUBLIC // time_t File_class::mtime(const char* aFileName) { MY_STAT stmp; time_t rc = 0; if (my_stat(aFileName, &stmp, MYF(0)) != NULL) { rc = stmp.st_mtime; } return rc; } bool File_class::exists(const char* aFileName) Loading ndb/src/kernel/blocks/dbdict/Dbdict.cpp +2 −1 Original line number Diff line number Diff line Loading @@ -2313,7 +2313,8 @@ void Dbdict::checkSchemaStatus(Signal* signal) tablePtr.p->tableType = (DictTabInfo::TableType)oldEntry->m_tableType; // On NR get index from master because index state is not on file const bool file = c_systemRestart || tablePtr.p->isTable(); const bool file = (* newEntry == * oldEntry) && (c_systemRestart || tablePtr.p->isTable()); restartCreateTab(signal, tableId, oldEntry, file); return; Loading Loading
ndb/include/util/File.hpp +8 −0 Original line number Diff line number Diff line Loading @@ -28,6 +28,14 @@ class File_class { public: /** * Returns time for last contents modification of a file. * * @param aFileName a filename to check. * @return the time for last contents modificaton of the file. */ static time_t mtime(const char* aFileName); /** * Returns true if the file exist. * Loading
ndb/include/util/ndb_opts.h +1 −1 Original line number Diff line number Diff line Loading @@ -49,7 +49,7 @@ my_bool opt_core; { "ndb-connectstring", OPT_NDB_CONNECTSTRING, \ "Set connect string for connecting to ndb_mgmd. " \ "Syntax: \"[nodeid=<id>;][host=]<hostname>[:<port>]\". " \ "Overides specifying entries in NDB_CONNECTSTRING and Ndb.cfg", \ "Overrides specifying entries in NDB_CONNECTSTRING and my.cnf", \ (gptr*) &opt_connect_str, (gptr*) &opt_connect_str, 0, \ GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0 },\ { "ndb-shm", OPT_NDB_SHM,\ Loading
ndb/src/common/logger/FileLogHandler.cpp +10 −1 Original line number Diff line number Diff line Loading @@ -147,6 +147,7 @@ FileLogHandler::createNewFile() bool rc = true; int fileNo = 1; char newName[PATH_MAX]; time_t newMtime, preMtime = 0; do { Loading @@ -159,7 +160,15 @@ FileLogHandler::createNewFile() } BaseString::snprintf(newName, sizeof(newName), "%s.%d", m_pLogFile->getName(), fileNo++); newMtime = File_class::mtime(newName); if (newMtime < preMtime) { break; } else { preMtime = newMtime; } } while (File_class::exists(newName)); m_pLogFile->close(); Loading
ndb/src/common/util/File.cpp +12 −0 Original line number Diff line number Diff line Loading @@ -24,6 +24,18 @@ // // PUBLIC // time_t File_class::mtime(const char* aFileName) { MY_STAT stmp; time_t rc = 0; if (my_stat(aFileName, &stmp, MYF(0)) != NULL) { rc = stmp.st_mtime; } return rc; } bool File_class::exists(const char* aFileName) Loading
ndb/src/kernel/blocks/dbdict/Dbdict.cpp +2 −1 Original line number Diff line number Diff line Loading @@ -2313,7 +2313,8 @@ void Dbdict::checkSchemaStatus(Signal* signal) tablePtr.p->tableType = (DictTabInfo::TableType)oldEntry->m_tableType; // On NR get index from master because index state is not on file const bool file = c_systemRestart || tablePtr.p->isTable(); const bool file = (* newEntry == * oldEntry) && (c_systemRestart || tablePtr.p->isTable()); restartCreateTab(signal, tableId, oldEntry, file); return; Loading