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

Server aborts upon attempt to create foreign key on spatial field

    XMLWordPrintable

    Details

      Description

      --source include/have_innodb.inc
       
      --error ER_CANT_CREATE_TABLE
      CREATE TABLE t1 (a GEOMETRY, INDEX(a(8)), FOREIGN KEY (a) REFERENCES x (xx)) ENGINE=InnoDB;
      

      10.4 adcfea71

      200221  0:47:41 [ERROR] mysqld got signal 8 ;
       
      #3  <signal handler called>
      #4  0x00005584e9c224e7 in dict_index_add_to_cache (index=@0x7fb10819eee8: 0x7fb10800c080, page_no=4294967295, add_v=0x0) at /data/src/10.4/storage/innobase/dict/dict0dict.cc:1842
      #5  0x00005584e9c14bfd in dict_create_index_step (thr=0x7fb1081a0aa0) at /data/src/10.4/storage/innobase/dict/dict0crea.cc:1248
      #6  0x00005584e99fd249 in que_thr_step (thr=0x7fb1081a0aa0) at /data/src/10.4/storage/innobase/que/que0que.cc:1047
      #7  0x00005584e99fd45d in que_run_threads_low (thr=0x7fb1081a0aa0) at /data/src/10.4/storage/innobase/que/que0que.cc:1099
      #8  0x00005584e99fd6ad in que_run_threads (thr=0x7fb1081a0aa0) at /data/src/10.4/storage/innobase/que/que0que.cc:1139
      #9  0x00005584e9a69da5 in row_create_index_for_mysql (index=0x7fb10800c080, trx=0x7fb151afe268, field_lengths=0x7fb10803ffd0) at /data/src/10.4/storage/innobase/row/row0mysql.cc:2553
      #10 0x00005584e98e2996 in create_index (trx=0x7fb151afe268, form=0x7fb151061190, table=0x7fb10819cc30, key_num=1) at /data/src/10.4/storage/innobase/handler/ha_innodb.cc:11305
      #11 0x00005584e98cb2b8 in create_table_info_t::create_table (this=0x7fb151060c30, create_fk=true) at /data/src/10.4/storage/innobase/handler/ha_innodb.cc:12438
      #12 0x00005584e98e3318 in ha_innobase::create (this=0x7fb10819c448, name=0x7fb151062f70 "./test/t1", form=0x7fb151061190, create_info=0x7fb1510633b0, file_per_table=true, trx=0x7fb151afe268) at /data/src/10.4/storage/innobase/handler/ha_innodb.cc:12904
      #13 0x00005584e98cc243 in ha_innobase::create (this=0x7fb10819c448, name=0x7fb151062f70 "./test/t1", form=0x7fb151061190, create_info=0x7fb1510633b0) at /data/src/10.4/storage/innobase/handler/ha_innodb.cc:12957
      #14 0x00005584e967eeee in handler::ha_create (this=0x7fb10819c448, name=0x7fb151062f70 "./test/t1", form=0x7fb151061190, info_arg=0x7fb1510633b0) at /data/src/10.4/sql/handler.cc:4729
      #15 0x00005584e96806af in ha_create_table (thd=0x7fb108000af0, path=0x7fb151062f70 "./test/t1", db=0x7fb108013b30 "test", table_name=0x7fb108013438 "t1", create_info=0x7fb1510633b0, frm=0x7fb151062f60) at /data/src/10.4/sql/handler.cc:5193
      #16 0x00005584e93f7ad7 in create_table_impl (thd=0x7fb108000af0, orig_db=..., orig_table_name=..., db=..., table_name=..., path=0x7fb151062f70 "./test/t1", options=..., create_info=0x7fb1510633b0, alter_info=0x7fb1510632f0, create_table_mode=0, is_trans=0x7fb1510631ce, key_info=0x7fb151062f50, key_count=0x7fb151062f44, frm=0x7fb151062f60) at /data/src/10.4/sql/sql_table.cc:5065
      #17 0x00005584e93f7f1d in mysql_create_table_no_lock (thd=0x7fb108000af0, db=0x7fb108013488, table_name=0x7fb108013498, create_info=0x7fb1510633b0, alter_info=0x7fb1510632f0, is_trans=0x7fb1510631ce, create_table_mode=0, table_list=0x7fb108013470) at /data/src/10.4/sql/sql_table.cc:5152
      #18 0x00005584e93f831f in mysql_create_table (thd=0x7fb108000af0, create_table=0x7fb108013470, create_info=0x7fb1510633b0, alter_info=0x7fb1510632f0) at /data/src/10.4/sql/sql_table.cc:5241
      #19 0x00005584e940a81c in Sql_cmd_create_table_like::execute (this=0x7fb108013410, thd=0x7fb108000af0) at /data/src/10.4/sql/sql_table.cc:11450
      #20 0x00005584e931c745 in mysql_execute_command (thd=0x7fb108000af0) at /data/src/10.4/sql/sql_parse.cc:6101
      #21 0x00005584e9321e07 in mysql_parse (thd=0x7fb108000af0, rawbuf=0x7fb1080132f0 "CREATE TABLE t1 (a GEOMETRY, INDEX(a(8)), FOREIGN KEY (a) REFERENCES x (xx)) ENGINE=InnoDB", length=90, parser_state=0x7fb151064160, is_com_multi=false, is_next_command=false) at /data/src/10.4/sql/sql_parse.cc:7900
      #22 0x00005584e930cfea in dispatch_command (command=COM_QUERY, thd=0x7fb108000af0, packet=0x7fb1081371c1 "CREATE TABLE t1 (a GEOMETRY, INDEX(a(8)), FOREIGN KEY (a) REFERENCES x (xx)) ENGINE=InnoDB", packet_length=90, is_com_multi=false, is_next_command=false) at /data/src/10.4/sql/sql_parse.cc:1842
      #23 0x00005584e930b677 in do_command (thd=0x7fb108000af0) at /data/src/10.4/sql/sql_parse.cc:1360
      #24 0x00005584e94948e3 in do_handle_one_connection (connect=0x5584ed865e30) at /data/src/10.4/sql/sql_connect.cc:1412
      #25 0x00005584e9494632 in handle_one_connection (arg=0x5584ed865e30) at /data/src/10.4/sql/sql_connect.cc:1316
      #26 0x00005584e9e9b22d in pfs_spawn_thread (arg=0x5584ed7d0440) at /data/src/10.4/storage/perfschema/pfs.cc:1869
      #27 0x00007fb159c444a4 in start_thread (arg=0x7fb151065700) at pthread_create.c:456
      #28 0x00007fb157d78d0f in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:97
      

      10.4 adcfea71 ASAN

      ==21613==ERROR: AddressSanitizer: FPE on unknown address 0x5610cccc8f65 (pc 0x5610cccc8f65 bp 0x7ff421a331b0 sp 0x7ff421a33170 T27)
          #0 0x5610cccc8f64 in dict_index_add_to_cache(dict_index_t*&, unsigned long, dict_add_v_col_t const*) /data/src/10.4/storage/innobase/dict/dict0dict.cc:1842
          #1 0x5610cccb0c6b in dict_create_index_step(que_thr_t*) /data/src/10.4/storage/innobase/dict/dict0crea.cc:1248
          #2 0x5610cc93938f in que_thr_step /data/src/10.4/storage/innobase/que/que0que.cc:1047
          #3 0x5610cc939771 in que_run_threads_low /data/src/10.4/storage/innobase/que/que0que.cc:1099
          #4 0x5610cc939b17 in que_run_threads(que_thr_t*) /data/src/10.4/storage/innobase/que/que0que.cc:1139
          #5 0x5610cc9f2e99 in row_create_index_for_mysql(dict_index_t*, trx_t*, unsigned long const*) /data/src/10.4/storage/innobase/row/row0mysql.cc:2553
          #6 0x5610cc7537f9 in create_index(trx_t*, TABLE const*, dict_table_t*, unsigned int) (/data/bld/10.4-asan-nightly/bin/mysqld+0x1fa17f9)
          #7 0x5610cc723457 in create_table_info_t::create_table(bool) /data/src/10.4/storage/innobase/handler/ha_innodb.cc:12438
          #8 0x5610cc754b58 in ha_innobase::create(char const*, TABLE*, HA_CREATE_INFO*, bool, trx_t*) (/data/bld/10.4-asan-nightly/bin/mysqld+0x1fa2b58)
          #9 0x5610cc725223 in ha_innobase::create(char const*, TABLE*, HA_CREATE_INFO*) /data/src/10.4/storage/innobase/handler/ha_innodb.cc:12957
          #10 0x5610cc1e054b in handler::ha_create(char const*, TABLE*, HA_CREATE_INFO*) /data/src/10.4/sql/handler.cc:4729
          #11 0x5610cc1e467d in ha_create_table(THD*, char const*, char const*, char const*, HA_CREATE_INFO*, st_mysql_const_unsigned_lex_string*) /data/src/10.4/sql/handler.cc:5193
          #12 0x5610cbc72c54 in create_table_impl /data/src/10.4/sql/sql_table.cc:5065
          #13 0x5610cbc7346a in mysql_create_table_no_lock(THD*, st_mysql_const_lex_string const*, st_mysql_const_lex_string const*, Table_specification_st*, Alter_info*, bool*, int, TABLE_LIST*) /data/src/10.4/sql/sql_table.cc:5152
          #14 0x5610cbc73ece in mysql_create_table(THD*, TABLE_LIST*, Table_specification_st*, Alter_info*) /data/src/10.4/sql/sql_table.cc:5241
          #15 0x5610cbc9ab70 in Sql_cmd_create_table_like::execute(THD*) /data/src/10.4/sql/sql_table.cc:11450
          #16 0x5610cba6c8f7 in mysql_execute_command(THD*) /data/src/10.4/sql/sql_parse.cc:6101
          #17 0x5610cba772c1 in mysql_parse(THD*, char*, unsigned int, Parser_state*, bool, bool) /data/src/10.4/sql/sql_parse.cc:7900
          #18 0x5610cba505f4 in dispatch_command(enum_server_command, THD*, char*, unsigned int, bool, bool) /data/src/10.4/sql/sql_parse.cc:1842
          #19 0x5610cba4d4f4 in do_command(THD*) /data/src/10.4/sql/sql_parse.cc:1360
          #20 0x5610cbdd45fe in do_handle_one_connection(CONNECT*) /data/src/10.4/sql/sql_connect.cc:1412
          #21 0x5610cbdd3fb2 in handle_one_connection /data/src/10.4/sql/sql_connect.cc:1316
          #22 0x5610cd23b715 in pfs_spawn_thread /data/src/10.4/storage/perfschema/pfs.cc:1869
          #23 0x7ff4396bb4a3 in start_thread (/lib/x86_64-linux-gnu/libpthread.so.0+0x74a3)
          #24 0x7ff4377efd0e in __clone (/lib/x86_64-linux-gnu/libc.so.6+0xe8d0e)
       
      AddressSanitizer can not provide additional info.
      SUMMARY: AddressSanitizer: FPE /data/src/10.4/storage/innobase/dict/dict0dict.cc:1842 in dict_index_add_to_cache(dict_index_t*&, unsigned long, dict_add_v_col_t const*)
      Thread T27 created by T0 here:
          #0 0x7ff439901f59 in __interceptor_pthread_create (/usr/lib/x86_64-linux-gnu/libasan.so.3+0x30f59)
          #1 0x5610cd23bb02 in spawn_thread_v1 /data/src/10.4/storage/perfschema/pfs.cc:1919
          #2 0x5610cb7a66c8 in inline_mysql_thread_create /data/src/10.4/include/mysql/psi/mysql_thread.h:1275
          #3 0x5610cb7baecc in create_thread_to_handle_connection(CONNECT*) /data/src/10.4/sql/mysqld.cc:6242
          #4 0x5610cb7bb5af in create_new_thread(CONNECT*) /data/src/10.4/sql/mysqld.cc:6312
          #5 0x5610cb7bb93a in handle_accepted_socket(st_mysql_socket, st_mysql_socket) /data/src/10.4/sql/mysqld.cc:6410
          #6 0x5610cb7bc58c in handle_connections_sockets() /data/src/10.4/sql/mysqld.cc:6568
          #7 0x5610cb7ba74d in mysqld_main(int, char**) /data/src/10.4/sql/mysqld.cc:5900
          #8 0x5610cb7a45af in main /data/src/10.4/sql/main.cc:25
          #9 0x7ff4377272e0 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x202e0)
       
      ==21613==ABORTING
      

      No obvious problem on a non-debug build (the query fails as it should).

      The failure appeared in 10.4 branch with this commit:

      df07e00a810
       
      Eugene Kosov
      Tue Feb 18 22:53:29 2020 +0300 (Mon Oct 14 18:13:02 2019 +0300)
      MDEV-20726 InnoDB: Assertion failure in file data0type.cc line 67
      

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              thiru Thirunarayanan Balathandayuthapani
              Reporter:
              elenst Elena Stepanova
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: