Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/common/config/config_file.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -979,14 +979,14 @@ ConfigFile::SectionType ConfigFile::Parameter::parseSectionKey() const
{
return SectionType::DATABASE_REGEX;
}
else if (name == "service")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change will break existing trace configs. I strongly disagree.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When reviewing #8427 I missed that trace-specific routine was put into common class.
It is ConfigFile::Parameter::parseSectionKey() and related enum class SectionType.
I think both must be moved out of ConfigFile::Parameter into TraceCfgReader.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think both must be moved out of ConfigFile::Parameter into TraceCfgReader.

+1

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change will break existing trace configs. I strongly disagree.

Existing configurations are using the key 'services'. It was my mistake in the original PR where I incorrectly set the key as 'service'."

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When reviewing #8427 I missed that trace-specific routine was put into common class. It is ConfigFile::Parameter::parseSectionKey() and related enum class SectionType. I think both must be moved out of ConfigFile::Parameter into TraceCfgReader.

I have moved the method

else if (name == "services")
{
return SectionType::SERVICE;
return SectionType::SERVICES;
}
else
{
fatal_exception::raiseFmt("error while parsing trace configuration\n\t"
"line %d: wrong section header, \"database\", \"databaseName\", \"databaseRegex\" or \"service\" is expected",
"line %d: wrong section header, \"database\", \"databaseName\", \"databaseRegex\" or \"services\" is expected",
line);

// Return something to calm down the compiler
Expand Down
2 changes: 1 addition & 1 deletion src/common/config/config_file.h
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ class ConfigFile : public Firebird::AutoStorage, public Firebird::RefCounted
DATABASE,
DATABASE_NAME,
DATABASE_REGEX,
SERVICE
SERVICES
};

struct Parameter : public AutoStorage
Expand Down
2 changes: 1 addition & 1 deletion src/utilities/ntrace/TraceConfiguration.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ void TraceCfgReader::readConfig()
const ConfigFile::Parameter* section = &params[n];

const ConfigFile::SectionType sectionType = section->parseSectionKey();
const bool isDatabase = (sectionType != ConfigFile::SectionType::SERVICE);
const bool isDatabase = (sectionType != ConfigFile::SectionType::SERVICES);

const ConfigFile::String pattern = section->value;
bool match = false;
Expand Down
Loading