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

Spider: SIGSEGV in spider_set_direct_limit_offset on INSERT

    XMLWordPrintable

Details

    Description

      Use test;
      INSTALL PLUGIN spider SONAME 'ha_spider.so';
      CREATE SERVER d FOREIGN DATA WRAPPER mysql OPTIONS (HOST'',DATABASE'',USER'',PORT 10000,PASSWORD'');
      SET SESSION spider_same_server_link=ON;
      CREATE TABLE t (id INT AUTO_INCREMENT,i INT,KEY(id)) ENGINE=SPIDER;
      EXPLAIN SELECT * FROM t AS nt2 WHERE 1 IN (SELECT it.a FROM t AS it JOIN t AS it3 ON it.a=it3.a);
      ALTER TABLE t CHANGE c c FLOAT UNSIGNED ZEROFILL;
      CREATE TEMPORARY TABLE tm1 (c INT) ENGINE=SPIDER UNION=(t);
      INSERT INTO t VALUES (0,0),(0,0),(0,0),(0,0),(0,0);
      

      Leads to:

      10.6.6 e0e24b180d090d7ee378c097ab02df891b61a965 (Optimized)

      Core was generated by `/test/MD031221-mariadb-10.6.6-linux-x86_64-opt/bin/mysqld --no-defaults --core-'.
      Program terminated with signal SIGSEGV, Segmentation fault.
      #0  0x000014d56c12344b in spider_set_direct_limit_offset (
          spider=spider@entry=0x14d4d80811e0)
          at /test/10.6_opt/storage/spider/spd_table.cc:9535
      9535	    if (spider->partition_handler_share->owner->
      [Current thread is 1 (Thread 0x14d580aa4700 (LWP 1207506))]
      (gdb) bt
      #0  0x000014d56c12344b in spider_set_direct_limit_offset (spider=spider@entry=0x14d4d80811e0) at /test/10.6_opt/storage/spider/spd_table.cc:9535
      #1  0x000014d56c14107f in ha_spider::check_direct_order_limit (this=0x14d4d80811e0) at /test/10.6_opt/storage/spider/ha_spider.cc:13105
      #2  ha_spider::check_direct_order_limit (this=0x14d4d80811e0) at /test/10.6_opt/storage/spider/ha_spider.cc:13089
      #3  0x000014d56c14b0cd in ha_spider::index_last_internal (buf=0x14d4d80739f8 "", this=0x14d4d80811e0) at /test/10.6_opt/storage/spider/ha_spider.cc:3350
      #4  ha_spider::index_last_internal (this=0x14d4d80811e0, buf=0x14d4d80739f8 "") at /test/10.6_opt/storage/spider/ha_spider.cc:3310
      #5  0x000014d56c154229 in ha_spider::get_auto_increment (this=0x14d4d80811e0, offset=<optimized out>, increment=1, nb_desired_values=5, first_value=0x14d580aa2980, nb_reserved_values=0x14d580aa2988) at /test/10.6_opt/storage/spider/ha_spider.cc:9812
      #6  0x000055d88b2308e8 in handler::update_auto_increment (this=this@entry=0x14d4d80811e0) at /test/10.6_opt/sql/handler.cc:3954
      #7  0x000014d56c143386 in ha_spider::update_auto_increment (this=0x14d4d80811e0) at /test/10.6_opt/storage/spider/ha_spider.cc:9755
      #8  0x000014d56c155455 in ha_spider::write_row (this=0x14d4d80811e0, buf=0x14d4d80739e8 <incomplete sequence \375>) at /test/10.6_opt/storage/spider/ha_spider.cc:10014
      #9  0x000055d88b2362a0 in handler::ha_write_row (this=0x14d4d80811e0, buf=0x14d4d80739e8 <incomplete sequence \375>) at /test/10.6_opt/sql/handler.cc:7519
      #10 0x000055d88afb7cad in write_record (thd=thd@entry=0x14d4d8000c58, table=table@entry=0x14d4d80735d8, info=info@entry=0x14d580aa2c40, sink=sink@entry=0x0) at /test/10.6_opt/sql/sql_insert.cc:2146
      #11 0x000055d88afbe4bf in mysql_insert (thd=thd@entry=0x14d4d8000c58, table_list=<optimized out>, fields=@0x14d4d8005ca8: {<base_list> = {<Sql_alloc> = {<No data fields>}, first = 0x55d88c158590 <end_of_list>, last = 0x14d4d8005ca8, elements = 0}, <No data fields>}, values_list=@0x14d4d8005cf0: {<base_list> = {<Sql_alloc> = {<No data fields>}, first = 0x14d4d80115f8, last = 0x14d4d8011b18, elements = 5}, <No data fields>}, update_fields=@0x14d4d8005cd8: {<base_list> = {<Sql_alloc> = {<No data fields>}, first = 0x55d88c158590 <end_of_list>, last = 0x14d4d8005cd8, elements = 0}, <No data fields>}, update_values=@0x14d4d8005cc0: {<base_list> = {<Sql_alloc> = {<No data fields>}, first = 0x55d88c158590 <end_of_list>, last = 0x14d4d8005cc0, elements = 0}, <No data fields>}, duplic=<optimized out>, ignore=<optimized out>, result=<optimized out>) at /test/10.6_opt/sql/sql_insert.cc:1123
      #12 0x000055d88aff8df9 in mysql_execute_command (thd=0x14d4d8000c58, is_called_from_prepared_stmt=<optimized out>) at /test/10.6_opt/sql/sql_parse.cc:4565
      #13 0x000055d88afe89a6 in mysql_parse (thd=0x14d4d8000c58, rawbuf=<optimized out>, length=<optimized out>, parser_state=<optimized out>) at /test/10.6_opt/sql/sql_parse.cc:8030
      #14 0x000055d88aff4b65 in dispatch_command (command=COM_QUERY, thd=0x14d4d8000c58, packet=<optimized out>, packet_length=<optimized out>, blocking=<optimized out>) at /test/10.6_opt/sql/sql_class.h:1358
      #15 0x000055d88aff6d57 in do_command (thd=0x14d4d8000c58, blocking=blocking@entry=true) at /test/10.6_opt/sql/sql_parse.cc:1404
      #16 0x000055d88b106957 in do_handle_one_connection (connect=<optimized out>, put_in_cache=true) at /test/10.6_opt/sql/sql_connect.cc:1418
      #17 0x000055d88b106c9d in handle_one_connection (arg=arg@entry=0x55d88e836c18) at /test/10.6_opt/sql/sql_connect.cc:1312
      #18 0x000055d88b492828 in pfs_spawn_thread (arg=0x55d88e7c75d8) at /test/10.6_opt/storage/perfschema/pfs.cc:2201
      #19 0x000014d58c1dd609 in start_thread (arg=<optimized out>) at pthread_create.c:477
      #20 0x000014d58bdcb293 in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95
      

      Bug confirmed present in:
      MariaDB: 10.5.14 (opt), 10.6.6 (opt), 10.7.2 (opt), 10.8.0 (opt)

      Bug (or feature/syntax) confirmed not present in:
      MariaDB: 10.2.42 (dbg), 10.2.42 (opt), 10.3.33 (dbg), 10.3.33 (opt), 10.4.23 (dbg), 10.4.23 (opt), 10.5.14 (dbg), 10.6.6 (dbg), 10.7.2 (dbg), 10.8.0 (dbg)
      MySQL: 5.5.62 (dbg), 5.5.62 (opt), 5.6.51 (dbg), 5.6.51 (opt), 5.7.36 (dbg), 5.7.36 (opt), 8.0.27 (dbg), 8.0.27 (opt)

      Attachments

        Issue Links

          Activity

            People

              nayuta-yanagisawa Nayuta Yanagisawa (Inactive)
              Roel Roel Van de Paar
              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.