Uploaded image for project: 'MariaDB Server'
  1. MariaDB Server
  2. MDEV-27393

Timezone tables cannot have descending indexes

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 10.8
    • Fix Version/s: 10.8.1
    • Component/s: Time zones
    • Labels:
      None

      Description

      Timezone initialization has a logic which presumes that (certain) tables have ascending indexes, and if it's not so, initialization fails – either with an error on a non-debug build, or with a debug assertion.

      ALTER TABLE mysql.time_zone_transition_type DROP PRIMARY KEY;
      ALTER TABLE mysql.time_zone_transition_type ADD PRIMARY KEY (`Time_zone_id`,`Transition_type_id` DESC);
       
      --source include/restart_mysqld.inc
       
      SET @@time_zone='Japan';
      

      preview-10.8-MDEV-13756-desc-indexes 383b51d6 non-debug

      2021-12-31 19:42:43 3 [ERROR] Error while loading time zone description from mysql.time_zone_transition table: bad transition type id
      

      mysqltest: At line 6: query 'SET @@time_zone='Japan'' failed: ER_UNKNOWN_TIME_ZONE (1298): Unknown or incorrect time zone: 'Japan'
      

      preview-10.8-MDEV-13756-desc-indexes 383b51d6 debug

      mariadbd: /data/src/preview-10.8-MDEV-13756-desc-indexes-gcov/sql/tztime.cc:2007: Time_zone* tz_load_from_open_tables(const String*, TABLE_LIST*): Assertion `ttid >= tmp_tz_info.typecnt' failed.
      211231 19:44:21 [ERROR] mysqld got signal 6 ;
       
      #7  0x00007fe1e0fe2662 in __GI___assert_fail (assertion=0x556d94e6f867 "ttid >= tmp_tz_info.typecnt", file=0x556d94e6f1b8 "/data/src/preview-10.8-MDEV-13756-desc-indexes-gcov/sql/tztime.cc", line=2007, function=0x556d94e6f6b0 "Time_zone* tz_load_from_open_tables(const String*, TABLE_LIST*)") at assert.c:101
      #8  0x0000556d938afe9c in tz_load_from_open_tables (tz_name=0x7fe1c0017c58, tz_tables=0x7fe1dc1a4f90) at /data/src/preview-10.8-MDEV-13756-desc-indexes-gcov/sql/tztime.cc:2007
      #9  0x0000556d938b192d in my_tz_find (thd=0x7fe1c0000db8, name=0x7fe1c0017c58) at /data/src/preview-10.8-MDEV-13756-desc-indexes-gcov/sql/tztime.cc:2344
      #10 0x0000556d93993741 in Sys_var_tz::do_check (this=0x556d96557740 <Sys_time_zone>, thd=0x7fe1c0000db8, var=0x7fe1c0017cb0) at /data/src/preview-10.8-MDEV-13756-desc-indexes-gcov/sql/sys_vars.ic:2205
      #11 0x0000556d9339f3d9 in sys_var::check (this=0x556d96557740 <Sys_time_zone>, thd=0x7fe1c0000db8, var=0x7fe1c0017cb0) at /data/src/preview-10.8-MDEV-13756-desc-indexes-gcov/sql/set_var.cc:246
      #12 0x0000556d933a2671 in set_var::check (this=0x7fe1c0017cb0, thd=0x7fe1c0000db8) at /data/src/preview-10.8-MDEV-13756-desc-indexes-gcov/sql/set_var.cc:810
      #13 0x0000556d933a1e71 in sql_set_variables (thd=0x7fe1c0000db8, var_list=0x7fe1c00060d8, free=true) at /data/src/preview-10.8-MDEV-13756-desc-indexes-gcov/sql/set_var.cc:738
      #14 0x0000556d935e2463 in mysql_execute_command (thd=0x7fe1c0000db8, is_called_from_prepared_stmt=false) at /data/src/preview-10.8-MDEV-13756-desc-indexes-gcov/sql/sql_parse.cc:5034
      #15 0x0000556d935f63bc in mysql_parse (thd=0x7fe1c0000db8, rawbuf=0x7fe1c0017b80 "SET @@time_zone='Japan'", length=23, parser_state=0x7fe1dc1a6500) at /data/src/preview-10.8-MDEV-13756-desc-indexes-gcov/sql/sql_parse.cc:8028
      #16 0x0000556d935cd73f in dispatch_command (command=COM_QUERY, thd=0x7fe1c0000db8, packet=0x7fe1c000b989 "SET @@time_zone='Japan'", packet_length=23, blocking=true) at /data/src/preview-10.8-MDEV-13756-desc-indexes-gcov/sql/sql_parse.cc:1894
      #17 0x0000556d935ca930 in do_command (thd=0x7fe1c0000db8, blocking=true) at /data/src/preview-10.8-MDEV-13756-desc-indexes-gcov/sql/sql_parse.cc:1402
      #18 0x0000556d93927261 in do_handle_one_connection (connect=0x556d98a22238, put_in_cache=true) at /data/src/preview-10.8-MDEV-13756-desc-indexes-gcov/sql/sql_connect.cc:1418
      #19 0x0000556d93926a68 in handle_one_connection (arg=0x556d98a22238) at /data/src/preview-10.8-MDEV-13756-desc-indexes-gcov/sql/sql_connect.cc:1312
      #20 0x0000556d9420bdb4 in pfs_spawn_thread (arg=0x556d98a1f728) at /data/src/preview-10.8-MDEV-13756-desc-indexes-gcov/storage/perfschema/pfs.cc:2201
      #21 0x00007fe1e14acea7 in start_thread (arg=<optimized out>) at pthread_create.c:477
      #22 0x00007fe1e10abdef in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95
      

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              serg Sergei Golubchik
              Reporter:
              elenst Elena Stepanova
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:

                  Git Integration

                  Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.