This is an automated email from the ASF dual-hosted git repository.

yiguolei pushed a commit to branch branch-4.1
in repository https://gitbox.apache.org/repos/asf/doris.git


The following commit(s) were added to refs/heads/branch-4.1 by this push:
     new 83ebe6954f9 branch-4.1: [improvement](fe) Add current_database builtin 
alias #62591 (#62652)
83ebe6954f9 is described below

commit 83ebe6954f9690152d864ae1d7f46985793d1fb5
Author: github-actions[bot] 
<41898282+github-actions[bot]@users.noreply.github.com>
AuthorDate: Wed Apr 22 14:09:06 2026 +0800

    branch-4.1: [improvement](fe) Add current_database builtin alias #62591 
(#62652)
    
    Cherry-picked from #62591
    
    Co-authored-by: Tony Wasson <[email protected]>
---
 .../src/main/java/org/apache/doris/catalog/BuiltinScalarFunctions.java  | 2 +-
 regression-test/suites/query_p0/system/test_query_sys.groovy            | 1 +
 2 files changed, 2 insertions(+), 1 deletion(-)

diff --git 
a/fe/fe-core/src/main/java/org/apache/doris/catalog/BuiltinScalarFunctions.java 
b/fe/fe-core/src/main/java/org/apache/doris/catalog/BuiltinScalarFunctions.java
index c9ba5ccc61a..9f9094aedc6 100644
--- 
a/fe/fe-core/src/main/java/org/apache/doris/catalog/BuiltinScalarFunctions.java
+++ 
b/fe/fe-core/src/main/java/org/apache/doris/catalog/BuiltinScalarFunctions.java
@@ -724,7 +724,7 @@ public class BuiltinScalarFunctions implements 
FunctionHelper {
             scalar(CurrentUser.class, "current_user"),
             scalar(CutIpv6.class, "cut_ipv6"),
             scalar(CutToFirstSignificantSubdomain.class, 
"cut_to_first_significant_subdomain"),
-            scalar(Database.class, "database", "schema"),
+            scalar(Database.class, "database", "schema", "current_database"),
             scalar(Date.class, "date"),
             scalar(DateDiff.class, "datediff"),
             scalar(DateFormat.class, "date_format"),
diff --git a/regression-test/suites/query_p0/system/test_query_sys.groovy 
b/regression-test/suites/query_p0/system/test_query_sys.groovy
index 302780a2e25..f5e10f34ed6 100644
--- a/regression-test/suites/query_p0/system/test_query_sys.groovy
+++ b/regression-test/suites/query_p0/system/test_query_sys.groovy
@@ -20,6 +20,7 @@ suite("test_query_sys", "query,p0") {
 
     def tableName = "test"
     sql "SELECT DATABASE();"
+    sql "SELECT CURRENT_DATABASE();"
     sql "SELECT \"welecome to my blog!\";"
     sql "describe ${tableName};"
     sql "select version();"


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to