MCPcopy Create free account
hub / github.com/MaterializeInc/materialize / allocate_temporary_qualified_name

Method allocate_temporary_qualified_name

src/sql/src/plan/statement.rs:670–691  ·  view source on GitHub ↗
(
        &self,
        name: PartialItemName,
    )

Source from the content-addressed store, hash-verified

668 }
669
670 pub fn allocate_temporary_qualified_name(
671 &self,
672 name: PartialItemName,
673 ) -> Result<QualifiedItemName, PlanError> {
674 // Compare against the MZ_TEMP_SCHEMA constant directly instead of calling
675 // get_schema(), because with lazy temporary schema creation, the temp
676 // schema may not exist yet. (This is similar to what `allocate_temporary_full_name` was
677 // doing already before making temporary schemas lazy.)
678 if let Some(schema_name) = name.schema {
679 if schema_name != mz_repr::namespaces::MZ_TEMP_SCHEMA {
680 return Err(PlanError::InvalidTemporarySchema);
681 }
682 }
683
684 Ok(QualifiedItemName {
685 qualifiers: ItemQualifiers {
686 database_spec: ResolvedDatabaseSpecifier::Ambient,
687 schema_spec: SchemaSpecifier::Temporary,
688 },
689 item: name.item,
690 })
691 }
692
693 // Creates a `ResolvedItemName::Item` from a `GlobalId` and an
694 // `UnresolvedItemName`.

Callers 2

plan_create_tableFunction · 0.80
plan_viewFunction · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected