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

Spider: Assertion `inited==RND' failed in handler::ha_rnd_end on DELETE

Details

    Description

      INSTALL PLUGIN spider SONAME 'ha_spider.so';
      CREATE TABLE t (c INT) PARTITION BY LIST COLUMNS (c) (PARTITION p DEFAULT ENGINE=SPIDER);
      INSERT INTO t VALUES (1);
      DELETE FROM t;
      

      Leads to:

      10.7.0 1bc82aaf0a7746c0921a94034aff2d51f0d75cd0 (Debug)

      mysqld: /test/10.7_dbg/sql/handler.h:3542: int handler::ha_rnd_end(): Assertion `inited==RND' failed.
      

      10.7.0 1bc82aaf0a7746c0921a94034aff2d51f0d75cd0 (Debug)

      Core was generated by `/test/MD040921-mariadb-10.7.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 0x14d350062700 (LWP 3952612))]
      (gdb) bt
      #0  __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50
      #1  0x000014d35281f859 in __GI_abort () at abort.c:79
      #2  0x000014d35281f729 in __assert_fail_base (fmt=0x14d3529b5588 "%s%s%s:%u: %s%sAssertion `%s' failed.\n%n", assertion=0x55fd4f99a8be "inited==RND", file=0x55fd4f765b05 "/test/10.7_dbg/sql/handler.h", line=3542, function=<optimized out>) at assert.c:92
      #3  0x000014d352830f36 in __GI___assert_fail (assertion=assertion@entry=0x55fd4f99a8be "inited==RND", file=file@entry=0x55fd4f765b05 "/test/10.7_dbg/sql/handler.h", line=line@entry=3542, function=function@entry=0x55fd4f765b2d "int handler::ha_rnd_end()") at assert.c:101
      #4  0x000055fd4f0bfeda in handler::ha_rnd_end (this=0x14d30c07c5a0) at /test/10.7_dbg/sql/handler.h:3542
      #5  ha_partition::direct_delete_rows (this=0x14d30c02fe70, delete_rows_result=<optimized out>) at /test/10.7_dbg/sql/ha_partition.cc:11933
      #6  0x000055fd4ee0be2b in handler::ha_direct_delete_rows (this=0x14d30c02fe70, delete_rows=delete_rows@entry=0x14d350060578) at /test/10.7_dbg/sql/handler.cc:7729
      #7  0x000055fd4ea9ef82 in mysql_delete (thd=thd@entry=0x14d30c000db8, table_list=0x14d30c013d40, conds=<optimized out>, order_list=order_list@entry=0x14d30c005c00, limit=18446744073709551615, options=<optimized out>, result=<optimized out>) at /test/10.7_dbg/sql/sql_delete.cc:646
      #8  0x000055fd4eb01c13 in mysql_execute_command (thd=thd@entry=0x14d30c000db8, is_called_from_prepared_stmt=is_called_from_prepared_stmt@entry=false) at /test/10.7_dbg/sql/sql_limit.h:83
      #9  0x000055fd4eaebccb in mysql_parse (thd=thd@entry=0x14d30c000db8, rawbuf=<optimized out>, length=<optimized out>, parser_state=parser_state@entry=0x14d350061400) at /test/10.7_dbg/sql/sql_parse.cc:8036
      #10 0x000055fd4eafa8d0 in dispatch_command (command=command@entry=COM_QUERY, thd=thd@entry=0x14d30c000db8, packet=packet@entry=0x14d30c00b739 "DELETE FROM t", packet_length=packet_length@entry=13, blocking=blocking@entry=true) at /test/10.7_dbg/sql/sql_class.h:1358
      #11 0x000055fd4eafdcd6 in do_command (thd=0x14d30c000db8, blocking=blocking@entry=true) at /test/10.7_dbg/sql/sql_parse.cc:1404
      #12 0x000055fd4ec740c8 in do_handle_one_connection (connect=<optimized out>, connect@entry=0x55fd5160a3e8, put_in_cache=put_in_cache@entry=true) at /test/10.7_dbg/sql/sql_connect.cc:1418
      #13 0x000055fd4ec746cd in handle_one_connection (arg=arg@entry=0x55fd5160a3e8) at /test/10.7_dbg/sql/sql_connect.cc:1312
      #14 0x000055fd4f0ddade in pfs_spawn_thread (arg=0x55fd515092b8) at /test/10.7_dbg/storage/perfschema/pfs.cc:2201
      #15 0x000014d352d2e609 in start_thread (arg=<optimized out>) at pthread_create.c:477
      #16 0x000014d35291c293 in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95
      

      Bug confirmed present in:
      MariaDB: 10.4.22 (dbg), 10.5.13 (dbg), 10.6.5 (dbg), 10.7.0 (dbg)

      Bug (or feature/syntax) confirmed not present in:
      MariaDB: 10.2.41 (dbg), 10.2.41 (opt), 10.3.32 (dbg), 10.3.32 (opt), 10.4.22 (opt), 10.5.13 (opt), 10.6.5 (opt), 10.7.0 (opt)
      MySQL: 5.5.62 (dbg), 5.5.62 (opt), 5.6.51 (dbg), 5.6.51 (opt), 5.7.35 (dbg), 5.7.35 (opt), 8.0.26 (dbg), 8.0.26 (opt)

      Attachments

        Issue Links

          Activity

            ycp Yuchen Pei added a comment - - edited

            The similar-looking test case from ramesh in MDEV-27902 causes
            the same assertion failure at the DELETE statement despite the
            fix below, so I "move" the case here.

            2374b33bf2f bb-10.5-mdev-27902 MDEV-27902 Spider check trx and get conn in rnd_next()

            Further, it does not cause a problem in the 11.0 version of the same
            fix, which agrees with roel's comment above:

            458c0b80fbd upstream/bb-11.0-mdev-27902 MDEV-27902 Spider check trx and get conn in rnd_next()

            # Note: add appropriate preamble and postamble before testing.
            CREATE TABLE t (c INT,c2 INT)  engine=Spider PARTITION BY HASH (c) PARTITIONS 4  ;
            --error ER_CONNECT_TO_FOREIGN_DATA_SOURCE
            UPDATE t SET a=((1));
            LOCK TABLES t WRITE CONCURRENT;
            --error 13
            LOAD DATA INFILE 'unkownfile.txt' IGNORE INTO TABLE t IGNORE 4 LINES;
            --error ER_CONNECT_TO_FOREIGN_DATA_SOURCE
            DELETE FROM t;
            UNLOCK TABLES;

            ycp Yuchen Pei added a comment - - edited The similar-looking test case from ramesh in MDEV-27902 causes the same assertion failure at the DELETE statement despite the fix below, so I "move" the case here. 2374b33bf2f bb-10.5-mdev-27902 MDEV-27902 Spider check trx and get conn in rnd_next() Further, it does not cause a problem in the 11.0 version of the same fix, which agrees with roel 's comment above: 458c0b80fbd upstream/bb-11.0-mdev-27902 MDEV-27902 Spider check trx and get conn in rnd_next() # Note: add appropriate preamble and postamble before testing. CREATE TABLE t (c INT ,c2 INT ) engine=Spider PARTITION BY HASH (c) PARTITIONS 4 ; --error ER_CONNECT_TO_FOREIGN_DATA_SOURCE UPDATE t SET a=((1)); LOCK TABLES t WRITE CONCURRENT; --error 13 LOAD DATA INFILE 'unkownfile.txt' IGNORE INTO TABLE t IGNORE 4 LINES; --error ER_CONNECT_TO_FOREIGN_DATA_SOURCE DELETE FROM t; UNLOCK TABLES;
            ycp Yuchen Pei added a comment -

            The MDEV-27902 case with the same issue (in 10.4-10.11) seems to be
            fixed (at least in 10.11 3e90efe4c98f00e96e081bd1c571ea1e25b06258) if
            we apply the following diff which is like the following patch which is
            in 11.0+:

            modified   sql/sql_delete.cc
            @@ -534,7 +534,9 @@ bool mysql_delete(THD *thd, TABLE_LIST *table_list, COND *conds,
               select=make_select(table, 0, 0, conds, (SORT_INFO*) 0, 0, &error);
               if (unlikely(error))
                 DBUG_RETURN(TRUE);
            -  if ((select && select->check_quick(thd, safe_update, limit)) || !limit)
            +  if (unlikely((select && select->check_quick(thd, safe_update, limit)) ||
            +               table->stat_records() == 0 ||
            +               !limit))
               {
                 query_plan.set_impossible_where();
                 if (thd->lex->describe || thd->lex->analyze_stmt)

            9a4110aa5799d63faced5f986fab9035785a9310
            MDEV-30256 Wrong result (missing rows) upon join with empty table
             
            The problem was an assignment in test_quick_select() that flagged empty
            tables with "Impossible where". This test was however wrong as it
            didn't work correctly for left join.
             
            Removed the test, but added checking of empty tables in DELETE and UPDATE
            to get similar EXPLAIN as before.
             
            The new tests is a bit more strict (better) than before as it catches all
            cases of empty tables in single table DELETE/UPDATE.

            ycp Yuchen Pei added a comment - The MDEV-27902 case with the same issue (in 10.4-10.11) seems to be fixed (at least in 10.11 3e90efe4c98f00e96e081bd1c571ea1e25b06258) if we apply the following diff which is like the following patch which is in 11.0+: modified sql/sql_delete.cc @@ -534,7 +534,9 @@ bool mysql_delete(THD *thd, TABLE_LIST *table_list, COND *conds, select=make_select(table, 0, 0, conds, (SORT_INFO*) 0, 0, &error); if (unlikely(error)) DBUG_RETURN(TRUE); - if ((select && select->check_quick(thd, safe_update, limit)) || !limit) + if (unlikely((select && select->check_quick(thd, safe_update, limit)) || + table->stat_records() == 0 || + !limit)) { query_plan.set_impossible_where(); if (thd->lex->describe || thd->lex->analyze_stmt) 9a4110aa5799d63faced5f986fab9035785a9310 MDEV-30256 Wrong result (missing rows) upon join with empty table   The problem was an assignment in test_quick_select() that flagged empty tables with "Impossible where". This test was however wrong as it didn't work correctly for left join.   Removed the test, but added checking of empty tables in DELETE and UPDATE to get similar EXPLAIN as before.   The new tests is a bit more strict (better) than before as it catches all cases of empty tables in single table DELETE/UPDATE.

            A slightly different stack with this testcase:

            SET sql_mode='';
            INSTALL PLUGIN Spider SONAME 'ha_spider.so';
            GRANT ALL ON * TO Spider@localhost;
            CREATE SERVER srv FOREIGN DATA WRAPPER MYSQL OPTIONS (SOCKET '../socket.sock',DATABASE'',USER 'Spider',PASSWORD'');
            CREATE TABLE t (c INT KEY,c1 BLOB,c2 TEXT) ENGINE=InnoDB;
            CREATE TABLE t2 (pk INT,c1 INT) ENGINE=Spider COMMENT='TABLE "st"' PARTITION BY LIST COLUMNS (c1) (PARTITION p DEFAULT COMMENT='srv "d"' ENGINE=Spider COMMENT='WRAPPER "mysql",SRV "srv",TABLE "t"');
            DELETE FROM t2 WHERE pk=2;
            

            Leads to:

            11.2.5 03807c8449cdccbf5b8afc0dddabb1d8ec7ba85a (Debug)

            mariadbd: /test/11.2_dbg/sql/handler.h:3500: int handler::ha_rnd_end(): Assertion `inited==RND' failed.
            

            11.2.5 03807c8449cdccbf5b8afc0dddabb1d8ec7ba85a (Debug)

            Core was generated by `/test/MD200724-mariadb-11.2.5-linux-x86_64-dbg/bin/mariadbd --no-defaults --max'.
            Program terminated with signal SIGABRT, Aborted.
            Download failed: Invalid argument.  Continuing without source file ./nptl/./nptl/pthread_kill.c.
            #0  __pthread_kill_implementation (no_tid=0, signo=6, threadid=<optimized out>)at ./nptl/pthread_kill.c:44
             
            warning: 44	./nptl/pthread_kill.c: No such file or directory
            [Current thread is 1 (LWP 210264)]
            (gdb) bt
            #0  __pthread_kill_implementation (no_tid=0, signo=6, threadid=<optimized out>)at ./nptl/pthread_kill.c:44
            #1  __pthread_kill_internal (signo=6, threadid=<optimized out>)at ./nptl/pthread_kill.c:78
            #2  __GI___pthread_kill (threadid=<optimized out>, signo=signo@entry=6)at ./nptl/pthread_kill.c:89
            #3  0x000014672d44526e in __GI_raise (sig=sig@entry=6)at ../sysdeps/posix/raise.c:26
            #4  0x000014672d4288ff in __GI_abort () at ./stdlib/abort.c:79
            #5  0x000014672d42881b in __assert_fail_base (fmt=0x14672d5d01e8 "%s%s%s:%u: %s%sAssertion `%s' failed.\n%n", assertion=assertion@entry=0x56217cc5706d "inited==RND", file=file@entry=0x56217cc270f7 "/test/11.2_dbg/sql/handler.h", line=line@entry=3500, function=function@entry=0x56217cc27114 "int handler::ha_rnd_end()")at ./assert/assert.c:94
            #6  0x000014672d43b507 in __assert_fail (assertion=0x56217cc5706d "inited==RND", file=0x56217cc270f7 "/test/11.2_dbg/sql/handler.h", line=3500, function=0x56217cc27114 "int handler::ha_rnd_end()")at ./assert/assert.c:103
            #7  0x000056217c30663c in handler::ha_rnd_end (this=0x1466cc058a10)at /test/11.2_dbg/sql/handler.h:3500
            #8  ha_partition::direct_delete_rows (this=0x1466cc0cee00, delete_rows_result=<optimized out>)at /test/11.2_dbg/sql/ha_partition.cc:12197
            #9  0x000056217c075a77 in handler::ha_direct_delete_rows (this=0x1466cc0cee00, delete_rows=delete_rows@entry=0x14672c6e0ae8)at /test/11.2_dbg/sql/handler.cc:8145
            #10 0x000056217bd046cb in Sql_cmd_delete::delete_from_single_table (this=this@entry=0x1466cc014930, thd=thd@entry=0x1466cc000d58)at /test/11.2_dbg/sql/sql_delete.cc:649
            #11 0x000056217bd05ebc in Sql_cmd_delete::execute_inner (this=0x1466cc014930, thd=0x1466cc000d58) at /test/11.2_dbg/sql/sql_delete.cc:1813
            #12 0x000056217bd9cd83 in Sql_cmd_dml::execute (this=0x1466cc014930, thd=0x1466cc000d58) at /test/11.2_dbg/sql/sql_select.cc:33791
            #13 0x000056217bd591c4 in mysql_execute_command (thd=thd@entry=0x1466cc000d58, is_called_from_prepared_stmt=is_called_from_prepared_stmt@entry=false)at /test/11.2_dbg/sql/sql_parse.cc:4433
            #14 0x000056217bd5e753 in mysql_parse (thd=thd@entry=0x1466cc000d58, rawbuf=<optimized out>, length=<optimized out>, parser_state=parser_state@entry=0x14672c6e1290)at /test/11.2_dbg/sql/sql_parse.cc:7920
            #15 0x000056217bd60ada in dispatch_command (command=command@entry=COM_QUERY, thd=thd@entry=0x1466cc000d58, packet=packet@entry=0x1466cc00b309 "DELETE FROM t2 WHERE pk=2", packet_length=packet_length@entry=25, blocking=blocking@entry=true)at /test/11.2_dbg/sql/sql_class.h:247
            #16 0x000056217bd62dff in do_command (thd=0x1466cc000d58, blocking=blocking@entry=true) at /test/11.2_dbg/sql/sql_parse.cc:1407
            #17 0x000056217bec9e61 in do_handle_one_connection (connect=<optimized out>, connect@entry=0x56217e95fae8, put_in_cache=put_in_cache@entry=true)at /test/11.2_dbg/sql/sql_connect.cc:1439
            #18 0x000056217beca156 in handle_one_connection (arg=arg@entry=0x56217e95fae8)at /test/11.2_dbg/sql/sql_connect.cc:1341
            #19 0x000056217c31b192 in pfs_spawn_thread (arg=0x56217e92eca8)at /test/11.2_dbg/storage/perfschema/pfs.cc:2201
            #20 0x000014672d49ca94 in start_thread (arg=<optimized out>)at ./nptl/pthread_create.c:447
            #21 0x000014672d529c3c in clone3 ()at ../sysdeps/unix/sysv/linux/x86_64/clone3.S:78
            

            Bug confirmed present in:
            MariaDB: 10.5.26 (dbg), 10.6.19 (dbg), 10.11.9 (dbg), 11.1.6 (dbg), 11.2.5 (dbg), 11.4.3 (dbg), 11.5.2 (dbg), 11.6.0 (dbg)

            Bug (or feature/syntax) confirmed not present in:
            MariaDB: 10.5.26 (opt), 10.6.19 (opt), 10.11.9 (opt), 11.1.6 (opt), 11.2.5 (opt), 11.4.3 (opt), 11.5.2 (opt), 11.6.0 (opt)

            Roel Roel Van de Paar added a comment - A slightly different stack with this testcase: SET sql_mode= '' ; INSTALL PLUGIN Spider SONAME 'ha_spider.so' ; GRANT ALL ON * TO Spider@localhost; CREATE SERVER srv FOREIGN DATA WRAPPER MYSQL OPTIONS (SOCKET '../socket.sock' , DATABASE '' , USER 'Spider' , PASSWORD '' ); CREATE TABLE t (c INT KEY ,c1 BLOB,c2 TEXT) ENGINE=InnoDB; CREATE TABLE t2 (pk INT ,c1 INT ) ENGINE=Spider COMMENT= 'TABLE "st"' PARTITION BY LIST COLUMNS (c1) (PARTITION p DEFAULT COMMENT= 'srv "d"' ENGINE=Spider COMMENT= 'WRAPPER "mysql",SRV "srv",TABLE "t"' ); DELETE FROM t2 WHERE pk=2; Leads to: 11.2.5 03807c8449cdccbf5b8afc0dddabb1d8ec7ba85a (Debug) mariadbd: /test/11.2_dbg/sql/handler.h:3500: int handler::ha_rnd_end(): Assertion `inited==RND' failed. 11.2.5 03807c8449cdccbf5b8afc0dddabb1d8ec7ba85a (Debug) Core was generated by `/test/MD200724-mariadb-11.2.5-linux-x86_64-dbg/bin/mariadbd --no-defaults --max'. Program terminated with signal SIGABRT, Aborted. Download failed: Invalid argument. Continuing without source file ./nptl/./nptl/pthread_kill.c. #0 __pthread_kill_implementation (no_tid=0, signo=6, threadid=<optimized out>)at ./nptl/pthread_kill.c:44   warning: 44 ./nptl/pthread_kill.c: No such file or directory [Current thread is 1 (LWP 210264)] (gdb) bt #0 __pthread_kill_implementation (no_tid=0, signo=6, threadid=<optimized out>)at ./nptl/pthread_kill.c:44 #1 __pthread_kill_internal (signo=6, threadid=<optimized out>)at ./nptl/pthread_kill.c:78 #2 __GI___pthread_kill (threadid=<optimized out>, signo=signo@entry=6)at ./nptl/pthread_kill.c:89 #3 0x000014672d44526e in __GI_raise (sig=sig@entry=6)at ../sysdeps/posix/raise.c:26 #4 0x000014672d4288ff in __GI_abort () at ./stdlib/abort.c:79 #5 0x000014672d42881b in __assert_fail_base (fmt=0x14672d5d01e8 "%s%s%s:%u: %s%sAssertion `%s' failed.\n%n", assertion=assertion@entry=0x56217cc5706d "inited==RND", file=file@entry=0x56217cc270f7 "/test/11.2_dbg/sql/handler.h", line=line@entry=3500, function=function@entry=0x56217cc27114 "int handler::ha_rnd_end()")at ./assert/assert.c:94 #6 0x000014672d43b507 in __assert_fail (assertion=0x56217cc5706d "inited==RND", file=0x56217cc270f7 "/test/11.2_dbg/sql/handler.h", line=3500, function=0x56217cc27114 "int handler::ha_rnd_end()")at ./assert/assert.c:103 #7 0x000056217c30663c in handler::ha_rnd_end (this=0x1466cc058a10)at /test/11.2_dbg/sql/handler.h:3500 #8 ha_partition::direct_delete_rows (this=0x1466cc0cee00, delete_rows_result=<optimized out>)at /test/11.2_dbg/sql/ha_partition.cc:12197 #9 0x000056217c075a77 in handler::ha_direct_delete_rows (this=0x1466cc0cee00, delete_rows=delete_rows@entry=0x14672c6e0ae8)at /test/11.2_dbg/sql/handler.cc:8145 #10 0x000056217bd046cb in Sql_cmd_delete::delete_from_single_table (this=this@entry=0x1466cc014930, thd=thd@entry=0x1466cc000d58)at /test/11.2_dbg/sql/sql_delete.cc:649 #11 0x000056217bd05ebc in Sql_cmd_delete::execute_inner (this=0x1466cc014930, thd=0x1466cc000d58) at /test/11.2_dbg/sql/sql_delete.cc:1813 #12 0x000056217bd9cd83 in Sql_cmd_dml::execute (this=0x1466cc014930, thd=0x1466cc000d58) at /test/11.2_dbg/sql/sql_select.cc:33791 #13 0x000056217bd591c4 in mysql_execute_command (thd=thd@entry=0x1466cc000d58, is_called_from_prepared_stmt=is_called_from_prepared_stmt@entry=false)at /test/11.2_dbg/sql/sql_parse.cc:4433 #14 0x000056217bd5e753 in mysql_parse (thd=thd@entry=0x1466cc000d58, rawbuf=<optimized out>, length=<optimized out>, parser_state=parser_state@entry=0x14672c6e1290)at /test/11.2_dbg/sql/sql_parse.cc:7920 #15 0x000056217bd60ada in dispatch_command (command=command@entry=COM_QUERY, thd=thd@entry=0x1466cc000d58, packet=packet@entry=0x1466cc00b309 "DELETE FROM t2 WHERE pk=2", packet_length=packet_length@entry=25, blocking=blocking@entry=true)at /test/11.2_dbg/sql/sql_class.h:247 #16 0x000056217bd62dff in do_command (thd=0x1466cc000d58, blocking=blocking@entry=true) at /test/11.2_dbg/sql/sql_parse.cc:1407 #17 0x000056217bec9e61 in do_handle_one_connection (connect=<optimized out>, connect@entry=0x56217e95fae8, put_in_cache=put_in_cache@entry=true)at /test/11.2_dbg/sql/sql_connect.cc:1439 #18 0x000056217beca156 in handle_one_connection (arg=arg@entry=0x56217e95fae8)at /test/11.2_dbg/sql/sql_connect.cc:1341 #19 0x000056217c31b192 in pfs_spawn_thread (arg=0x56217e92eca8)at /test/11.2_dbg/storage/perfschema/pfs.cc:2201 #20 0x000014672d49ca94 in start_thread (arg=<optimized out>)at ./nptl/pthread_create.c:447 #21 0x000014672d529c3c in clone3 ()at ../sysdeps/unix/sysv/linux/x86_64/clone3.S:78 Bug confirmed present in: MariaDB: 10.5.26 (dbg), 10.6.19 (dbg), 10.11.9 (dbg), 11.1.6 (dbg), 11.2.5 (dbg), 11.4.3 (dbg), 11.5.2 (dbg), 11.6.0 (dbg) Bug (or feature/syntax) confirmed not present in: MariaDB: 10.5.26 (opt), 10.6.19 (opt), 10.11.9 (opt), 11.1.6 (opt), 11.2.5 (opt), 11.4.3 (opt), 11.5.2 (opt), 11.6.0 (opt)

            MTR Testcase for the testcase in the last comment:

            --source include/have_innodb.inc
            --source include/have_partition.inc
            --let $SOCKET= `SELECT @@global.socket`
            INSTALL PLUGIN Spider SONAME 'ha_spider.so';
            SET spider_same_server_link=1;
            CREATE USER spider@localhost IDENTIFIED BY 'pwd';
            GRANT ALL ON test.* TO spider@localhost;
            eval CREATE SERVER srv FOREIGN DATA WRAPPER MYSQL OPTIONS (SOCKET "$SOCKET",DATABASE 'test',USER 'spider',PASSWORD 'pwd');
            CREATE TABLE t (c INT KEY,c1 BLOB,c2 TEXT) ENGINE=InnoDB;
            CREATE TABLE t2 (pk INT,c1 INT) ENGINE=Spider COMMENT='TABLE "st"' PARTITION BY LIST COLUMNS (c1) (PARTITION p DEFAULT COMMENT='srv "d"' ENGINE=Spider COMMENT='WRAPPER "mysql",SRV "srv",TABLE "t"');
            DELETE FROM t2 WHERE pk=2;
            

            Roel Roel Van de Paar added a comment - MTR Testcase for the testcase in the last comment: --source include/have_innodb.inc --source include/have_partition.inc --let $SOCKET= `SELECT @@global.socket` INSTALL PLUGIN Spider SONAME 'ha_spider.so' ; SET spider_same_server_link=1; CREATE USER spider@localhost IDENTIFIED BY 'pwd' ; GRANT ALL ON test.* TO spider@localhost; eval CREATE SERVER srv FOREIGN DATA WRAPPER MYSQL OPTIONS (SOCKET "$SOCKET" , DATABASE 'test' , USER 'spider' , PASSWORD 'pwd' ); CREATE TABLE t (c INT KEY ,c1 BLOB,c2 TEXT) ENGINE=InnoDB; CREATE TABLE t2 (pk INT ,c1 INT ) ENGINE=Spider COMMENT= 'TABLE "st"' PARTITION BY LIST COLUMNS (c1) (PARTITION p DEFAULT COMMENT= 'srv "d"' ENGINE=Spider COMMENT= 'WRAPPER "mysql",SRV "srv",TABLE "t"' ); DELETE FROM t2 WHERE pk=2;
            Roel Roel Van de Paar added a comment - - edited

            Additional testcase leading to different stack:

            --source include/have_innodb.inc
            --source include/have_partition.inc
            INSTALL PLUGIN Spider SONAME 'ha_spider.so';
            CREATE TABLE t (c1 INT,c2 INT,c3 INT,c4 DATE,c5 DATE,c6 TIME,c7 TIME,c8 DATE,c9 DATE,c10 CHAR(1),c11 VARCHAR(1),KEY(c1),KEY(c3),KEY(c4),KEY(c6),KEY(c8),KEY(c10,c3)) ENGINE=Spider PARTITION BY LIST (c1) (PARTITION p VALUES IN (1,2));
            SHOW CREATE TABLE t;
            DELETE FROM t;
            

            Leads to:

            CS 10.5.29 c43d0a015f974c5a0142e6779332089a7a979853 (Debug, UBASAN, Clang) Build 15/02/2025

            mariadbd: /test/10.5_dbg_san/sql/handler.h:3372: int handler::ha_rnd_end(): Assertion `inited==RND' failed.
            

            CS 10.5.29 c43d0a015f974c5a0142e6779332089a7a979853 (Debug, UBASAN, Clang) Build 15/02/2025

            Core was generated by `/test/UBASAN_MD150225-mariadb-10.5.29-linux-x86_64-dbg/bin/mariadbd --no-defaul'.
            Program terminated with signal SIGABRT, Aborted.
            #0  __pthread_kill_implementation (no_tid=0, signo=6, threadid=<optimized out>)at ./nptl/pthread_kill.c:44
             
            [Current thread is 1 (LWP 3164531)]
            (gdb) bt
            #0  __pthread_kill_implementation (no_tid=0, signo=6, threadid=<optimized out>)at ./nptl/pthread_kill.c:44
            #1  __pthread_kill_internal (signo=6, threadid=<optimized out>)at ./nptl/pthread_kill.c:78
            #2  __GI___pthread_kill (threadid=<optimized out>, signo=6)at ./nptl/pthread_kill.c:89
            #3  0x000055c0228db7d5 in handle_fatal_signal (sig=<optimized out>)at /test/10.5_dbg_san/sql/signal_handler.cc:297
            #4  <signal handler called>
            #5  __pthread_kill_implementation (no_tid=0, signo=6, threadid=<optimized out>)at ./nptl/pthread_kill.c:44
            #6  __pthread_kill_internal (signo=6, threadid=<optimized out>)at ./nptl/pthread_kill.c:78
            #7  __GI___pthread_kill (threadid=<optimized out>, signo=signo@entry=6)at ./nptl/pthread_kill.c:89
            #8  0x0000147a02a4526e in __GI_raise (sig=sig@entry=6)at ../sysdeps/posix/raise.c:26
            #9  0x0000147a02a288ff in __GI_abort () at ./stdlib/abort.c:79
            #10 0x0000147a02a2881b in __assert_fail_base (fmt=0x147a02bd01e8 "%s%s%s:%u: %s%sAssertion `%s' failed.\n%n", assertion=assertion@entry=0x55c024b8fb20 <str> "inited==RND", file=file@entry=0x55c024a29fdf "/test/10.5_dbg_san/sql/handler.h", line=line@entry=3372, function=function@entry=0x55c024b8fb40 <__PRETTY_FUNCTION__._ZN7handler10ha_rnd_endEv> "int handler::ha_rnd_end()") at ./assert/assert.c:94
            #11 0x0000147a02a3b507 in __assert_fail (assertion=0x55c024b8fb20 <str> "inited==RND", file=0x55c024a29fdf "/test/10.5_dbg_san/sql/handler.h", line=3372, function=0x55c024b8fb40 <__PRETTY_FUNCTION__._ZN7handler10ha_rnd_endEv> "int handler::ha_rnd_end()") at ./assert/assert.c:103
            #12 0x000055c02198237d in handler::ha_rnd_end (this=<optimized out>)at /test/10.5_dbg_san/sql/handler.h:3372
            #13 0x000055c0236e66e2 in ha_partition::direct_delete_rows (this=0x51d0004362b8, delete_rows_result=0x1479d4812130)at /test/10.5_dbg_san/sql/ha_partition.cc:12011
            #14 0x000055c02319b4eb in mysql_delete (thd=<optimized out>, table_list=<optimized out>, conds=<optimized out>, order_list=<optimized out>, limit=18446744073709551615, options=<optimized out>, result=<optimized out>)at /test/10.5_dbg_san/sql/sql_delete.cc:659
            #15 0x000055c021c51294 in mysql_execute_command (thd=0x52b00007e218)at /test/10.5_dbg_san/sql/sql_parse.cc:4951
            #16 0x000055c021c14468 in mysql_parse (thd=thd@entry=0x52b00007e218, rawbuf=<optimized out>, length=<optimized out>, parser_state=parser_state@entry=0x1479d49fd710, is_com_multi=<optimized out>, is_next_command=<optimized out>)at /test/10.5_dbg_san/sql/sql_parse.cc:8252
            #17 0x000055c021c083ba in dispatch_command (command=<optimized out>, thd=0x52b00007e218, packet=<optimized out>, packet_length=<optimized out>, is_com_multi=<optimized out>, is_next_command=<optimized out>)at /test/10.5_dbg_san/sql/sql_parse.cc:1891
            #18 0x000055c021c165bf in do_command (thd=thd@entry=0x52b00007e218)at /test/10.5_dbg_san/sql/sql_parse.cc:1375
            #19 0x000055c022220258 in do_handle_one_connection (connect=<optimized out>, connect@entry=0x508000002738, put_in_cache=true)at /test/10.5_dbg_san/sql/sql_connect.cc:1386
            #20 0x000055c02221fb1c in handle_one_connection (arg=0x508000002738)at /test/10.5_dbg_san/sql/sql_connect.cc:1298
            #21 0x000055c02172903d in asan_thread_start(void*) ()
            #22 0x0000147a02a9ca94 in start_thread (arg=<optimized out>)at ./nptl/pthread_create.c:447
            #23 0x0000147a02b29c3c in clone3 ()at ../sysdeps/unix/sysv/linux/x86_64/clone3.S:78
            

            This testcase reproduces only from 10.5 to 10.11, unlike others.

            Roel Roel Van de Paar added a comment - - edited Additional testcase leading to different stack: --source include/have_innodb.inc --source include/have_partition.inc INSTALL PLUGIN Spider SONAME 'ha_spider.so' ; CREATE TABLE t (c1 INT ,c2 INT ,c3 INT ,c4 DATE ,c5 DATE ,c6 TIME ,c7 TIME ,c8 DATE ,c9 DATE ,c10 CHAR (1),c11 VARCHAR (1), KEY (c1), KEY (c3), KEY (c4), KEY (c6), KEY (c8), KEY (c10,c3)) ENGINE=Spider PARTITION BY LIST (c1) (PARTITION p VALUES IN (1,2)); SHOW CREATE TABLE t; DELETE FROM t; Leads to: CS 10.5.29 c43d0a015f974c5a0142e6779332089a7a979853 (Debug, UBASAN, Clang) Build 15/02/2025 mariadbd: /test/10.5_dbg_san/sql/handler.h:3372: int handler::ha_rnd_end(): Assertion `inited==RND' failed. CS 10.5.29 c43d0a015f974c5a0142e6779332089a7a979853 (Debug, UBASAN, Clang) Build 15/02/2025 Core was generated by `/test/UBASAN_MD150225-mariadb-10.5.29-linux-x86_64-dbg/bin/mariadbd --no-defaul'. Program terminated with signal SIGABRT, Aborted. #0 __pthread_kill_implementation (no_tid=0, signo=6, threadid=<optimized out>)at ./nptl/pthread_kill.c:44   [Current thread is 1 (LWP 3164531)] (gdb) bt #0 __pthread_kill_implementation (no_tid=0, signo=6, threadid=<optimized out>)at ./nptl/pthread_kill.c:44 #1 __pthread_kill_internal (signo=6, threadid=<optimized out>)at ./nptl/pthread_kill.c:78 #2 __GI___pthread_kill (threadid=<optimized out>, signo=6)at ./nptl/pthread_kill.c:89 #3 0x000055c0228db7d5 in handle_fatal_signal (sig=<optimized out>)at /test/10.5_dbg_san/sql/signal_handler.cc:297 #4 <signal handler called> #5 __pthread_kill_implementation (no_tid=0, signo=6, threadid=<optimized out>)at ./nptl/pthread_kill.c:44 #6 __pthread_kill_internal (signo=6, threadid=<optimized out>)at ./nptl/pthread_kill.c:78 #7 __GI___pthread_kill (threadid=<optimized out>, signo=signo@entry=6)at ./nptl/pthread_kill.c:89 #8 0x0000147a02a4526e in __GI_raise (sig=sig@entry=6)at ../sysdeps/posix/raise.c:26 #9 0x0000147a02a288ff in __GI_abort () at ./stdlib/abort.c:79 #10 0x0000147a02a2881b in __assert_fail_base (fmt=0x147a02bd01e8 "%s%s%s:%u: %s%sAssertion `%s' failed.\n%n", assertion=assertion@entry=0x55c024b8fb20 <str> "inited==RND", file=file@entry=0x55c024a29fdf "/test/10.5_dbg_san/sql/handler.h", line=line@entry=3372, function=function@entry=0x55c024b8fb40 <__PRETTY_FUNCTION__._ZN7handler10ha_rnd_endEv> "int handler::ha_rnd_end()") at ./assert/assert.c:94 #11 0x0000147a02a3b507 in __assert_fail (assertion=0x55c024b8fb20 <str> "inited==RND", file=0x55c024a29fdf "/test/10.5_dbg_san/sql/handler.h", line=3372, function=0x55c024b8fb40 <__PRETTY_FUNCTION__._ZN7handler10ha_rnd_endEv> "int handler::ha_rnd_end()") at ./assert/assert.c:103 #12 0x000055c02198237d in handler::ha_rnd_end (this=<optimized out>)at /test/10.5_dbg_san/sql/handler.h:3372 #13 0x000055c0236e66e2 in ha_partition::direct_delete_rows (this=0x51d0004362b8, delete_rows_result=0x1479d4812130)at /test/10.5_dbg_san/sql/ha_partition.cc:12011 #14 0x000055c02319b4eb in mysql_delete (thd=<optimized out>, table_list=<optimized out>, conds=<optimized out>, order_list=<optimized out>, limit=18446744073709551615, options=<optimized out>, result=<optimized out>)at /test/10.5_dbg_san/sql/sql_delete.cc:659 #15 0x000055c021c51294 in mysql_execute_command (thd=0x52b00007e218)at /test/10.5_dbg_san/sql/sql_parse.cc:4951 #16 0x000055c021c14468 in mysql_parse (thd=thd@entry=0x52b00007e218, rawbuf=<optimized out>, length=<optimized out>, parser_state=parser_state@entry=0x1479d49fd710, is_com_multi=<optimized out>, is_next_command=<optimized out>)at /test/10.5_dbg_san/sql/sql_parse.cc:8252 #17 0x000055c021c083ba in dispatch_command (command=<optimized out>, thd=0x52b00007e218, packet=<optimized out>, packet_length=<optimized out>, is_com_multi=<optimized out>, is_next_command=<optimized out>)at /test/10.5_dbg_san/sql/sql_parse.cc:1891 #18 0x000055c021c165bf in do_command (thd=thd@entry=0x52b00007e218)at /test/10.5_dbg_san/sql/sql_parse.cc:1375 #19 0x000055c022220258 in do_handle_one_connection (connect=<optimized out>, connect@entry=0x508000002738, put_in_cache=true)at /test/10.5_dbg_san/sql/sql_connect.cc:1386 #20 0x000055c02221fb1c in handle_one_connection (arg=0x508000002738)at /test/10.5_dbg_san/sql/sql_connect.cc:1298 #21 0x000055c02172903d in asan_thread_start(void*) () #22 0x0000147a02a9ca94 in start_thread (arg=<optimized out>)at ./nptl/pthread_create.c:447 #23 0x0000147a02b29c3c in clone3 ()at ../sysdeps/unix/sysv/linux/x86_64/clone3.S:78 This testcase reproduces only from 10.5 to 10.11, unlike others.

            People

              holyfoot Alexey Botchkov
              Roel Roel Van de Paar
              Votes:
              0 Vote for this issue
              Watchers:
              7 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.