Uploaded image for project: 'Percona Server for MySQL'
  1. Percona Server for MySQL
  2. PS-7221

Modify get_int_sort_key_for_item_inline to return UTC string

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Done
    • Priority: Medium
    • Resolution: Fixed
    • Affects Version/s: Not 5.7.x, 8.0.20-11
    • Fix Version/s: 8.0.21-12
    • Component/s: None
    • Labels:

      Description

       

      Reproduciable test case:

       

      create table crasher (id int unsigned not null auto_increment, dt datetime not null, primary key (id));
      insert into crasher set dt=now();
      insert into crasher (dt) select now() from crasher;
      insert into crasher (dt) select now() from crasher;
      insert into crasher (dt) select now() from crasher;
      insert into crasher (dt) select now() from crasher;
      insert into crasher (dt) select now() from crasher;
      
      mysql [localhost] {msandbox} (test) > select c.id from crasher c order by convert_tz(dt,'UTC',@@session.time_zone);
      ERROR 2013 (HY000): Lost connection to MySQL server during query
      

       

       

       

      14:24:12 UTC - mysqld got signal 11 ;
      Most likely, you have hit a bug, but this error can also be caused by malfunctioning hardware.
      Thread pointer: 0x7fdcc0c18000
      Attempting backtrace. You can use the following information to find out
      where mysqld died. If you see no messages after this, something went
      terribly wrong...
      stack_bottom = 7fdcf98efc20 thread_stack 0x46000
      /home/lalit/mysql_tar/percona/8.0.20/bin/mysqld(my_print_stacktrace(unsigned char const*, unsigned long)+0x2e) [0x1fa2bee]
      /home/lalit/mysql_tar/percona/8.0.20/bin/mysqld(handle_fatal_signal+0x323) [0x11cd1e3]
      /lib/x86_64-linux-gnu/libpthread.so.0(+0x128a0) [0x7fdcfc8a88a0]
      /home/lalit/mysql_tar/percona/8.0.20/bin/mysqld(Sys_var_tz::session_value_ptr(THD*, THD*, MYSQL_LEX_STRING*)+0x1d) [0x116b1dd]
      /home/lalit/mysql_tar/percona/8.0.20/bin/mysqld(Item_func_get_system_var::val_str(String*)+0x403) [0xe7be93]
      /home/lalit/mysql_tar/percona/8.0.20/bin/mysqld(Item::val_str_ascii(String*)+0x1e) [0xdf765e]
      /home/lalit/mysql_tar/percona/8.0.20/bin/mysqld(Item_func_convert_tz::get_date(MYSQL_TIME*, unsigned int)+0xcf) [0xee679f]
      /home/lalit/mysql_tar/percona/8.0.20/bin/mysqld(Item_datetime_func::val_date_temporal()+0x1e) [0xee43ae]
      /home/lalit/mysql_tar/percona/8.0.20/bin/mysqld(Sort_param::make_sortkey(Bounds_checked_array<unsigned char>, unsigned char const*, unsigned long*)+0x686) [0x12c1c26]
      /home/lalit/mysql_tar/percona/8.0.20/bin/mysqld() [0x12c27c9]
      /home/lalit/mysql_tar/percona/8.0.20/bin/mysqld(filesort(THD*, Filesort*, RowIterator*, Filesort_info*, Sort_result*, unsigned long long*)+0xbf8) [0x12c3468]
      /home/lalit/mysql_tar/percona/8.0.20/bin/mysqld(SortingIterator::DoSort()+0x74) [0xfd7df4]
      /home/lalit/mysql_tar/percona/8.0.20/bin/mysqld(SortingIterator::Init()+0x17) [0xfd7e67]
      /home/lalit/mysql_tar/percona/8.0.20/bin/mysqld(SELECT_LEX_UNIT::ExecuteIteratorQuery(THD*)+0x332) [0x1156012]
      /home/lalit/mysql_tar/percona/8.0.20/bin/mysqld(SELECT_LEX_UNIT::execute(THD*)+0x2c) [0x115625c]
      /home/lalit/mysql_tar/percona/8.0.20/bin/mysqld(Sql_cmd_dml::execute_inner(THD*)+0x39b) [0x10e249b]
      /home/lalit/mysql_tar/percona/8.0.20/bin/mysqld(Sql_cmd_dml::execute(THD*)+0x5a9) [0x10ec529]
      /home/lalit/mysql_tar/percona/8.0.20/bin/mysqld(mysql_execute_command(THD*, bool)+0x189d) [0x108f72d]
      /home/lalit/mysql_tar/percona/8.0.20/bin/mysqld(mysql_parse(THD*, Parser_state*, bool)+0x410) [0x1093b70]
      /home/lalit/mysql_tar/percona/8.0.20/bin/mysqld(dispatch_command(THD*, COM_DATA const*, enum_server_command)+0x204e) [0x109606e]
      /home/lalit/mysql_tar/percona/8.0.20/bin/mysqld(do_command(THD*)+0x1e4) [0x1096cc4]
      /home/lalit/mysql_tar/percona/8.0.20/bin/mysqld() [0x11be880]
      /home/lalit/mysql_tar/percona/8.0.20/bin/mysqld() [0x247ee4c]
      /lib/x86_64-linux-gnu/libpthread.so.0(+0x76db) [0x7fdcfc89d6db]
      /lib/x86_64-linux-gnu/libc.so.6(clone+0x3f) [0x7fdcfa720a3f]
      Trying to get some variables.
      Some pointers may be invalid and cause the dump to abort.
      Query (7fdcc0e30028): select c.id from crasher c order by convert_tz(dt,'UTC',@@session.time_zone)
      Connection ID (thread ID): 8
      Status: NOT_KILLED
      Please help us make Percona Server better by reporting any
      bugs at https://bugs.percona.com/
      

       

      Workaround

      mysql [localhost] {msandbox} (test) > pager md5sum;
      PAGER set to 'md5sum'
      mysql [localhost] {msandbox} (test) > SELECT c.id FROM crasher c GROUP BY c.id ORDER BY CONVERT_TZ(MIN(dt),'UTC',@my_tz);
      be21a548585c7521fd56204afc98cbac -
      32 rows in set (0.02 sec)
      
      mysql [localhost] {msandbox} (test) > SELECT c.id FROM crasher c GROUP BY c.id ORDER BY MIN(dt);
      be21a548585c7521fd56204afc98cbac -
      32 rows in set (0.00 sec)
      mysql [localhost] {msandbox} (test) > nopager;
      PAGER set to stdout
      

       

      You can use a bellow query which gives the same result.

      mysql [localhost] {msandbox} (test) > SELECT c.id FROM crasher c GROUP BY c.id ORDER BY MIN(dt);

       

       

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              marcelo.altmann Marcelo Altmann
              Reporter:
              lalit.choudhary Lalit Choudhary
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:

                  Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - Not Specified
                  Not Specified
                  Logged:
                  Time Spent - 6 hours, 30 minutes
                  6h 30m

                    Smart Checklist