Skip to content

MySQL TIMESTAMP values always displayed in UTC — any way to configure catalog-level timezone? #28443

@kyeongjun-dev

Description

@kyeongjun-dev

Related: #23960

Environment

  • Trino version: 479 (upgraded from 397)
  • MySQL server timezone: Asia/Seoul
  • Trino session timezone: Asia/Seoul
  • MySQL column type: TIMESTAMP

Problem

Since #18470 (Trino 427), MySQL TIMESTAMP columns are mapped to timestamp(n) with time zone and values are always displayed in UTC.

SELECT orderdate FROM mysql_catalog.schema.table LIMIT 1;
-- Result: 2024-10-30 13:34:17 UTC
-- Expected: 2024-10-30 22:34:17 Asia/Seoul

I understand that AT TIME ZONE 'Asia/Seoul' can convert the display, and that the underlying data is correct (same instant in time). However, in our case, modifying queries is not feasible — we have many internal services that generate queries programmatically, and adding AT TIME ZONE to every timestamp column across all services would require significant effort.

What I've tried (none of these changed the display timezone)

  • JDBC URL: connectionTimeZone=Asia/Seoul&forceConnectionTimeZoneToSession=true
  • JVM option: -Duser.timezone=Asia/Seoul
  • Catalog property: jdbc.session-timezone=Asia/Seoul (error: property was not used)

Request

Is there a way to configure the MySQL catalog (or a session/system property) so that timestamp with time zone values are displayed in the session timezone instead of UTC?

For example, a catalog-level setting like jdbc.session-timezone (similar to the PostgreSQL connector) that would make query results render in the local timezone without requiring query modifications.

This would help users who upgraded from pre-427 versions where MySQL TIMESTAMP was mapped to timestamp(n) and displayed in the session timezone by default.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions