Details

    Description

      Drop virtual column crashed the instance, if you drop the index first then it's fine to drop the column.

      Possibly related: MDEV-20015

      [db01]> ALTER TABLE Table1 DROP COLUMN IndexedVirtualColumn;
      ERROR 2013 (HY000): Lost connection to MySQL server during query
      
      

      Error Log:

      2019-10-01 12:21:43  [Note] InnoDB: Online DDL : Start reading clustered index of the table and create temporary files
      2019-10-01 12:21:44  [Warning] Aborted connection 123 to db: 'unconnected' user: 'user01' host: 'test-host' (CLOSE_CONNECTION)
      191001 12:21:44 [ERROR] mysqld got signal 11 ;
      

      mysqld[12345]: segfault at c0 ip 0000457d242f4324 sp 00003488db8eb632 error 4 in mysqld[558d23c96000+12b6000]
      

      Server version: 10.3.16-MariaDB-log
      key_buffer_size=134217728
      read_buffer_size=2097152
      max_used_connections=104
      max_threads=1002
      thread_count=103
      It is possible that mysqld could use up to
      key_buffer_size + (read_buffer_size + sort_buffer_size)*max_threads = 4257786 K bytes of memory
      Hope that's ok; if not, decrease some variables in the equation.
       
      Thread pointer: 0x7ee0a00009a8
      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 = 0x7ee1f80e4d00 thread_stack 0x49000
      *** buffer overflow detected ***: /usr/sbin/mysqld terminated
      ======= Backtrace: =========
      /lib64/libc.so.6(__fortify_fail+0x37)[0x7f03a174d9e7]
      /lib64/libc.so.6(+0x115b62)[0x7f03a174bb62]
      /lib64/libc.so.6(+0x117947)[0x7f03a174d947]
      /usr/sbin/mysqld(my_addr_resolve+0xda)[0x55923769e1aa]
      /usr/sbin/mysqld(my_print_stacktrace+0x1c2)[0x5592376877e2]
      /usr/sbin/mysqld(handle_fatal_signal+0x30f)[0x559237128dff]
      /lib64/libpthread.so.0(+0xf5d0)[0x7f03a33995d0]
      /usr/sbin/mysqld(_ZN5TABLE20update_virtual_fieldEP5Field+0x58)[0x559237005918]
      /usr/sbin/mysqld(+0x9284d0)[0x5592372ca4d0]
      /usr/sbin/mysqld(+0x9d735a)[0x55923737935a]
      /usr/sbin/mysqld(+0x9df32c)[0x55923738132c]
      /usr/sbin/mysqld(+0x9dfdcf)[0x559237381dcf]
      /usr/sbin/mysqld(+0x937be6)[0x5592372d9be6]
      /usr/sbin/mysqld(+0x4bf61f)[0x559236e6161f]
      /usr/sbin/mysqld(_Z17mysql_alter_tableP3THDPK25st_mysql_const_lex_stringS3_P14HA_CREATE_INFOP10TABLE_LISTP10Alter_infojP8st_orderb+0x2b34)[0x559236fdebc4]
      /usr/sbin/mysqld(_ZN19Sql_cmd_alter_table7executeEP3THD+0x41b)[0x55923702f0cb]
      /usr/sbin/mysqld(_Z21mysql_execute_commandP3THD+0x3bf0)[0x559236f509a0]
      /usr/sbin/mysqld(_Z11mysql_parseP3THDPcjP12Parser_statebb+0x22b)[0x559236f5588b]
      /usr/sbin/mysqld(_Z16dispatch_command19enum_server_commandP3THDPcjbb+0x1d3e)[0x559236f5858e]
      

      Attachments

        Issue Links

          Activity

            alice Alice Sherepa added a comment -

            Thanks Juan!
            Reproducible on 10.2-10.4, on debug and non-debug versions.

            --source include/have_sequence.inc
            --source include/have_innodb.inc
             
            CREATE TABLE t1 (
            id int NOT NULL PRIMARY KEY,
            a varchar(40),
            b varchar(100),
            c int,
            va char(40)  GENERATED ALWAYS AS (ucase(a)) VIRTUAL,
            vb char(100) GENERATED ALWAYS AS (ucase(b)) VIRTUAL,
            KEY (c,va,vb)
            ) engine=innodb;
             
            insert into t1 (id,a,c) select seq,seq,seq from seq_1_to_10000;
             
            alter table t1 drop column va;
             
            #cleanup
            drop table t1;
            

            10.2 361e8284f3b8fadc8d9

            #3  <signal handler called>
            #4  0x000055bda24e8e44 in TABLE::update_virtual_field (this=0x7ff7a4049340, vf=0x0) at /10.2/sql/table.cc:7714
            #5  0x000055bda29b84ea in innobase_get_computed_value (row=0x7ff7a40e1310, col=0x7ff7a400c1e0, index=0x7ff7a4185338, local_heap=0x7ff7f4412778, heap=0x0, ifield=0x7ff7a40575c8, thd=0x7ff7a4000b00, mysql_table=0x7ff7a4049340, mysql_rec=0x7ff7a4057c68 "\237", '\217' <repeats 45 times>, old_table=0x7ff7a40311e8, parent_update=0x0, foreign=0x0) at /10.2/storage/innobase/handler/ha_innodb.cc:21913
            #6  0x000055bda2ac5582 in row_merge_buf_add (buf=0x7ff7a4054a78, fts_index=0x0, old_table=0x7ff7a40311e8, new_table=0x7ff7a40311e8, psort_info=0x0, row=0x7ff7a40e1310, ext=0x0, doc_id=0x7ff7f4412780, conv_heap=0x0, err=0x7ff7f441275c, v_heap=0x7ff7f4412778, my_table=0x7ff7a4049340, trx=0x7ff7f5f18140) at /10.2/storage/innobase/row/row0merge.cc:605
            #7  0x000055bda2acb52d in row_merge_read_clustered_index (trx=0x7ff7f5f18140, table=0x7ff7a4049340, old_table=0x7ff7a40311e8, new_table=0x7ff7a40311e8, online=true, index=0x7ff7a40545a0, fts_sort_idx=0x0, psort_info=0x0, files=0x7ff7a411f030, key_numbers=0x7ff7a40545a8, n_index=1, add_cols=0x0, add_v=0x0, col_map=0x0, add_autoinc=18446744073709551615, sequence=..., block=0x7ff7f40ce000 "\002\002\200", skip_pk_sort=false, tmpfd=0x7ff7f4413288, stage=0x7ff7a412d090, pct_cost=50, crypt_block=0x0, eval_table=0x7ff7a4187d60) at /10.2/storage/innobase/row/row0merge.cc:2566
            #8  0x000055bda2ad0fb7 in row_merge_build_indexes (trx=0x7ff7f5f18140, old_table=0x7ff7a40311e8, new_table=0x7ff7a40311e8, online=true, indexes=0x7ff7a40545a0, key_numbers=0x7ff7a40545a8, n_indexes=1, table=0x7ff7a4049340, add_cols=0x0, col_map=0x0, add_autoinc=18446744073709551615, sequence=..., skip_pk_sort=false, stage=0x7ff7a412d090, add_v=0x0, eval_table=0x7ff7a4187d60) at /10.2/storage/innobase/row/row0merge.cc:4684
            #9  0x000055bda29d9585 in ha_innobase::inplace_alter_table (this=0x7ff7a4183448, altered_table=0x7ff7a4049340, ha_alter_info=0x7ff7f4413ac0) at /10.2/storage/innobase/handler/handler0alter.cc:6253
            #10 0x000055bda24b24bd in handler::ha_inplace_alter_table (this=0x7ff7a4183448, altered_table=0x7ff7a4049340, ha_alter_info=0x7ff7f4413ac0) at /10.2/sql/handler.h:3796
            #11 0x000055bda24a7d9b in mysql_inplace_alter_table (thd=0x7ff7a4000b00, table_list=0x7ff7a4012550, table=0x7ff7a4187d60, altered_table=0x7ff7a4049340, ha_alter_info=0x7ff7f4413ac0, inplace_supported=HA_ALTER_INPLACE_NO_LOCK_AFTER_PREPARE, target_mdl_request=0x7ff7f4413b50, alter_ctx=0x7ff7f4414100) at /10.2/sql/sql_table.cc:7401
            #12 0x000055bda24ad93a in mysql_alter_table (thd=0x7ff7a4000b00, new_db=0x7ff7a4012b68 "test", new_name=0x0, create_info=0x7ff7f4414d10, table_list=0x7ff7a4012550, alter_info=0x7ff7f4414c60, order_num=0, order=0x0, ignore=false) at /10.2/sql/sql_table.cc:9532
            #13 0x000055bda252a62f in Sql_cmd_alter_table::execute (this=0x7ff7a4012b98, thd=0x7ff7a4000b00) at /10.2/sql/sql_alter.cc:339
            #14 0x000055bda23dcfe9 in mysql_execute_command (thd=0x7ff7a4000b00) at /10.2/sql/sql_parse.cc:5972
            #15 0x000055bda23e20b5 in mysql_parse (thd=0x7ff7a4000b00, rawbuf=0x7ff7a4012468 "alter table t1 drop column va", length=29, parser_state=0x7ff7f4416080, is_com_multi=false, is_next_command=false) at /10.2/sql/sql_parse.cc:7759
            #16 0x000055bda23d0378 in dispatch_command (command=COM_QUERY, thd=0x7ff7a4000b00, packet=0x7ff7a4096131 "alter table t1 drop column va", packet_length=29, is_com_multi=false, is_next_command=false) at /10.2/sql/sql_parse.cc:1831
            #17 0x000055bda23cec8c in do_command (thd=0x7ff7a4000b00) at /10.2/sql/sql_parse.cc:1385
            #18 0x000055bda25251fb in do_handle_one_connection (connect=0x55bda5204560) at /10.2/sql/sql_connect.cc:1336
            #19 0x000055bda2524f66 in handle_one_connection (arg=0x55bda5204560) at /10.2/sql/sql_connect.cc:1241
            #20 0x000055bda2d532c4 in pfs_spawn_thread (arg=0x55bda520f350) at /10.2/storage/perfschema/pfs.cc:1862
            #21 0x00007ff7fd9e06ba in start_thread (arg=0x7ff7f4417700) at pthread_create.c:333
            #22 0x00007ff7fce7541d in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:109
            

            alice Alice Sherepa added a comment - Thanks Juan! Reproducible on 10.2-10.4, on debug and non-debug versions. --source include/have_sequence.inc --source include/have_innodb.inc   CREATE TABLE t1 ( id int NOT NULL PRIMARY KEY , a varchar (40), b varchar (100), c int , va char (40) GENERATED ALWAYS AS (ucase(a)) VIRTUAL, vb char (100) GENERATED ALWAYS AS (ucase(b)) VIRTUAL, KEY (c,va,vb) ) engine=innodb;   insert into t1 (id,a,c) select seq,seq,seq from seq_1_to_10000;   alter table t1 drop column va;   #cleanup drop table t1; 10.2 361e8284f3b8fadc8d9 #3 <signal handler called> #4 0x000055bda24e8e44 in TABLE::update_virtual_field (this=0x7ff7a4049340, vf=0x0) at /10.2/sql/table.cc:7714 #5 0x000055bda29b84ea in innobase_get_computed_value (row=0x7ff7a40e1310, col=0x7ff7a400c1e0, index=0x7ff7a4185338, local_heap=0x7ff7f4412778, heap=0x0, ifield=0x7ff7a40575c8, thd=0x7ff7a4000b00, mysql_table=0x7ff7a4049340, mysql_rec=0x7ff7a4057c68 "\237", '\217' <repeats 45 times>, old_table=0x7ff7a40311e8, parent_update=0x0, foreign=0x0) at /10.2/storage/innobase/handler/ha_innodb.cc:21913 #6 0x000055bda2ac5582 in row_merge_buf_add (buf=0x7ff7a4054a78, fts_index=0x0, old_table=0x7ff7a40311e8, new_table=0x7ff7a40311e8, psort_info=0x0, row=0x7ff7a40e1310, ext=0x0, doc_id=0x7ff7f4412780, conv_heap=0x0, err=0x7ff7f441275c, v_heap=0x7ff7f4412778, my_table=0x7ff7a4049340, trx=0x7ff7f5f18140) at /10.2/storage/innobase/row/row0merge.cc:605 #7 0x000055bda2acb52d in row_merge_read_clustered_index (trx=0x7ff7f5f18140, table=0x7ff7a4049340, old_table=0x7ff7a40311e8, new_table=0x7ff7a40311e8, online=true, index=0x7ff7a40545a0, fts_sort_idx=0x0, psort_info=0x0, files=0x7ff7a411f030, key_numbers=0x7ff7a40545a8, n_index=1, add_cols=0x0, add_v=0x0, col_map=0x0, add_autoinc=18446744073709551615, sequence=..., block=0x7ff7f40ce000 "\002\002\200", skip_pk_sort=false, tmpfd=0x7ff7f4413288, stage=0x7ff7a412d090, pct_cost=50, crypt_block=0x0, eval_table=0x7ff7a4187d60) at /10.2/storage/innobase/row/row0merge.cc:2566 #8 0x000055bda2ad0fb7 in row_merge_build_indexes (trx=0x7ff7f5f18140, old_table=0x7ff7a40311e8, new_table=0x7ff7a40311e8, online=true, indexes=0x7ff7a40545a0, key_numbers=0x7ff7a40545a8, n_indexes=1, table=0x7ff7a4049340, add_cols=0x0, col_map=0x0, add_autoinc=18446744073709551615, sequence=..., skip_pk_sort=false, stage=0x7ff7a412d090, add_v=0x0, eval_table=0x7ff7a4187d60) at /10.2/storage/innobase/row/row0merge.cc:4684 #9 0x000055bda29d9585 in ha_innobase::inplace_alter_table (this=0x7ff7a4183448, altered_table=0x7ff7a4049340, ha_alter_info=0x7ff7f4413ac0) at /10.2/storage/innobase/handler/handler0alter.cc:6253 #10 0x000055bda24b24bd in handler::ha_inplace_alter_table (this=0x7ff7a4183448, altered_table=0x7ff7a4049340, ha_alter_info=0x7ff7f4413ac0) at /10.2/sql/handler.h:3796 #11 0x000055bda24a7d9b in mysql_inplace_alter_table (thd=0x7ff7a4000b00, table_list=0x7ff7a4012550, table=0x7ff7a4187d60, altered_table=0x7ff7a4049340, ha_alter_info=0x7ff7f4413ac0, inplace_supported=HA_ALTER_INPLACE_NO_LOCK_AFTER_PREPARE, target_mdl_request=0x7ff7f4413b50, alter_ctx=0x7ff7f4414100) at /10.2/sql/sql_table.cc:7401 #12 0x000055bda24ad93a in mysql_alter_table (thd=0x7ff7a4000b00, new_db=0x7ff7a4012b68 "test", new_name=0x0, create_info=0x7ff7f4414d10, table_list=0x7ff7a4012550, alter_info=0x7ff7f4414c60, order_num=0, order=0x0, ignore=false) at /10.2/sql/sql_table.cc:9532 #13 0x000055bda252a62f in Sql_cmd_alter_table::execute (this=0x7ff7a4012b98, thd=0x7ff7a4000b00) at /10.2/sql/sql_alter.cc:339 #14 0x000055bda23dcfe9 in mysql_execute_command (thd=0x7ff7a4000b00) at /10.2/sql/sql_parse.cc:5972 #15 0x000055bda23e20b5 in mysql_parse (thd=0x7ff7a4000b00, rawbuf=0x7ff7a4012468 "alter table t1 drop column va", length=29, parser_state=0x7ff7f4416080, is_com_multi=false, is_next_command=false) at /10.2/sql/sql_parse.cc:7759 #16 0x000055bda23d0378 in dispatch_command (command=COM_QUERY, thd=0x7ff7a4000b00, packet=0x7ff7a4096131 "alter table t1 drop column va", packet_length=29, is_com_multi=false, is_next_command=false) at /10.2/sql/sql_parse.cc:1831 #17 0x000055bda23cec8c in do_command (thd=0x7ff7a4000b00) at /10.2/sql/sql_parse.cc:1385 #18 0x000055bda25251fb in do_handle_one_connection (connect=0x55bda5204560) at /10.2/sql/sql_connect.cc:1336 #19 0x000055bda2524f66 in handle_one_connection (arg=0x55bda5204560) at /10.2/sql/sql_connect.cc:1241 #20 0x000055bda2d532c4 in pfs_spawn_thread (arg=0x55bda520f350) at /10.2/storage/perfschema/pfs.cc:1862 #21 0x00007ff7fd9e06ba in start_thread (arg=0x7ff7f4417700) at pthread_create.c:333 #22 0x00007ff7fce7541d in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:109

            People

              serg Sergei Golubchik
              claudio.nanni Claudio Nanni
              Votes:
              0 Vote for this issue
              Watchers:
              7 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.