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

Assertion `m_status == DA_ERROR' failed in Diagnostics_area::sql_errno or wrong result upon SHOW TABLE STATUS after adding partition under ANSI_QUOTES

    XMLWordPrintable

Details

    Description

      --source include/have_partition.inc
       
      CREATE TABLE t1 (a INT) PARTITION BY RANGE(a) (PARTITION p0 VALUES LESS THAN (5));
       
      SET sql_mode='ANSI_QUOTES';
      ALTER TABLE t1 ADD PARTITION (PARTITION p1 VALUES LESS THAN (10));
      SET sql_mode= @@global.sql_mode;
      SHOW TABLE STATUS;
       
      # Cleanup
      DROP TABLE t1;
      

      10.2 debug 9827c5e1031

      mysqld: /data/src/10.2/sql/sql_error.h:728: uint Diagnostics_area::sql_errno() const: Assertion `m_status == DA_ERROR' failed.
      180720 19:35:58 [ERROR] mysqld got signal 6 ;
       
      #7  0x00007f3f2e426ee2 in __assert_fail () from /lib/x86_64-linux-gnu/libc.so.6
      #8  0x0000560600f2da76 in Diagnostics_area::sql_errno (this=0x7f3f18005cc8) at /data/src/10.2/sql/sql_error.h:728
      #9  0x000056060108f8b8 in fill_schema_table_by_open (thd=0x7f3f18000b00, is_show_fields_or_keys=false, table=0x7f3f180695e8, schema_table=0x560602392740 <schema_tables+1920>, orig_db_name=0x7f3f180181c8, orig_table_name=0x7f3f18018358, open_tables_state_backup=0x7f3f287007f0, can_deadlock=false) at /data/src/10.2/sql/sql_show.cc:4383
      #10 0x000056060109101f in get_all_tables (thd=0x7f3f18000b00, tables=0x7f3f18013cd0, cond=0x0) at /data/src/10.2/sql/sql_show.cc:5001
      #11 0x00005606010a11d0 in get_schema_tables_result (join=0x7f3f18015d60, executed_place=PROCESSED_BY_JOIN_EXEC) at /data/src/10.2/sql/sql_show.cc:8350
      #12 0x000056060103dbf9 in JOIN::exec_inner (this=0x7f3f18015d60) at /data/src/10.2/sql/sql_select.cc:3559
      #13 0x000056060103d2b2 in JOIN::exec (this=0x7f3f18015d60) at /data/src/10.2/sql/sql_select.cc:3390
      #14 0x000056060103e47d in mysql_select (thd=0x7f3f18000b00, tables=0x7f3f18013cd0, wild_num=0, fields=..., conds=0x0, og_num=0, order=0x0, group=0x0, having=0x0, proc_param=0x0, select_options=2684619520, result=0x7f3f18015d40, unit=0x7f3f180046d8, select_lex=0x7f3f18004e10) at /data/src/10.2/sql/sql_select.cc:3790
      #15 0x000056060103290f in handle_select (thd=0x7f3f18000b00, lex=0x7f3f18004610, result=0x7f3f18015d40, setup_tables_done_option=0) at /data/src/10.2/sql/sql_select.cc:376
      #16 0x0000560600ffe101 in execute_sqlcom_select (thd=0x7f3f18000b00, all_tables=0x7f3f18013cd0) at /data/src/10.2/sql/sql_parse.cc:6474
      #17 0x0000560600ff4140 in mysql_execute_command (thd=0x7f3f18000b00) at /data/src/10.2/sql/sql_parse.cc:3481
      #18 0x0000560601001ec1 in mysql_parse (thd=0x7f3f18000b00, rawbuf=0x7f3f18012478 "SHOW TABLE STATUS", length=17, parser_state=0x7f3f28702200, is_com_multi=false, is_next_command=false) at /data/src/10.2/sql/sql_parse.cc:7995
      #19 0x0000560600fef9e6 in dispatch_command (command=COM_QUERY, thd=0x7f3f18000b00, packet=0x7f3f181772d1 "SHOW TABLE STATUS", packet_length=17, is_com_multi=false, is_next_command=false) at /data/src/10.2/sql/sql_parse.cc:1821
      #20 0x0000560600fee349 in do_command (thd=0x7f3f18000b00) at /data/src/10.2/sql/sql_parse.cc:1375
      #21 0x000056060113f60a in do_handle_one_connection (connect=0x560603aaf590) at /data/src/10.2/sql/sql_connect.cc:1335
      #22 0x000056060113f397 in handle_one_connection (arg=0x560603aaf590) at /data/src/10.2/sql/sql_connect.cc:1241
      #23 0x0000560601561690 in pfs_spawn_thread (arg=0x560603a8a0d0) at /data/src/10.2/storage/perfschema/pfs.cc:1862
      #24 0x00007f3f300fd494 in start_thread (arg=0x7f3f28703700) at pthread_create.c:333
      #25 0x00007f3f2e4e393f in clone () from /lib/x86_64-linux-gnu/libc.so.6
      

      Non-debug version doesn't crash, but the result isn't good either:

      MariaDB [test]> SHOW TABLE STATUS;
      +------+--------+---------+------------+------+----------------+-------------+-----------------+--------------+-----------+----------------+-------------+-------------+------------+-----------+----------+----------------+---------+
      | Name | Engine | Version | Row_format | Rows | Avg_row_length | Data_length | Max_data_length | Index_length | Data_free | Auto_increment | Create_time | Update_time | Check_time | Collation | Checksum | Create_options | Comment |
      +------+--------+---------+------------+------+----------------+-------------+-----------------+--------------+-----------+----------------+-------------+-------------+------------+-----------+----------+----------------+---------+
      | t1   | NULL   |    NULL | NULL       | NULL |           NULL |        NULL |            NULL |         NULL |      NULL |           NULL | NULL        | NULL        | NULL       | NULL      |     NULL | NULL           |         |
      +------+--------+---------+------------+------+----------------+-------------+-----------------+--------------+-----------+----------------+-------------+-------------+------------+-----------+----------+----------------+---------+
      1 row in set, 1 warning (0.00 sec)
       
      MariaDB [test]> SHOW WARNINGS;
      +---------+------+---------+
      | Level   | Code | Message |
      +---------+------+---------+
      | Warning | 1105 |         |
      +---------+------+---------+
      1 row in set (0.00 sec)
      

      Reproducible with at least MyISAM and InnoDB.
      Not reproducible on 10.1.

      The problem appeared in 10.2.7 release, my guess is after MDEV-13089, but I didn't check specifically before/after this bug fix.

      Attachments

        Activity

          People

            serg Sergei Golubchik
            elenst Elena Stepanova
            Votes:
            0 Vote for this issue
            Watchers:
            1 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.