oceanbase / oceanbase/seekdb

Fix error 1298 when executing SET @@session.time_zone='UTC' in mysqltest time_zone.time_zone_literal test on Windows

Open
#642 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

dima type: bug
Dominant language
C++
Stars
2.9k
Forks
339
Avg merge
1d 19h
Merged PRs (30d)
52

Description

Description

Two related issues were observed in the test suite:

  1. In test to_char_decode_percentile_sqlqa.to_char_supplement_mysql, the TO_CHAR(BIGINT boundary) function incorrectly returns 1 for the MAX value and triggers error 4013 for the MIN value.
  2. The mysqltest case time_zone.time_zone_literal fails on Windows when executing the statement SET @@session.time_zone='UTC', resulting in error 1298.

Actual Result

Two screenshots were provided showing the test failures and error details.

Steps to Reproduce

  1. Log into the target machine.
  2. Navigate to the directory: /obdata/data/AndroidTest/ob_opensource_test/tools/deploy
  3. Execute the following commands to set up the test environment and run the specific test case:
    export OCEANBASE_HOME=/obdata/data/AndroidTest/ob_opensource_test/
    cd ${OCEANBASE_HOME}/tools/deploy
    source activate_obd.sh
    export OBD_SEEKDB_STATUS_FALLBACK_TCP=1
    
    obd test mysqltest test_env --mysqltest-bin=${OCEANBASE_HOME}/deps/3rd/u01/obclient/bin/mysqltest --obclient-bin=${OCEANBASE_HOME}/deps/3rd/u01/obclient/bin/obclient --init-only --init-sql-dir=${OCEANBASE_HOME}/tools/deploy --init-sql-files='init.sql,init_user.sql|root@sys|test'
    obd test mysqltest test_env --mysqltest-bin=${OCEANBASE_HOME}/deps/3rd/u01/obclient/bin/mysqltest --obclient-bin=${OCEANBASE_HOME}/deps/3rd/u01/obclient/bin/obclient --disable-reboot --test-set=time_zone.time_zone_literal
    
  4. The failure occurs when the test executes the following SQL (specifically at the SET @@session.time_zone='UTC' statement):
    DROP DATABASE IF EXISTS tzdb;
    CREATE DATABASE tzdb;
    USE tzdb;
    
    SET @session_time_zone = @@SESSION.time_zone;
    SET @global_time_zone = @@GLOBAL.time_zone;
    SET @session_error_on_overlap_time = @@SESSION.error_on_overlap_time;
    SET @global_error_on_overlap_time = @@GLOBAL.error_on_overlap_time;
    
    CREATE TABLE t1(c1 INT, c2 DATETIME);
    CREATE TABLE t2(c1 INT, c2 TIMESTAMP);
    
    -- ###############   case 1 : test for valid string literal to datetime   #################
    INSERT INTO t1 VALUES(1, '2012-01-02 01:01:01');
    INSERT INTO t1 VALUES(2, '2012-01-02 01:01:01');
    SELECT * FROM t1;
    
    -- ###############   case 2 : test for invalid string literal to datetime   #################
    
    INSERT INTO t1 VALUES(3, '1990-09-15 23:00:00 Asia/Shanghai CDT');
    INSERT INTO t1 VALUES(4, '1990-09-15 23:00:00 asia/shanghai cst');
    INSERT INTO t1 VALUES(5, '1990-09-15 23:00:00 Asia/Shanghai');
    INSERT INTO t1 VALUES(6, '1990-09-15 23:00:00 Asia/Shanghaiiii');
    INSERT INTO t1 VALUES(6, '1990-09-15 23:00:00 Asia/Shanghai abc');
    INSERT INTO t1 VALUES(6, '1990-09-15 23:00:00 Asia/Shanghai LMT');
    SELECT * FROM t1;
    
    -- ###############   case 3 :Failure point #################
    SET @@session.error_on_overlap_time = TRUE;
    SET @@session.time_zone = 'UTC';
    

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by running the mysqltest.time_zone.time_zone_literal case with the provided obd commands and inspect the failure at SET @@session.time_zone='UTC' on Windows. Also verify the separately reported to_char_decode_percentile_sqlqa.to_char_supplement_mysql results. Done means the relevant test failures no longer occur and the expected timezone and TO_CHAR behavior is covered by the test results.

Written by the indexing model from the issue text.

Assessment

Tech stack
mysql, sql
Domain
databases, operating-systems, testing-qa
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Needs clarification
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.