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

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


The following commit(s) were added to refs/heads/branch-4.0 by this push:
     new 5ce43acb1c9 branch-4.0: [fix](information_schema) Fix timezone format 
incompatibility when using offset timezone #58412 (#58480)
5ce43acb1c9 is described below

commit 5ce43acb1c9fa26ff5a855098380073668969092
Author: github-actions[bot] 
<41898282+github-actions[bot]@users.noreply.github.com>
AuthorDate: Fri Nov 28 14:43:27 2025 +0800

    branch-4.0: [fix](information_schema) Fix timezone format incompatibility 
when using offset timezone #58412 (#58480)
    
    Cherry-picked from #58412
    
    Co-authored-by: zy-kkk <[email protected]>
---
 be/src/exec/schema_scanner.cpp                                |  1 +
 be/src/exec/schema_scanner.h                                  |  1 +
 be/src/exec/schema_scanner/schema_active_queries_scanner.cpp  |  2 +-
 be/src/exec/schema_scanner/schema_partitions_scanner.cpp      |  2 +-
 be/src/exec/schema_scanner/schema_processlist_scanner.cpp     |  2 +-
 .../info_schema_db/test_information_schema_timezone.groovy    | 11 +++++++++++
 6 files changed, 16 insertions(+), 3 deletions(-)

diff --git a/be/src/exec/schema_scanner.cpp b/be/src/exec/schema_scanner.cpp
index 3c734f2f4c2..b606e0eb742 100644
--- a/be/src/exec/schema_scanner.cpp
+++ b/be/src/exec/schema_scanner.cpp
@@ -159,6 +159,7 @@ Status SchemaScanner::init(RuntimeState* state, 
SchemaScannerParam* param, Objec
     }
 
     _param = param;
+    _timezone = state->timezone();
     _timezone_obj = state->timezone_obj();
     _is_init = true;
 
diff --git a/be/src/exec/schema_scanner.h b/be/src/exec/schema_scanner.h
index 3c21b719318..c8634fa2133 100644
--- a/be/src/exec/schema_scanner.h
+++ b/be/src/exec/schema_scanner.h
@@ -145,6 +145,7 @@ protected:
     std::atomic<bool> _eos = false;
     std::atomic<bool> _opened = false;
     std::atomic<bool> _async_thread_running = false;
+    std::string _timezone;
     cctz::time_zone _timezone_obj;
 };
 
diff --git a/be/src/exec/schema_scanner/schema_active_queries_scanner.cpp 
b/be/src/exec/schema_scanner/schema_active_queries_scanner.cpp
index 1331b662886..623c5ce7b96 100644
--- a/be/src/exec/schema_scanner/schema_active_queries_scanner.cpp
+++ b/be/src/exec/schema_scanner/schema_active_queries_scanner.cpp
@@ -63,7 +63,7 @@ Status 
SchemaActiveQueriesScanner::_get_active_queries_block_from_fe() {
     }
     schema_table_params.replay_to_other_fe = true;
     schema_table_params.__isset.replay_to_other_fe = true;
-    schema_table_params.__set_time_zone(_timezone_obj.name());
+    schema_table_params.__set_time_zone(_timezone);
 
     TFetchSchemaTableDataRequest request;
     request.__set_schema_table_name(TSchemaTableName::ACTIVE_QUERIES);
diff --git a/be/src/exec/schema_scanner/schema_partitions_scanner.cpp 
b/be/src/exec/schema_scanner/schema_partitions_scanner.cpp
index 0c16e9cf864..5d091c15769 100644
--- a/be/src/exec/schema_scanner/schema_partitions_scanner.cpp
+++ b/be/src/exec/schema_scanner/schema_partitions_scanner.cpp
@@ -126,7 +126,7 @@ Status 
SchemaPartitionsScanner::get_onedb_info_from_fe(int64_t dbId) {
     
schema_table_request_params.__set_current_user_ident(*_param->common_param->current_user_ident);
     schema_table_request_params.__set_catalog(*_param->common_param->catalog);
     schema_table_request_params.__set_dbId(dbId);
-    schema_table_request_params.__set_time_zone(_timezone_obj.name());
+    schema_table_request_params.__set_time_zone(_timezone);
 
     TFetchSchemaTableDataRequest request;
     request.__set_schema_table_name(TSchemaTableName::PARTITIONS);
diff --git a/be/src/exec/schema_scanner/schema_processlist_scanner.cpp 
b/be/src/exec/schema_scanner/schema_processlist_scanner.cpp
index 69367556767..e60ef2532fe 100644
--- a/be/src/exec/schema_scanner/schema_processlist_scanner.cpp
+++ b/be/src/exec/schema_scanner/schema_processlist_scanner.cpp
@@ -57,7 +57,7 @@ SchemaProcessListScanner::~SchemaProcessListScanner() = 
default;
 Status SchemaProcessListScanner::start(RuntimeState* state) {
     TShowProcessListRequest request;
     request.__set_show_full_sql(true);
-    request.__set_time_zone(state->timezone_obj().name());
+    request.__set_time_zone(state->timezone());
 
     for (const auto& fe_addr : _param->common_param->fe_addr_list) {
         TShowProcessListResult tmp_ret;
diff --git 
a/regression-test/suites/external_table_p0/info_schema_db/test_information_schema_timezone.groovy
 
b/regression-test/suites/external_table_p0/info_schema_db/test_information_schema_timezone.groovy
index ede50175343..7e803e8f146 100644
--- 
a/regression-test/suites/external_table_p0/info_schema_db/test_information_schema_timezone.groovy
+++ 
b/regression-test/suites/external_table_p0/info_schema_db/test_information_schema_timezone.groovy
@@ -225,4 +225,15 @@ suite("test_information_schema_timezone", 
"p0,external,hive,kerberos,external_do
 
     // set time_zone back
     sql """ SET time_zone = "Asia/Shanghai" """
+
+    // 8. Test offset format timezone (e.g. +08:00)
+    // This tests the fix for cctz returning "Fixed/UTC+08:00:00" format
+    sql """ SET time_zone = '+08:00' """
+    sql """
+        select a.*, b.*, c.NAME as WORKLOAD_GROUP_NAME
+        from information_schema.active_queries a
+        left join information_schema.backend_active_tasks b on a.QUERY_ID = 
b.QUERY_ID
+        left join information_schema.workload_groups c on a.WORKLOAD_GROUP_ID 
= c.ID
+    """
+    sql """ SET time_zone = "Asia/Shanghai" """
 }


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

Reply via email to