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

Function plan_role_variable

src/sql/src/plan/statement/ddl.rs:4493–4517  ·  view source on GitHub ↗
(
    scx: &StatementContext,
    variable: SetRoleVar,
)

Source from the content-addressed store, hash-verified

4491}
4492
4493fn plan_role_variable(
4494 scx: &StatementContext,
4495 variable: SetRoleVar,
4496) -> Result<PlannedRoleVariable, PlanError> {
4497 let plan = match variable {
4498 SetRoleVar::Set { name, value } => {
4499 let name = name.to_string();
4500 let value = scl::plan_set_variable_to(value)?;
4501 // Gate feature-flagged isolation levels, matching the `SET` and
4502 // connection-option paths in `SessionVars::set`.
4503 if let VariableValue::Values(values) = &value {
4504 vars::check_transaction_isolation_feature_flag(
4505 &name,
4506 VarInput::SqlSet(values),
4507 scx.catalog.system_vars(),
4508 )?;
4509 }
4510 PlannedRoleVariable::Set { name, value }
4511 }
4512 SetRoleVar::Reset { name } => PlannedRoleVariable::Reset {
4513 name: name.to_string(),
4514 },
4515 };
4516 Ok(plan)
4517}
4518
4519pub fn describe_create_role(
4520 _: &StatementContext,

Callers 1

plan_alter_roleFunction · 0.85

Calls 5

plan_set_variable_toFunction · 0.85
SqlSetClass · 0.50
to_stringMethod · 0.45
system_varsMethod · 0.45

Tested by

no test coverage detected