Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 0 additions & 7 deletions rust/cubesql/cubesql/src/compile/engine/udf/common.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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!(
Expand Down
1 change: 1 addition & 0 deletions rust/cubesql/cubesql/src/compile/query_engine.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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(),
Expand Down
Original file line number Diff line number Diff line change
@@ -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 |
+------------------+-----------------+----------------+--------------+
Original file line number Diff line number Diff line change
Expand Up @@ -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?
Expand Down
Loading