MCPcopy Create free account
hub / github.com/ByConity/ByConity / generateUUIDForTable

Function generateUUIDForTable

src/Interpreters/InterpreterCreateQuery.cpp:1038–1049  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1036}
1037
1038static void generateUUIDForTable(ASTCreateQuery & create)
1039{
1040 if (create.uuid == UUIDHelpers::Nil)
1041 create.uuid = UUIDHelpers::generateV4();
1042
1043 /// If destination table (to_table_id) is not specified for materialized view,
1044 /// then MV will create inner table. We should generate UUID of inner table here,
1045 /// so it will be the same on all hosts if query in ON CLUSTER or database engine is Replicated.
1046 bool need_uuid_for_inner_table = !create.attach && create.is_materialized_view && !create.to_table_id;
1047 if (need_uuid_for_inner_table && create.to_inner_uuid == UUIDHelpers::Nil)
1048 create.to_inner_uuid = UUIDHelpers::generateV4();
1049}
1050
1051void InterpreterCreateQuery::assertOrSetUUID(ASTCreateQuery & create, const DatabasePtr & database) const
1052{

Callers 2

assertOrSetUUIDMethod · 0.85
prepareOnClusterQueryMethod · 0.85

Calls 1

generateV4Function · 0.85

Tested by

no test coverage detected