Skip to content

Commit 48670b9

Browse files
ssorumgarddahlerlend
authored andcommitted
WL#6391: Post-push fix.
Table objects were stored unnecssarily while maintaining the hidden attribute. Update the attribute and store the object only if necessary.
1 parent 1386fde commit 48670b9

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

sql/dd/impl/bootstrapper.cc

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -782,11 +782,15 @@ bool add_cyclic_foreign_keys(THD *thd)
782782
if (thd->dd_client()->acquire(std::string(MYSQL_SCHEMA_NAME.str),
783783
(*it)->entity()->name(), &table))
784784
return true;
785-
std::unique_ptr<Table_impl> table_clone(
786-
dynamic_cast<Table_impl*>(table->clone()));
787-
table_clone->set_hidden((*it)->entity()->hidden());
788-
if (thd->dd_client()->store(static_cast<Table*>(table_clone.get())))
789-
return end_transaction(thd, true);
785+
786+
if (table->hidden() != (*it)->entity()->hidden())
787+
{
788+
std::unique_ptr<Table_impl> table_clone(
789+
dynamic_cast<Table_impl*>(table->clone()));
790+
table_clone->set_hidden((*it)->entity()->hidden());
791+
if (thd->dd_client()->store(static_cast<Table*>(table_clone.get())))
792+
return end_transaction(thd, true);
793+
}
790794
end_transaction(thd, false);
791795
}
792796

0 commit comments

Comments
 (0)