MCPcopy Create free account
hub / github.com/NodeDB-Lab/nodedb / reject_dml_in_function_body

Function reject_dml_in_function_body

nodedb/tests/function_security_e2e.rs:56–66  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

54/// DML in function body is rejected at CREATE time.
55#[tokio::test(flavor = "multi_thread", worker_threads = 4)]
56async fn reject_dml_in_function_body() {
57 let server = TestServer::start().await;
58
59 server
60 .expect_error(
61 "CREATE FUNCTION bad_func(x INT) RETURNS INT AS \
62 BEGIN INSERT INTO t (id) VALUES (x); RETURN x; END",
63 "side-effecting",
64 )
65 .await;
66}
67
68/// Procedural UDF with IF/ELSE compiles successfully.
69#[tokio::test(flavor = "multi_thread", worker_threads = 4)]

Callers

nothing calls this directly

Calls 1

expect_errorMethod · 0.80

Tested by

no test coverage detected