diff --git a/rust/cubesql/cubesql/src/compile/engine/udf/common.rs b/rust/cubesql/cubesql/src/compile/engine/udf/common.rs index ee5d3e2310140..8d664c5e8793b 100644 --- a/rust/cubesql/cubesql/src/compile/engine/udf/common.rs +++ b/rust/cubesql/cubesql/src/compile/engine/udf/common.rs @@ -4346,13 +4346,6 @@ pub fn register_fun_stubs(mut ctx: SessionContext) -> SessionContext { register_fun_stub!(udf, "cosh", tsig = [Float64], rettyp = Float64); register_fun_stub!(udf, "cot", tsig = [Float64], rettyp = Float64); register_fun_stub!(udf, "cotd", tsig = [Float64], rettyp = Float64); - register_fun_stub!( - udf, - "current_catalog", - argc = 0, - rettyp = Utf8, - vol = Stable - ); register_fun_stub!(udf, "current_query", argc = 0, rettyp = Utf8, vol = Stable); register_fun_stub!(udf, "current_role", argc = 0, rettyp = Utf8, vol = Stable); register_fun_stub!( diff --git a/rust/cubesql/cubesql/src/compile/query_engine.rs b/rust/cubesql/cubesql/src/compile/query_engine.rs index fee95d644b756..62f4e56d806ce 100644 --- a/rust/cubesql/cubesql/src/compile/query_engine.rs +++ b/rust/cubesql/cubesql/src/compile/query_engine.rs @@ -436,6 +436,7 @@ impl QueryEngine for SqlQueryEngine { "PostgreSQL 14.2 on x86_64-cubesql".to_string(), )); ctx.register_udf(create_db_udf("current_database".to_string(), state.clone())); + ctx.register_udf(create_db_udf("current_catalog".to_string(), state.clone())); ctx.register_udf(create_db_udf("current_schema".to_string(), state.clone())); ctx.register_udf(create_current_user_udf( state.clone(), diff --git a/rust/cubesql/cubesql/src/compile/test/snapshots/cubesql__compile__test__test_introspection__datagrip_introspection.snap b/rust/cubesql/cubesql/src/compile/test/snapshots/cubesql__compile__test__test_introspection__datagrip_introspection.snap index b5517eaada1f5..72ecd7420c635 100644 --- a/rust/cubesql/cubesql/src/compile/test/snapshots/cubesql__compile__test__test_introspection__datagrip_introspection.snap +++ b/rust/cubesql/cubesql/src/compile/test/snapshots/cubesql__compile__test__test_introspection__datagrip_introspection.snap @@ -1,9 +1,9 @@ --- source: cubesql/src/compile/test/test_introspection.rs -expression: "execute_query(\"select current_database(), current_schema(), current_user;\".to_string(),\nDatabaseProtocol::PostgreSQL).await?" +expression: "execute_query(\"select current_database(), current_catalog, current_schema(), current_user;\".to_string(),\nDatabaseProtocol::PostgreSQL).await?" --- -+------------------+----------------+--------------+ -| current_database | current_schema | current_user | -+------------------+----------------+--------------+ -| cubedb | public | ovr | -+------------------+----------------+--------------+ ++------------------+-----------------+----------------+--------------+ +| current_database | current_catalog | current_schema | current_user | ++------------------+-----------------+----------------+--------------+ +| cubedb | cubedb | public | ovr | ++------------------+-----------------+----------------+--------------+ diff --git a/rust/cubesql/cubesql/src/compile/test/test_introspection.rs b/rust/cubesql/cubesql/src/compile/test/test_introspection.rs index 0b17967fc7c05..e8e9fef814750 100644 --- a/rust/cubesql/cubesql/src/compile/test/test_introspection.rs +++ b/rust/cubesql/cubesql/src/compile/test/test_introspection.rs @@ -842,7 +842,8 @@ async fn datagrip_introspection() -> Result<(), CubeError> { insta::assert_snapshot!( "datagrip_introspection", execute_query( - "select current_database(), current_schema(), current_user;".to_string(), + "select current_database(), current_catalog, current_schema(), current_user;" + .to_string(), DatabaseProtocol::PostgreSQL ) .await?