Uploaded image for project: 'Ignite'
  1. Ignite
  2. IGNITE-22780

Sql. Cast from VARCHAR to TS WITH LOCAL TZ doesn't take into account time zone

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • None
    • 3.0
    • sql

    Description

      Let's take a look at case below:

              sql("CREATE TABLE tmp (id INT PRIMARY KEY, s VARCHAR(100))");
              sql("INSERT INTO tmp VALUES (1, '1970-01-01 12:00:00')");
      
              ZoneId zone = ZoneOffset.ofHours(4);
      
              assertQuery("INSERT INTO test SELECT s FROM tmp WHERE id = 1")
                      .withTimeZoneId(zone)
                      .check();
      
              assertQuery("SELECT * FROM test")
                      .returns(Instant.parse("1970-01-01T08:00:00Z"))
                      .check();
      

      Although client which does INSERT with implicit cast from VARCHAR to TS WITH LOCAL TZ has zone offset of +4 hours, last query returns 1970-01-01T12:00:00Z.

      Attachments

        Issue Links

          Activity

            People

              korlov Konstantin Orlov
              korlov Konstantin Orlov
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 20m
                  20m