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

Assertion `inited == NONE || table->open_by_handler' failed in handler::ha_external_lock on UPDATE (Spider)

    XMLWordPrintable

    Details

      Description

      INSTALL PLUGIN Spider SONAME 'ha_spider.so';
      CREATE USER Spider@localhost IDENTIFIED BY 'PWD1';
      CREATE SERVER srv FOREIGN DATA WRAPPER MYSQL OPTIONS (SOCKET '../socket.sock',DATABASE 'test',user 'Spider',PASSWORD 'PWD1');
      CREATE TABLE t (c INT);
      CREATE TABLE t1 (c1 INT,c2 INT,c3 INT,c4 INT,PRIMARY KEY(c1,c2)) ENGINE=Spider COMMENT='WRAPPER "mysql",srv "srv",TABLE "t"' COMMENT='WRAPPER "mysql",srv "srv",TABLE "t"' PARTITION BY LIST COLUMNs (c2) (PARTITION p VALUES IN (1,2) ENGINE=Spider COMMENT='WRAPPER "mysql",srv "srv",TABLE "t"' COMMENT='WRAPPER "mysql",srv "srv",TABLE "t"',PARTITION p2 VALUES IN (3,4) ENGINE=Spider COMMENT='WRAPPER "mysql",srv "srv",TABLE "t"' COMMENT='WRAPPER "mysql",srv "srv",TABLE "t"');
      UPDATE t1 SET c1=0;
      

      Leads to:

      10.11.0 bc563f1a4b0b38de3b41fd0f0d3d8b7f1aacbd8b (Debug)

      mysqld: /test/10.11_dbg/sql/handler.cc:7065: int handler::ha_external_lock(THD*, int): Assertion `inited == NONE || table->open_by_handler' failed.
      

      10.11.0 bc563f1a4b0b38de3b41fd0f0d3d8b7f1aacbd8b (Debug)

      Core was generated by `/test/MD190822-mariadb-10.11.0-linux-x86_64-dbg/bin/mysqld --no-defaults --core'.
      Program terminated with signal SIGABRT, Aborted.
      #0  __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50
      [Current thread is 1 (Thread 0x150378a00700 (LWP 3070012))]
      (gdb) bt
      #0  __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50
      #1  0x000015039f7b5859 in __GI_abort () at abort.c:79
      #2  0x000015039f7b5729 in __assert_fail_base (fmt=0x15039f94b588 "%s%s%s:%u: %s%sAssertion `%s' failed.\n%n", assertion=0x55e0be82e7c8 "inited == NONE || table->open_by_handler", file=0x55e0be82c5d0 "/test/10.11_dbg/sql/handler.cc", line=7065, function=<optimized out>) at assert.c:92
      #3  0x000015039f7c6fd6 in __GI___assert_fail (assertion=assertion@entry=0x55e0be82e7c8 "inited == NONE || table->open_by_handler", file=file@entry=0x55e0be82c5d0 "/test/10.11_dbg/sql/handler.cc", line=line@entry=7065, function=function@entry=0x55e0be82e730 "int handler::ha_external_lock(THD*, int)") at assert.c:101
      #4  0x000055e0bdda1e06 in handler::ha_external_lock (this=0x1502ec065b20, thd=thd@entry=0x1502ec000db8, lock_type=lock_type@entry=2) at /test/10.11_dbg/sql/handler.cc:7065
      #5  0x000055e0be0450a0 in ha_partition::external_lock (this=0x1502ec064690, thd=0x1502ec000db8, lock_type=2) at /test/10.11_dbg/sql/ha_partition.cc:4170
      #6  0x000055e0bdda1e18 in handler::ha_external_lock (this=0x1502ec064690, thd=thd@entry=0x1502ec000db8, lock_type=lock_type@entry=2) at /test/10.11_dbg/sql/handler.cc:7092
      #7  0x000055e0bdf06af2 in handler::ha_external_unlock (thd=0x1502ec000db8, this=<optimized out>) at /test/10.11_dbg/sql/handler.h:3498
      #8  unlock_external (thd=thd@entry=0x1502ec000db8, table=0x1502ec014910, count=<optimized out>) at /test/10.11_dbg/sql/lock.cc:741
      #9  0x000055e0bdf06cf8 in mysql_unlock_tables (thd=0x1502ec000db8, sql_lock=0x1502ec0148d0, free_lock=<optimized out>) at /test/10.11_dbg/sql/lock.cc:432
      #10 0x000055e0bdf0737e in mysql_unlock_tables (thd=thd@entry=0x1502ec000db8, sql_lock=<optimized out>) at /test/10.11_dbg/sql/lock.cc:415
      #11 0x000055e0bda1c6ab in close_thread_tables (thd=thd@entry=0x1502ec000db8) at /test/10.11_dbg/sql/sql_base.cc:953
      #12 0x000055e0bda1c8cc in close_thread_tables_for_query (thd=thd@entry=0x1502ec000db8) at /test/10.11_dbg/sql/sql_base.cc:790
      #13 0x000055e0bdab4b77 in mysql_execute_command (thd=thd@entry=0x1502ec000db8, is_called_from_prepared_stmt=is_called_from_prepared_stmt@entry=false) at /test/10.11_dbg/sql/sql_parse.cc:6063
      #14 0x000055e0bda9c882 in mysql_parse (thd=thd@entry=0x1502ec000db8, rawbuf=<optimized out>, length=<optimized out>, parser_state=parser_state@entry=0x1503789ff330) at /test/10.11_dbg/sql/sql_parse.cc:8035
      #15 0x000055e0bdaa9e6a in dispatch_command (command=command@entry=COM_QUERY, thd=thd@entry=0x1502ec000db8, packet=packet@entry=0x1502ec00b6e9 "UPDATE t1 SET c1=0", packet_length=packet_length@entry=18, blocking=blocking@entry=true) at /test/10.11_dbg/sql/sql_class.h:1339
      #16 0x000055e0bdaac574 in do_command (thd=0x1502ec000db8, blocking=blocking@entry=true) at /test/10.11_dbg/sql/sql_parse.cc:1407
      #17 0x000055e0bdc0e1da in do_handle_one_connection (connect=<optimized out>, connect@entry=0x55e0c1408758, put_in_cache=put_in_cache@entry=true) at /test/10.11_dbg/sql/sql_connect.cc:1418
      #18 0x000055e0bdc0e6e3 in handle_one_connection (arg=0x55e0c1408758) at /test/10.11_dbg/sql/sql_connect.cc:1312
      #19 0x000015039fcc6609 in start_thread (arg=<optimized out>) at pthread_create.c:477
      #20 0x000015039f8b2133 in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95
      

      10.4.27 3101751f505f39d2ccecd03a916ecdbf2f380740 (Debug)

      mysqld: /test/10.4_dbg/sql/handler.cc:6516: int handler::ha_external_lock(THD*, int): Assertion `inited == NONE || table->open_by_handler' failed.
      

      10.4.27 3101751f505f39d2ccecd03a916ecdbf2f380740 (Debug)

      Core was generated by `/test/MD200822-mariadb-10.4.27-linux-x86_64-dbg/bin/mysqld --no-defaults --core'.
      Program terminated with signal SIGABRT, Aborted.
      #0  __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50
      [Current thread is 1 (Thread 0x1534640ba700 (LWP 3073675))]
      (gdb) bt
      #0  __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50
      #1  0x000015347cbf6859 in __GI_abort () at abort.c:79
      #2  0x000015347cbf6729 in __assert_fail_base (fmt=0x15347cd8c588 "%s%s%s:%u: %s%sAssertion `%s' failed.\n%n", assertion=0x55c195d198c8 "inited == NONE || table->open_by_handler", file=0x55c195d16f03 "/test/10.4_dbg/sql/handler.cc", line=6516, function=<optimized out>) at assert.c:92
      #3  0x000015347cc07fd6 in __GI___assert_fail (assertion=assertion@entry=0x55c195d198c8 "inited == NONE || table->open_by_handler", file=file@entry=0x55c195d16f03 "/test/10.4_dbg/sql/handler.cc", line=line@entry=6516, function=function@entry=0x55c195d19830 "int handler::ha_external_lock(THD*, int)") at assert.c:101
      #4  0x000055c1952296ea in handler::ha_external_lock (this=0x153408094f58, thd=thd@entry=0x153408000d90, lock_type=lock_type@entry=2) at /test/10.4_dbg/sql/handler.cc:6516
      #5  0x000055c1954f73cf in ha_partition::external_lock (this=0x153408061b38, thd=0x153408000d90, lock_type=2) at /test/10.4_dbg/sql/ha_partition.cc:4000
      #6  0x000055c1952296fc in handler::ha_external_lock (this=0x153408061b38, thd=thd@entry=0x153408000d90, lock_type=lock_type@entry=2) at /test/10.4_dbg/sql/handler.cc:6543
      #7  0x000055c19537ae38 in unlock_external (thd=thd@entry=0x153408000d90, table=0x153408013d30, count=<optimized out>) at /test/10.4_dbg/sql/lock.cc:710
      #8  0x000055c19537b025 in mysql_unlock_tables (thd=0x153408000d90, sql_lock=0x153408013cf0, free_lock=<optimized out>) at /test/10.4_dbg/sql/lock.cc:431
      #9  0x000055c19537b666 in mysql_unlock_tables (thd=thd@entry=0x153408000d90, sql_lock=<optimized out>) at /test/10.4_dbg/sql/lock.cc:415
      #10 0x000055c194f1abf9 in close_thread_tables (thd=thd@entry=0x153408000d90) at /test/10.4_dbg/sql/sql_base.cc:1022
      #11 0x000055c194f9f850 in mysql_execute_command (thd=thd@entry=0x153408000d90) at /test/10.4_dbg/sql/sql_parse.cc:6258
      #12 0x000055c194fa0f3d in mysql_parse (thd=thd@entry=0x153408000d90, rawbuf=<optimized out>, length=<optimized out>, parser_state=parser_state@entry=0x1534640b93f0, is_com_multi=is_com_multi@entry=false, is_next_command=is_next_command@entry=false) at /test/10.4_dbg/sql/sql_parse.cc:7996
      #13 0x000055c194fa3a63 in dispatch_command (command=command@entry=COM_QUERY, thd=thd@entry=0x153408000d90, packet=packet@entry=0x15340801a1d1 "UPDATE t1 SET c1=0", packet_length=packet_length@entry=18, is_com_multi=is_com_multi@entry=false, is_next_command=is_next_command@entry=false) at /test/10.4_dbg/sql/sql_class.h:1201
      #14 0x000055c194fa6524 in do_command (thd=0x153408000d90) at /test/10.4_dbg/sql/sql_parse.cc:1378
      #15 0x000055c1950c786b in do_handle_one_connection (connect=<optimized out>) at /test/10.4_dbg/sql/sql_connect.cc:1420
      #16 0x000055c1950c792b in handle_one_connection (arg=<optimized out>) at /test/10.4_dbg/sql/sql_connect.cc:1316
      #17 0x000015347d107609 in start_thread (arg=<optimized out>) at pthread_create.c:477
      #18 0x000015347ccf3133 in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95
      

      Bug confirmed present in:
      MariaDB: 10.4.27 (dbg), 10.5.18 (dbg), 10.6.10 (dbg), 10.7.6 (dbg), 10.8.5 (dbg), 10.9.2 (dbg), 10.10.2 (dbg), 10.11.0 (dbg)

      Bug (or feature/syntax) confirmed not present in:
      MariaDB: 10.4.27 (opt), 10.5.18 (opt), 10.6.10 (opt), 10.7.6 (opt), 10.8.5 (opt), 10.9.2 (opt), 10.10.2 (opt), 10.11.0 (opt)
      MySQL: 5.5.62 (dbg), 5.5.62 (opt), 5.6.51 (dbg), 5.6.51 (opt), 5.7.38 (dbg), 5.7.38 (opt), 8.0.29 (dbg), 8.0.29 (opt)

      Note that 10.4 has a somewhat different stack then 10.5+

        Attachments

          Activity

            People

            Assignee:
            nayuta-yanagisawa Nayuta Yanagisawa
            Reporter:
            Roel Roel Van de Paar
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Dates

              Created:
              Updated:

                Git Integration

                Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.