()
| 10 | /// CREATE FUNCTION succeeds and DROP FUNCTION removes it. |
| 11 | #[tokio::test(flavor = "multi_thread", worker_threads = 4)] |
| 12 | async fn create_and_drop_function() { |
| 13 | let server = TestServer::start().await; |
| 14 | |
| 15 | // Create a simple expression UDF. |
| 16 | let result = server |
| 17 | .exec("CREATE FUNCTION double_it(x INT) RETURNS INT AS SELECT x * 2") |
| 18 | .await; |
| 19 | assert!(result.is_ok(), "CREATE FUNCTION failed: {:?}", result); |
| 20 | |
| 21 | // DROP FUNCTION succeeds (proves it was stored in catalog). |
| 22 | let drop_result = server.exec("DROP FUNCTION double_it").await; |
| 23 | assert!( |
| 24 | drop_result.is_ok(), |
| 25 | "DROP FUNCTION failed: {:?}", |
| 26 | drop_result |
| 27 | ); |
| 28 | |
| 29 | // DROP again should fail (already dropped). |
| 30 | server |
| 31 | .expect_error("DROP FUNCTION double_it", "does not exist") |
| 32 | .await; |
| 33 | } |
| 34 | |
| 35 | /// CREATE OR REPLACE FUNCTION works. |
| 36 | #[tokio::test(flavor = "multi_thread", worker_threads = 4)] |
nothing calls this directly
no test coverage detected