mirror of
https://github.com/GreptimeTeam/greptimedb.git
synced 2026-08-18 03:58:29 +00:00
feat: supports select @@session.time_zone (#6212)
This commit is contained in:
@@ -339,6 +339,8 @@ pub async fn test_mysql_timezone(store_type: StorageType) {
|
||||
|
||||
let timezone = conn.fetch_all("SELECT @@time_zone").await.unwrap();
|
||||
assert_eq!(timezone[0].get::<String, usize>(0), "Asia/Shanghai");
|
||||
let timezone = conn.fetch_all("SELECT @@session.time_zone").await.unwrap();
|
||||
assert_eq!(timezone[0].get::<String, usize>(0), "Asia/Shanghai");
|
||||
let timezone = conn.fetch_all("SELECT @@system_time_zone").await.unwrap();
|
||||
assert_eq!(timezone[0].get::<String, usize>(0), "UTC");
|
||||
let _ = conn.execute("SET time_zone = 'UTC'").await.unwrap();
|
||||
@@ -367,6 +369,8 @@ pub async fn test_mysql_timezone(store_type: StorageType) {
|
||||
let _ = conn.execute("SET time_zone = '+08:00'").await.unwrap();
|
||||
let timezone = conn.fetch_all("SELECT @@time_zone").await.unwrap();
|
||||
assert_eq!(timezone[0].get::<String, usize>(0), "+08:00");
|
||||
let timezone = conn.fetch_all("SELECT @@session.time_zone").await.unwrap();
|
||||
assert_eq!(timezone[0].get::<String, usize>(0), "+08:00");
|
||||
|
||||
let rows2 = conn.fetch_all("select ts from demo").await.unwrap();
|
||||
// we use Utc here for format only
|
||||
@@ -391,6 +395,8 @@ pub async fn test_mysql_timezone(store_type: StorageType) {
|
||||
);
|
||||
let timezone = conn.fetch_all("SELECT @@time_zone").await.unwrap();
|
||||
assert_eq!(timezone[0].get::<String, usize>(0), "-07:00");
|
||||
let timezone = conn.fetch_all("SELECT @@session.time_zone").await.unwrap();
|
||||
assert_eq!(timezone[0].get::<String, usize>(0), "-07:00");
|
||||
|
||||
let _ = fe_mysql_server.shutdown().await;
|
||||
guard.remove_all().await;
|
||||
|
||||
Reference in New Issue
Block a user