uqa_sql/routines/
configuration.rs1use crate::{ast::RoutineConfigAction, SQLError};
10
11pub fn validate_routine_config_action(action: &RoutineConfigAction) -> Result<(), SQLError> {
12 match action {
13 RoutineConfigAction::Set { name, .. } | RoutineConfigAction::FromCurrent { name }
14 if name.eq_ignore_ascii_case("transaction_isolation")
15 || name.eq_ignore_ascii_case("transaction_read_only")
16 || name.eq_ignore_ascii_case("transaction_deferrable") =>
17 {
18 Err(SQLError::Routine {
19 sqlstate: "0A000".into(),
20 message: format!("parameter \"{name}\" cannot be set locally in functions"),
21 })
22 }
23 _ => Ok(()),
24 }
25}