Skip to content

Commit

Permalink
ignore table names with a string length of 0 for write preserve and r…
Browse files Browse the repository at this point in the history
…ead areas
  • Loading branch information
t-horikawa committed Nov 6, 2023
1 parent 52ce033 commit b16006e
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions src/ogawayama/stub/connection.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -110,23 +110,29 @@ ErrorCode Connection::Impl::begin(const boost::property_tree::ptree& option, Tra
BOOST_FOREACH (const auto& wp_node, nodes.value()) {
auto wp = wp_node.second.get_optional<std::string>(TABLE_NAME);
if (wp) {
topt->add_write_preserves()->set_table_name(wp.value());
if (auto value = wp.value(); !value.empty()) {
topt->add_write_preserves()->set_table_name(value);
}
}
}
}
if (auto nodes = option.get_child_optional(INCLUSIVE_READ_AREA); nodes) {
BOOST_FOREACH (const auto& ra_node, nodes.value()) {
auto ra = ra_node.second.get_optional<std::string>(TABLE_NAME);
if (ra) {
topt->add_inclusive_read_areas()->set_table_name(ra.value());
if (auto value = ra.value(); !value.empty()) {
topt->add_inclusive_read_areas()->set_table_name(value);
}
}
}
}
if (auto nodes = option.get_child_optional(EXCLUSIVE_READ_AREA); nodes) {
BOOST_FOREACH (const auto& ra_node, nodes.value()) {
auto ra = ra_node.second.get_optional<std::string>(TABLE_NAME);
if (ra) {
topt->add_exclusive_read_areas()->set_table_name(ra.value());
if (auto value = ra.value(); !value.empty()) {
topt->add_exclusive_read_areas()->set_table_name(value);
}
}
}
}
Expand Down

0 comments on commit b16006e

Please sign in to comment.