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

Assertion `val <= 4294967295u' failed in fts_encode_int | InnoDB: Failing assertion: pos == node->first_doc_id

Details

    Description

      --source include/have_innodb.inc
       
      CREATE TABLE t1 (FTS_DOC_ID BIGINT UNSIGNED NOT NULL AUTO_INCREMENT, c TINYTEXT, PRIMARY KEY (FTS_DOC_ID), FULLTEXT KEY (c)) ENGINE=InnoDB;
      INSERT INTO t1 VALUES (1,'txt');
      UPDATE t1 SET FTS_DOC_ID = 4294967298;
       
      # Cleanup
      DROP TABLE t1;
      

      10.3 462d6893

      2019-05-18 19:30:23 9 [Warning] InnoDB: Doc ID 4294967298 is too big. Its difference with largest Doc ID used 1 cannot exceed or equal to 65535
      mysqld: /data/src/10.3/storage/innobase/include/fts0vlc.ic:96: ulint fts_encode_int(ulint, byte*): Assertion `val <= 4294967295u' failed.
      190518 19:30:23 [ERROR] mysqld got signal 6 ;
       
      #7  0x00007f19c668cf12 in __GI___assert_fail (assertion=0x55b7f1ad9b43 "val <= 4294967295u", file=0x55b7f1ad9b10 "/data/src/10.3/storage/innobase/include/fts0vlc.ic", line=96, function=0x55b7f1adcca0 <fts_encode_int(unsigned long, unsigned char*)::__PRETTY_FUNCTION__> "ulint fts_encode_int(ulint, byte*)") at assert.c:101
      #8  0x000055b7f14f1747 in fts_encode_int (val=4294967297, buf=0x7f19680a7273 "h\031\177") at /data/src/10.3/storage/innobase/include/fts0vlc.ic:96
      #9  0x000055b7f14f4016 in fts_cache_node_add_positions (cache=0x7f196800c1f8, node=0x7f196800c890, doc_id=4294967298, positions=0x7f19680431b0) at /data/src/10.3/storage/innobase/fts/fts0fts.cc:1317
      #10 0x000055b7f14f4342 in fts_cache_add_doc (cache=0x7f196800c1f8, index_cache=0x7f196800c5d8, doc_id=4294967298, tokens=0x7f19680476e0) at /data/src/10.3/storage/innobase/fts/fts0fts.cc:1414
      #11 0x000055b7f14f8b46 in fts_add_doc_by_id (ftt=0x7f196800ac68, doc_id=4294967298, fts_indexes=0x0) at /data/src/10.3/storage/innobase/fts/fts0fts.cc:3561
      #12 0x000055b7f14f70a5 in fts_add (ftt=0x7f196800ac68, row=0x7f1968037f50) at /data/src/10.3/storage/innobase/fts/fts0fts.cc:2849
      #13 0x000055b7f14f784c in fts_commit_table (ftt=0x7f196800ac68) at /data/src/10.3/storage/innobase/fts/fts0fts.cc:3021
      #14 0x000055b7f14f7940 in fts_commit (trx=0x7f19c05230f0) at /data/src/10.3/storage/innobase/fts/fts0fts.cc:3070
      #15 0x000055b7f13b5e28 in trx_commit_low (trx=0x7f19c05230f0, mtr=0x7f19c0288c30) at /data/src/10.3/storage/innobase/trx/trx0trx.cc:1445
      #16 0x000055b7f13b5ff3 in trx_commit (trx=0x7f19c05230f0) at /data/src/10.3/storage/innobase/trx/trx0trx.cc:1534
      #17 0x000055b7f13b63fc in trx_commit_for_mysql (trx=0x7f19c05230f0) at /data/src/10.3/storage/innobase/trx/trx0trx.cc:1670
      #18 0x000055b7f11931ff in innobase_commit_low (trx=0x7f19c05230f0) at /data/src/10.3/storage/innobase/handler/ha_innodb.cc:4410
      #19 0x000055b7f1193594 in innobase_commit_ordered_2 (trx=0x7f19c05230f0, thd=0x7f1968000b00) at /data/src/10.3/storage/innobase/handler/ha_innodb.cc:4524
      #20 0x000055b7f1193a82 in innobase_commit (hton=0x55b7f400c670, thd=0x7f1968000b00, commit_trx=false) at /data/src/10.3/storage/innobase/handler/ha_innodb.cc:4640
      #21 0x000055b7f0f899be in commit_one_phase_2 (thd=0x7f1968000b00, all=false, trans=0x7f1968004030, is_real_trans=true) at /data/src/10.3/sql/handler.cc:1615
      #22 0x000055b7f0f898ba in ha_commit_one_phase (thd=0x7f1968000b00, all=false) at /data/src/10.3/sql/handler.cc:1595
      #23 0x000055b7f0f89053 in ha_commit_trans (thd=0x7f1968000b00, all=false) at /data/src/10.3/sql/handler.cc:1457
      #24 0x000055b7f0e041dc in trans_commit_stmt (thd=0x7f1968000b00) at /data/src/10.3/sql/transaction.cc:505
      #25 0x000055b7f0c9748c in mysql_execute_command (thd=0x7f1968000b00) at /data/src/10.3/sql/sql_parse.cc:6367
      #26 0x000055b7f0c9c1b8 in mysql_parse (thd=0x7f1968000b00, rawbuf=0x7f1968012808 "UPDATE t1 SET FTS_DOC_ID = 4294967298", length=37, parser_state=0x7f19c028a5f0, is_com_multi=false, is_next_command=false) at /data/src/10.3/sql/sql_parse.cc:8098
      #27 0x000055b7f0c891fa in dispatch_command (command=COM_QUERY, thd=0x7f1968000b00, packet=0x7f196815fe71 "UPDATE t1 SET FTS_DOC_ID = 4294967298", packet_length=37, is_com_multi=false, is_next_command=false) at /data/src/10.3/sql/sql_parse.cc:1858
      #28 0x000055b7f0c87c1d in do_command (thd=0x7f1968000b00) at /data/src/10.3/sql/sql_parse.cc:1403
      #29 0x000055b7f0defd65 in do_handle_one_connection (connect=0x55b7f4347020) at /data/src/10.3/sql/sql_connect.cc:1402
      #30 0x000055b7f0defadc in handle_one_connection (arg=0x55b7f4347020) at /data/src/10.3/sql/sql_connect.cc:1308
      #31 0x000055b7f16c5650 in pfs_spawn_thread (arg=0x55b7f428a680) at /data/src/10.3/storage/perfschema/pfs.cc:1862
      #32 0x00007f19c82014a4 in start_thread (arg=0x7f19c028b700) at pthread_create.c:456
      #33 0x00007f19c6749d0f in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:97
      

      Reproducible on 10.1-10.4 debug.
      Non-debug just produces the warning which is probably expected:

      2019-05-18 19:34:16 9 [Warning] InnoDB: Doc ID 4294967298 is too big. Its difference with largest Doc ID used 1 cannot exceed or equal to 65535
      

      Attachments

        Issue Links

          Activity

            elenst Elena Stepanova created issue -

            Funny, just I paid some attention to this when fixing MDEV-19441 or MDEV-19445.

            The message regarding the FTS_DOC_ID difference is duplicated in both calc_row_difference() (invoked during UPDATE) and row_insert_for_mysql() (invoked during INSERT or REPLACE). In 10.1, both the messages are directly output to stderr. In 10.2, the former is ib::warn() while the latter one is ib::error(). I think that neither of these messages should be sent to the server error log. Instead, they should be sent to the client connection only.

            The assertion failure suggests that the FTS_DOC_ID difference was not actually being enforced; apparently the UPDATE was allowed to commit. It occurs for the following operation:

            	/* Encode the new fragment. */
            	ptr += fts_encode_int(doc_id_delta, ptr);
            

            At this point of execution, the clustered index contains a delete-marked record with FTS_DOC_ID=1 and an existing record with FTS_DOC_ID=4294967298. So, indeed, InnoDB failed to abort the operation!

            Related to this, I wonder if the FTS_DOC_ID_MAX_STEP really needs to be that low (65535).

            marko Marko Mäkelä added a comment - Funny, just I paid some attention to this when fixing MDEV-19441 or MDEV-19445 . The message regarding the FTS_DOC_ID difference is duplicated in both calc_row_difference() (invoked during UPDATE ) and row_insert_for_mysql() (invoked during INSERT or REPLACE ). In 10.1, both the messages are directly output to stderr . In 10.2, the former is ib::warn() while the latter one is ib::error() . I think that neither of these messages should be sent to the server error log. Instead, they should be sent to the client connection only. The assertion failure suggests that the FTS_DOC_ID difference was not actually being enforced; apparently the UPDATE was allowed to commit. It occurs for the following operation: /* Encode the new fragment. */ ptr += fts_encode_int(doc_id_delta, ptr); At this point of execution, the clustered index contains a delete-marked record with FTS_DOC_ID=1 and an existing record with FTS_DOC_ID=4294967298 . So, indeed, InnoDB failed to abort the operation! Related to this, I wonder if the FTS_DOC_ID_MAX_STEP really needs to be that low (65535).
            marko Marko Mäkelä made changes -
            Field Original Value New Value
            Assignee Marko Mäkelä [ marko ] Thirunarayanan Balathandayuthapani [ thiru ]

            Here is a slightly longer test case which does crash on a non-debug build, while causing the same assertion failure on a debug build:

            --source include/have_innodb.inc
             
            CREATE TABLE t1 (FTS_DOC_ID BIGINT UNSIGNED NOT NULL AUTO_INCREMENT, c TINYTEXT, PRIMARY KEY (FTS_DOC_ID), FULLTEXT KEY (c)) ENGINE=InnoDB;
            INSERT INTO t1 VALUES (1,'txt');
            UPDATE t1 SET FTS_DOC_ID = 197505260223;
            SET @innodb_optimize_fulltext_only.save= @@innodb_optimize_fulltext_only;
            SET GLOBAL innodb_optimize_fulltext_only = 1;
            OPTIMIZE TABLE t1;
             
            # Cleanup
            DROP TABLE t1;
            SET GLOBAL @innodb_optimize_fulltext_only= @@innodb_optimize_fulltext_only.save;
            

            10.2 non-debug c3824766

            2019-12-20  3:09:47 139821542975232 [Warning] InnoDB: Doc ID 197505260223 is too big. Its difference with largest Doc ID used 1 cannot exceed or equal to 65535
            2019-12-20 03:09:48 0x7f2abd66a700  InnoDB: Assertion failure in file /data/src/10.2/storage/innobase/fts/fts0opt.cc line 1283
            InnoDB: Failing assertion: doc_id == src_node->last_doc_id
             
            #6  0x000055f9bc44b696 in ut_dbg_assertion_failed (expr=expr@entry=0x55f9bcc7fb60 "doc_id == src_node->last_doc_id", file=file@entry=0x55f9bcc7f7b0 "/data/src/10.2/storage/innobase/fts/fts0opt.cc", line=line@entry=1283) at /data/src/10.2/storage/innobase/ut/ut0dbg.cc:60
            #7  0x000055f9bc9f26e8 in fts_optimize_node (enc=<synthetic pointer>, src_node=0x7f2a6804b6b0, dst_node=<optimized out>, del_pos=<synthetic pointer>, del_vec=0x7f2a68045f90) at /data/src/10.2/storage/innobase/fts/fts0opt.cc:1283
            #8  fts_optimize_word (word=<optimized out>, optim=<optimized out>) at /data/src/10.2/storage/innobase/fts/fts0opt.cc:1381
            #9  fts_optimize_compact (start_time=<optimized out>, index=<optimized out>, optim=<optimized out>) at /data/src/10.2/storage/innobase/fts/fts0opt.cc:1549
            #10 fts_optimize_words (optim=optim@entry=0x7f2a680459f0, index=index@entry=0x7f2a68035970, word=word@entry=0x7f2abd665b80) at /data/src/10.2/storage/innobase/fts/fts0opt.cc:1806
            #11 0x000055f9bc9f4904 in fts_optimize_index (index=<optimized out>, optim=<optimized out>) at /data/src/10.2/storage/innobase/fts/fts0opt.cc:1991
            #12 fts_optimize_indexes (optim=<optimized out>) at /data/src/10.2/storage/innobase/fts/fts0opt.cc:2295
            #13 fts_optimize_table (table=<optimized out>) at /data/src/10.2/storage/innobase/fts/fts0opt.cc:2472
            #14 0x000055f9bc7ef5ca in ha_innobase::optimize (this=0x7f2a68044280, thd=<optimized out>, check_opt=<optimized out>) at /data/src/10.2/storage/innobase/handler/ha_innodb.cc:14946
            #15 0x000055f9bc5c5fb1 in mysql_admin_table (thd=thd@entry=0x7f2a680009a8, tables=tables@entry=0x7f2a6800f180, check_opt=check_opt@entry=0x7f2a68005300, operator_name=operator_name@entry=0x55f9bcc547c5 "optimize", lock_type=lock_type@entry=TL_WRITE, org_open_for_modify=org_open_for_modify@entry=true, repair_table_use_frm=false, extra_open_options=0, prepare_func=0x0, operator_func=<optimized out>, view_operator_func=0x0) at /data/src/10.2/sql/sql_admin.cc:803
            #16 0x000055f9bc5c6b7c in Sql_cmd_optimize_table::execute (this=<optimized out>, thd=0x7f2a680009a8) at /data/src/10.2/sql/sql_admin.cc:1364
            #17 0x000055f9bc4f14c9 in mysql_execute_command (thd=thd@entry=0x7f2a680009a8) at /data/src/10.2/sql/sql_parse.cc:5972
            #18 0x000055f9bc4f69cd in mysql_parse (thd=0x7f2a680009a8, rawbuf=<optimized out>, length=17, parser_state=0x7f2abd669240, is_com_multi=<optimized out>, is_next_command=<optimized out>) at /data/src/10.2/sql/sql_parse.cc:7740
            #19 0x000055f9bc4f983b in dispatch_command (command=command@entry=COM_QUERY, thd=thd@entry=0x7f2a680009a8, packet=packet@entry=0x7f2a68006d09 "", packet_length=packet_length@entry=17, is_com_multi=is_com_multi@entry=false, is_next_command=is_next_command@entry=false) at /data/src/10.2/sql/sql_parse.cc:1831
            #20 0x000055f9bc4fa137 in do_command (thd=0x7f2a680009a8) at /data/src/10.2/sql/sql_parse.cc:1384
            #21 0x000055f9bc5b9e24 in do_handle_one_connection (connect=connect@entry=0x55f9bf1d4d38) at /data/src/10.2/sql/sql_connect.cc:1336
            #22 0x000055f9bc5b9ed4 in handle_one_connection (arg=arg@entry=0x55f9bf1d4d38) at /data/src/10.2/sql/sql_connect.cc:1241
            #23 0x000055f9bcb00374 in pfs_spawn_thread (arg=0x55f9bf1870a8) at /data/src/10.2/storage/perfschema/pfs.cc:1862
            #24 0x00007f2ac4f754a4 in start_thread (arg=0x7f2abd66a700) at pthread_create.c:456
            #25 0x00007f2ac30a9d0f in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:97
            

            10.2 debug c3824766

            mysqld: /data/src/10.2/storage/innobase/include/fts0vlc.ic:96: ulint fts_encode_int(ulint, byte*): Assertion `val <= 4294967295u' failed.
            191220  3:07:57 [ERROR] mysqld got signal 6 ;
             
            #7  0x00007f3e3ba1cf12 in __GI___assert_fail (assertion=0x55e29ef0e6d3 "val <= 4294967295u", file=0x55e29ef0e6a0 "/data/src/10.2/storage/innobase/include/fts0vlc.ic", line=96, function=0x55e29ef11760 <fts_encode_int(unsigned long, unsigned char*)::__PRETTY_FUNCTION__> "ulint fts_encode_int(ulint, byte*)") at assert.c:101
            #8  0x000055e29e9dd258 in fts_encode_int (val=197505260222, buf=0x7f3dec00b9c3 "\354=\177") at /data/src/10.2/storage/innobase/include/fts0vlc.ic:96
            #9  0x000055e29e9df89c in fts_cache_node_add_positions (cache=0x7f3dec00a948, node=0x7f3dec00afe0, doc_id=197505260223, positions=0x7f3dec0589a0) at /data/src/10.2/storage/innobase/fts/fts0fts.cc:1314
            #10 0x000055e29e9dfbac in fts_cache_add_doc (cache=0x7f3dec00a948, index_cache=0x7f3dec00ad58, doc_id=197505260223, tokens=0x7f3dec043db0) at /data/src/10.2/storage/innobase/fts/fts0fts.cc:1411
            #11 0x000055e29e9e42db in fts_add_doc_by_id (ftt=0x7f3dec043828, doc_id=197505260223, fts_indexes=0x0) at /data/src/10.2/storage/innobase/fts/fts0fts.cc:3586
            #12 0x000055e29e9e2944 in fts_add (ftt=0x7f3dec043828, row=0x7f3dec044240) at /data/src/10.2/storage/innobase/fts/fts0fts.cc:2876
            #13 0x000055e29e9e30cb in fts_commit_table (ftt=0x7f3dec043828) at /data/src/10.2/storage/innobase/fts/fts0fts.cc:3048
            #14 0x000055e29e9e31bf in fts_commit (trx=0x7f3e36c2f140) at /data/src/10.2/storage/innobase/fts/fts0fts.cc:3097
            #15 0x000055e29e8b405e in trx_commit_low (trx=0x7f3e36c2f140, mtr=0x7f3e36067c00) at /data/src/10.2/storage/innobase/trx/trx0trx.cc:1862
            #16 0x000055e29e8b4231 in trx_commit (trx=0x7f3e36c2f140) at /data/src/10.2/storage/innobase/trx/trx0trx.cc:1952
            #17 0x000055e29e8b4ade in trx_commit_for_mysql (trx=0x7f3e36c2f140) at /data/src/10.2/storage/innobase/trx/trx0trx.cc:2161
            #18 0x000055e29e6b1d84 in innobase_commit_low (trx=0x7f3e36c2f140) at /data/src/10.2/storage/innobase/handler/ha_innodb.cc:4523
            #19 0x000055e29e6b20ef in innobase_commit_ordered_2 (trx=0x7f3e36c2f140, thd=0x7f3dec000af0) at /data/src/10.2/storage/innobase/handler/ha_innodb.cc:4640
            #20 0x000055e29e6b2545 in innobase_commit (hton=0x55e2a04ff180, thd=0x7f3dec000af0, commit_trx=false) at /data/src/10.2/storage/innobase/handler/ha_innodb.cc:4756
            #21 0x000055e29e4ab400 in commit_one_phase_2 (thd=0x7f3dec000af0, all=false, trans=0x7f3dec003dd0, is_real_trans=true) at /data/src/10.2/sql/handler.cc:1604
            #22 0x000055e29e4ab303 in ha_commit_one_phase (thd=0x7f3dec000af0, all=false) at /data/src/10.2/sql/handler.cc:1585
            #23 0x000055e29e4aabcb in ha_commit_trans (thd=0x7f3dec000af0, all=false) at /data/src/10.2/sql/handler.cc:1452
            #24 0x000055e29e38e17e in trans_commit_stmt (thd=0x7f3dec000af0) at /data/src/10.2/sql/transaction.cc:510
            #25 0x000055e29e2310bd in mysql_execute_command (thd=0x7f3dec000af0) at /data/src/10.2/sql/sql_parse.cc:6042
            #26 0x000055e29e235c14 in mysql_parse (thd=0x7f3dec000af0, rawbuf=0x7f3dec012458 "UPDATE t1 SET FTS_DOC_ID = 197505260223", length=39, parser_state=0x7f3e36069200, is_com_multi=false, is_next_command=false) at /data/src/10.2/sql/sql_parse.cc:7740
            #27 0x000055e29e223f2f in dispatch_command (command=COM_QUERY, thd=0x7f3dec000af0, packet=0x7f3dec096361 "UPDATE t1 SET FTS_DOC_ID = 197505260223", packet_length=39, is_com_multi=false, is_next_command=false) at /data/src/10.2/sql/sql_parse.cc:1831
            #28 0x000055e29e222883 in do_command (thd=0x7f3dec000af0) at /data/src/10.2/sql/sql_parse.cc:1384
            #29 0x000055e29e378379 in do_handle_one_connection (connect=0x55e2a0a9b920) at /data/src/10.2/sql/sql_connect.cc:1336
            #30 0x000055e29e3780e4 in handle_one_connection (arg=0x55e2a0a9b920) at /data/src/10.2/sql/sql_connect.cc:1241
            #31 0x000055e29eba4812 in pfs_spawn_thread (arg=0x55e2a0aa6710) at /data/src/10.2/storage/perfschema/pfs.cc:1862
            #32 0x00007f3e3d9a54a4 in start_thread (arg=0x7f3e3606a700) at pthread_create.c:456
            #33 0x00007f3e3bad9d0f in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:97
            

            elenst Elena Stepanova added a comment - Here is a slightly longer test case which does crash on a non-debug build, while causing the same assertion failure on a debug build: --source include/have_innodb.inc CREATE TABLE t1 (FTS_DOC_ID BIGINT UNSIGNED NOT NULL AUTO_INCREMENT, c TINYTEXT, PRIMARY KEY (FTS_DOC_ID), FULLTEXT KEY (c)) ENGINE=InnoDB; INSERT INTO t1 VALUES (1, 'txt' ); UPDATE t1 SET FTS_DOC_ID = 197505260223; SET @innodb_optimize_fulltext_only.save= @@innodb_optimize_fulltext_only; SET GLOBAL innodb_optimize_fulltext_only = 1; OPTIMIZE TABLE t1;   # Cleanup DROP TABLE t1; SET GLOBAL @innodb_optimize_fulltext_only= @@innodb_optimize_fulltext_only.save; 10.2 non-debug c3824766 2019-12-20 3:09:47 139821542975232 [Warning] InnoDB: Doc ID 197505260223 is too big. Its difference with largest Doc ID used 1 cannot exceed or equal to 65535 2019-12-20 03:09:48 0x7f2abd66a700 InnoDB: Assertion failure in file /data/src/10.2/storage/innobase/fts/fts0opt.cc line 1283 InnoDB: Failing assertion: doc_id == src_node->last_doc_id   #6 0x000055f9bc44b696 in ut_dbg_assertion_failed (expr=expr@entry=0x55f9bcc7fb60 "doc_id == src_node->last_doc_id", file=file@entry=0x55f9bcc7f7b0 "/data/src/10.2/storage/innobase/fts/fts0opt.cc", line=line@entry=1283) at /data/src/10.2/storage/innobase/ut/ut0dbg.cc:60 #7 0x000055f9bc9f26e8 in fts_optimize_node (enc=<synthetic pointer>, src_node=0x7f2a6804b6b0, dst_node=<optimized out>, del_pos=<synthetic pointer>, del_vec=0x7f2a68045f90) at /data/src/10.2/storage/innobase/fts/fts0opt.cc:1283 #8 fts_optimize_word (word=<optimized out>, optim=<optimized out>) at /data/src/10.2/storage/innobase/fts/fts0opt.cc:1381 #9 fts_optimize_compact (start_time=<optimized out>, index=<optimized out>, optim=<optimized out>) at /data/src/10.2/storage/innobase/fts/fts0opt.cc:1549 #10 fts_optimize_words (optim=optim@entry=0x7f2a680459f0, index=index@entry=0x7f2a68035970, word=word@entry=0x7f2abd665b80) at /data/src/10.2/storage/innobase/fts/fts0opt.cc:1806 #11 0x000055f9bc9f4904 in fts_optimize_index (index=<optimized out>, optim=<optimized out>) at /data/src/10.2/storage/innobase/fts/fts0opt.cc:1991 #12 fts_optimize_indexes (optim=<optimized out>) at /data/src/10.2/storage/innobase/fts/fts0opt.cc:2295 #13 fts_optimize_table (table=<optimized out>) at /data/src/10.2/storage/innobase/fts/fts0opt.cc:2472 #14 0x000055f9bc7ef5ca in ha_innobase::optimize (this=0x7f2a68044280, thd=<optimized out>, check_opt=<optimized out>) at /data/src/10.2/storage/innobase/handler/ha_innodb.cc:14946 #15 0x000055f9bc5c5fb1 in mysql_admin_table (thd=thd@entry=0x7f2a680009a8, tables=tables@entry=0x7f2a6800f180, check_opt=check_opt@entry=0x7f2a68005300, operator_name=operator_name@entry=0x55f9bcc547c5 "optimize", lock_type=lock_type@entry=TL_WRITE, org_open_for_modify=org_open_for_modify@entry=true, repair_table_use_frm=false, extra_open_options=0, prepare_func=0x0, operator_func=<optimized out>, view_operator_func=0x0) at /data/src/10.2/sql/sql_admin.cc:803 #16 0x000055f9bc5c6b7c in Sql_cmd_optimize_table::execute (this=<optimized out>, thd=0x7f2a680009a8) at /data/src/10.2/sql/sql_admin.cc:1364 #17 0x000055f9bc4f14c9 in mysql_execute_command (thd=thd@entry=0x7f2a680009a8) at /data/src/10.2/sql/sql_parse.cc:5972 #18 0x000055f9bc4f69cd in mysql_parse (thd=0x7f2a680009a8, rawbuf=<optimized out>, length=17, parser_state=0x7f2abd669240, is_com_multi=<optimized out>, is_next_command=<optimized out>) at /data/src/10.2/sql/sql_parse.cc:7740 #19 0x000055f9bc4f983b in dispatch_command (command=command@entry=COM_QUERY, thd=thd@entry=0x7f2a680009a8, packet=packet@entry=0x7f2a68006d09 "", packet_length=packet_length@entry=17, is_com_multi=is_com_multi@entry=false, is_next_command=is_next_command@entry=false) at /data/src/10.2/sql/sql_parse.cc:1831 #20 0x000055f9bc4fa137 in do_command (thd=0x7f2a680009a8) at /data/src/10.2/sql/sql_parse.cc:1384 #21 0x000055f9bc5b9e24 in do_handle_one_connection (connect=connect@entry=0x55f9bf1d4d38) at /data/src/10.2/sql/sql_connect.cc:1336 #22 0x000055f9bc5b9ed4 in handle_one_connection (arg=arg@entry=0x55f9bf1d4d38) at /data/src/10.2/sql/sql_connect.cc:1241 #23 0x000055f9bcb00374 in pfs_spawn_thread (arg=0x55f9bf1870a8) at /data/src/10.2/storage/perfschema/pfs.cc:1862 #24 0x00007f2ac4f754a4 in start_thread (arg=0x7f2abd66a700) at pthread_create.c:456 #25 0x00007f2ac30a9d0f in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:97 10.2 debug c3824766 mysqld: /data/src/10.2/storage/innobase/include/fts0vlc.ic:96: ulint fts_encode_int(ulint, byte*): Assertion `val <= 4294967295u' failed. 191220 3:07:57 [ERROR] mysqld got signal 6 ;   #7 0x00007f3e3ba1cf12 in __GI___assert_fail (assertion=0x55e29ef0e6d3 "val <= 4294967295u", file=0x55e29ef0e6a0 "/data/src/10.2/storage/innobase/include/fts0vlc.ic", line=96, function=0x55e29ef11760 <fts_encode_int(unsigned long, unsigned char*)::__PRETTY_FUNCTION__> "ulint fts_encode_int(ulint, byte*)") at assert.c:101 #8 0x000055e29e9dd258 in fts_encode_int (val=197505260222, buf=0x7f3dec00b9c3 "\354=\177") at /data/src/10.2/storage/innobase/include/fts0vlc.ic:96 #9 0x000055e29e9df89c in fts_cache_node_add_positions (cache=0x7f3dec00a948, node=0x7f3dec00afe0, doc_id=197505260223, positions=0x7f3dec0589a0) at /data/src/10.2/storage/innobase/fts/fts0fts.cc:1314 #10 0x000055e29e9dfbac in fts_cache_add_doc (cache=0x7f3dec00a948, index_cache=0x7f3dec00ad58, doc_id=197505260223, tokens=0x7f3dec043db0) at /data/src/10.2/storage/innobase/fts/fts0fts.cc:1411 #11 0x000055e29e9e42db in fts_add_doc_by_id (ftt=0x7f3dec043828, doc_id=197505260223, fts_indexes=0x0) at /data/src/10.2/storage/innobase/fts/fts0fts.cc:3586 #12 0x000055e29e9e2944 in fts_add (ftt=0x7f3dec043828, row=0x7f3dec044240) at /data/src/10.2/storage/innobase/fts/fts0fts.cc:2876 #13 0x000055e29e9e30cb in fts_commit_table (ftt=0x7f3dec043828) at /data/src/10.2/storage/innobase/fts/fts0fts.cc:3048 #14 0x000055e29e9e31bf in fts_commit (trx=0x7f3e36c2f140) at /data/src/10.2/storage/innobase/fts/fts0fts.cc:3097 #15 0x000055e29e8b405e in trx_commit_low (trx=0x7f3e36c2f140, mtr=0x7f3e36067c00) at /data/src/10.2/storage/innobase/trx/trx0trx.cc:1862 #16 0x000055e29e8b4231 in trx_commit (trx=0x7f3e36c2f140) at /data/src/10.2/storage/innobase/trx/trx0trx.cc:1952 #17 0x000055e29e8b4ade in trx_commit_for_mysql (trx=0x7f3e36c2f140) at /data/src/10.2/storage/innobase/trx/trx0trx.cc:2161 #18 0x000055e29e6b1d84 in innobase_commit_low (trx=0x7f3e36c2f140) at /data/src/10.2/storage/innobase/handler/ha_innodb.cc:4523 #19 0x000055e29e6b20ef in innobase_commit_ordered_2 (trx=0x7f3e36c2f140, thd=0x7f3dec000af0) at /data/src/10.2/storage/innobase/handler/ha_innodb.cc:4640 #20 0x000055e29e6b2545 in innobase_commit (hton=0x55e2a04ff180, thd=0x7f3dec000af0, commit_trx=false) at /data/src/10.2/storage/innobase/handler/ha_innodb.cc:4756 #21 0x000055e29e4ab400 in commit_one_phase_2 (thd=0x7f3dec000af0, all=false, trans=0x7f3dec003dd0, is_real_trans=true) at /data/src/10.2/sql/handler.cc:1604 #22 0x000055e29e4ab303 in ha_commit_one_phase (thd=0x7f3dec000af0, all=false) at /data/src/10.2/sql/handler.cc:1585 #23 0x000055e29e4aabcb in ha_commit_trans (thd=0x7f3dec000af0, all=false) at /data/src/10.2/sql/handler.cc:1452 #24 0x000055e29e38e17e in trans_commit_stmt (thd=0x7f3dec000af0) at /data/src/10.2/sql/transaction.cc:510 #25 0x000055e29e2310bd in mysql_execute_command (thd=0x7f3dec000af0) at /data/src/10.2/sql/sql_parse.cc:6042 #26 0x000055e29e235c14 in mysql_parse (thd=0x7f3dec000af0, rawbuf=0x7f3dec012458 "UPDATE t1 SET FTS_DOC_ID = 197505260223", length=39, parser_state=0x7f3e36069200, is_com_multi=false, is_next_command=false) at /data/src/10.2/sql/sql_parse.cc:7740 #27 0x000055e29e223f2f in dispatch_command (command=COM_QUERY, thd=0x7f3dec000af0, packet=0x7f3dec096361 "UPDATE t1 SET FTS_DOC_ID = 197505260223", packet_length=39, is_com_multi=false, is_next_command=false) at /data/src/10.2/sql/sql_parse.cc:1831 #28 0x000055e29e222883 in do_command (thd=0x7f3dec000af0) at /data/src/10.2/sql/sql_parse.cc:1384 #29 0x000055e29e378379 in do_handle_one_connection (connect=0x55e2a0a9b920) at /data/src/10.2/sql/sql_connect.cc:1336 #30 0x000055e29e3780e4 in handle_one_connection (arg=0x55e2a0a9b920) at /data/src/10.2/sql/sql_connect.cc:1241 #31 0x000055e29eba4812 in pfs_spawn_thread (arg=0x55e2a0aa6710) at /data/src/10.2/storage/perfschema/pfs.cc:1862 #32 0x00007f3e3d9a54a4 in start_thread (arg=0x7f3e3606a700) at pthread_create.c:456 #33 0x00007f3e3bad9d0f in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:97
            alice Alice Sherepa made changes -
            Affects Version/s 10.5 [ 23123 ]
            alice Alice Sherepa made changes -
            Fix Version/s 10.5 [ 23123 ]
            alice Alice Sherepa made changes -
            alice Alice Sherepa made changes -
            Affects Version/s 10.0 [ 16000 ]

            SET @@session.insert_id = 100000000000;
            CREATE TABLE t (FTS_DOC_ID BIGINT UNSIGNED AUTO_INCREMENT PRIMARY KEY, c TEXT) ENGINE=InnoDB;
            INSERT INTO t (c) VALUES ('aaa');
            CREATE FULLTEXT INDEX i ON t (c);
            

            Leads to:

            10.6.0 5d4599f9750140f92cfdbbe4d292ae1b8dd456f8 (Debug)

            mysqld: /test/10.6_dbg/storage/innobase/include/fts0vlc.ic:96: ulint fts_encode_int(ulint, byte*): Assertion `val <= 4294967295u' failed.
            

            10.6.0 5d4599f9750140f92cfdbbe4d292ae1b8dd456f8 (Debug)

            Core was generated by `/test/MD211020-mariadb-10.6.0-linux-x86_64-dbg/bin/mysqld --no-defaults --core-'.
            Program terminated with signal SIGABRT, Aborted.
            #0  __pthread_kill (threadid=<optimized out>, signo=signo@entry=6)
                at ../sysdeps/unix/sysv/linux/pthread_kill.c:56
            [Current thread is 1 (Thread 0x154e8894e700 (LWP 1803924))]
            (gdb) bt
            #0  __pthread_kill (threadid=<optimized out>, signo=signo@entry=6) at ../sysdeps/unix/sysv/linux/pthread_kill.c:56
            #1  0x0000557b1988f021 in my_write_core (sig=sig@entry=6) at /test/10.6_dbg/mysys/stacktrace.c:424
            #2  0x0000557b18fd6321 in handle_fatal_signal (sig=6) at /test/10.6_dbg/sql/signal_handler.cc:330
            #3  <signal handler called>
            #4  __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50
            #5  0x0000154ea011f859 in __GI_abort () at abort.c:79
            #6  0x0000154ea011f729 in __assert_fail_base (fmt=0x154ea02b5588 "%s%s%s:%u: %s%sAssertion `%s' failed.\n%n", assertion=0x557b19cc6c3c "val <= 4294967295u", file=0x557b19cc5ba0 "/test/10.6_dbg/storage/innobase/include/fts0vlc.ic", line=96, function=<optimized out>) at assert.c:92
            #7  0x0000154ea0130f36 in __GI___assert_fail (assertion=assertion@entry=0x557b19cc6c3c "val <= 4294967295u", file=file@entry=0x557b19cc5ba0 "/test/10.6_dbg/storage/innobase/include/fts0vlc.ic", line=line@entry=96, function=function@entry=0x557b19cc5bd8 "ulint fts_encode_int(ulint, byte*)") at assert.c:101
            #8  0x0000557b197af58d in fts_encode_int (buf=0x154e5401cbb8 "\004", val=100000000000) at /test/10.6_dbg/storage/innobase/include/fts0vlc.ic:96
            #9  fts_cache_node_add_positions (cache=cache@entry=0x0, node=node@entry=0x154e7802a700, doc_id=100000000000, positions=positions@entry=0x154e7802a7e0) at /test/10.6_dbg/storage/innobase/fts/fts0fts.cc:1296
            #10 0x0000557b195211f9 in row_fts_insert_tuple (ins_ctx=ins_ctx@entry=0x154e8894d8d0, word=word@entry=0x154e8894d8b0, positions=positions@entry=0x154e7802a7e0, in_doc_id=in_doc_id@entry=0x154e8894d880, dtuple=dtuple@entry=0x0) at /test/10.6_dbg/storage/innobase/row/row0ftsort.cc:1246
            #11 0x0000557b19523112 in row_fts_merge_insert (index=<optimized out>, table=<optimized out>, psort_info=<optimized out>, id=<optimized out>) at /test/10.6_dbg/storage/innobase/row/row0ftsort.cc:1702
            #12 0x0000557b19524df0 in fts_parallel_merge (arg=0x154e540d58f0) at /test/10.6_dbg/storage/innobase/row/row0ftsort.cc:1089
            #13 0x0000557b1981b67f in tpool::task::execute (this=0x154e540d7eb0) at /test/10.6_dbg/tpool/task.cc:52
            #14 0x0000557b1981a25f in tpool::thread_pool_generic::worker_main (this=0x557b1b35bb20, thread_var=0x557b1b397ad0) at /test/10.6_dbg/tpool/tpool_generic.cc:518
            #15 0x0000557b1981a598 in std::__invoke_impl<void, void (tpool::thread_pool_generic::*)(tpool::worker_data*), tpool::thread_pool_generic*, tpool::worker_data*> (__t=<optimized out>, __f=<optimized out>) at /usr/include/c++/9/bits/invoke.h:89
            #16 std::__invoke<void (tpool::thread_pool_generic::*)(tpool::worker_data*), tpool::thread_pool_generic*, tpool::worker_data*> (__fn=<optimized out>) at /usr/include/c++/9/bits/invoke.h:95
            #17 std::thread::_Invoker<std::tuple<void (tpool::thread_pool_generic::*)(tpool::worker_data*), tpool::thread_pool_generic*, tpool::worker_data*> >::_M_invoke<0ul, 1ul, 2ul> (this=<optimized out>) at /usr/include/c++/9/thread:244
            #18 std::thread::_Invoker<std::tuple<void (tpool::thread_pool_generic::*)(tpool::worker_data*), tpool::thread_pool_generic*, tpool::worker_data*> >::operator() (this=<optimized out>) at /usr/include/c++/9/thread:251
            #19 std::thread::_State_impl<std::thread::_Invoker<std::tuple<void (tpool::thread_pool_generic::*)(tpool::worker_data*), tpool::thread_pool_generic*, tpool::worker_data*> > >::_M_run (this=<optimized out>) at /usr/include/c++/9/thread:195
            #20 0x0000154ea0511d84 in ?? () from /usr/lib/x86_64-linux-gnu/libstdc++.so.6
            #21 0x0000154ea062d609 in start_thread (arg=<optimized out>) at pthread_create.c:477
            #22 0x0000154ea021c293 in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95
            

            Bug confirmed present in:
            MariaDB: 10.1.48 (dbg), 10.2.35 (dbg), 10.3.26 (dbg), 10.4.16 (dbg), 10.5.7 (dbg), 10.6.0 (dbg)
            MySQL: 5.6.50 (dbg), 5.7.32 (dbg), 8.0.22 (dbg)

            Bug confirmed not present in:
            MariaDB: 10.1.48 (opt), 10.2.35 (opt), 10.3.26 (opt), 10.4.16 (opt), 10.5.7 (opt), 10.6.0 (opt)
            MySQL: 5.5.62 (dbg), 5.5.62 (opt), 5.6.50 (opt), 5.7.32 (opt), 8.0.22 (opt)

            Roel Roel Van de Paar added a comment - SET @@session.insert_id = 100000000000; CREATE TABLE t (FTS_DOC_ID BIGINT UNSIGNED AUTO_INCREMENT PRIMARY KEY, c TEXT) ENGINE=InnoDB; INSERT INTO t (c) VALUES ('aaa'); CREATE FULLTEXT INDEX i ON t (c); Leads to: 10.6.0 5d4599f9750140f92cfdbbe4d292ae1b8dd456f8 (Debug) mysqld: /test/10.6_dbg/storage/innobase/include/fts0vlc.ic:96: ulint fts_encode_int(ulint, byte*): Assertion `val <= 4294967295u' failed. 10.6.0 5d4599f9750140f92cfdbbe4d292ae1b8dd456f8 (Debug) Core was generated by `/test/MD211020-mariadb-10.6.0-linux-x86_64-dbg/bin/mysqld --no-defaults --core-'. Program terminated with signal SIGABRT, Aborted. #0 __pthread_kill (threadid=<optimized out>, signo=signo@entry=6) at ../sysdeps/unix/sysv/linux/pthread_kill.c:56 [Current thread is 1 (Thread 0x154e8894e700 (LWP 1803924))] (gdb) bt #0 __pthread_kill (threadid=<optimized out>, signo=signo@entry=6) at ../sysdeps/unix/sysv/linux/pthread_kill.c:56 #1 0x0000557b1988f021 in my_write_core (sig=sig@entry=6) at /test/10.6_dbg/mysys/stacktrace.c:424 #2 0x0000557b18fd6321 in handle_fatal_signal (sig=6) at /test/10.6_dbg/sql/signal_handler.cc:330 #3 <signal handler called> #4 __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50 #5 0x0000154ea011f859 in __GI_abort () at abort.c:79 #6 0x0000154ea011f729 in __assert_fail_base (fmt=0x154ea02b5588 "%s%s%s:%u: %s%sAssertion `%s' failed.\n%n", assertion=0x557b19cc6c3c "val <= 4294967295u", file=0x557b19cc5ba0 "/test/10.6_dbg/storage/innobase/include/fts0vlc.ic", line=96, function=<optimized out>) at assert.c:92 #7 0x0000154ea0130f36 in __GI___assert_fail (assertion=assertion@entry=0x557b19cc6c3c "val <= 4294967295u", file=file@entry=0x557b19cc5ba0 "/test/10.6_dbg/storage/innobase/include/fts0vlc.ic", line=line@entry=96, function=function@entry=0x557b19cc5bd8 "ulint fts_encode_int(ulint, byte*)") at assert.c:101 #8 0x0000557b197af58d in fts_encode_int (buf=0x154e5401cbb8 "\004", val=100000000000) at /test/10.6_dbg/storage/innobase/include/fts0vlc.ic:96 #9 fts_cache_node_add_positions (cache=cache@entry=0x0, node=node@entry=0x154e7802a700, doc_id=100000000000, positions=positions@entry=0x154e7802a7e0) at /test/10.6_dbg/storage/innobase/fts/fts0fts.cc:1296 #10 0x0000557b195211f9 in row_fts_insert_tuple (ins_ctx=ins_ctx@entry=0x154e8894d8d0, word=word@entry=0x154e8894d8b0, positions=positions@entry=0x154e7802a7e0, in_doc_id=in_doc_id@entry=0x154e8894d880, dtuple=dtuple@entry=0x0) at /test/10.6_dbg/storage/innobase/row/row0ftsort.cc:1246 #11 0x0000557b19523112 in row_fts_merge_insert (index=<optimized out>, table=<optimized out>, psort_info=<optimized out>, id=<optimized out>) at /test/10.6_dbg/storage/innobase/row/row0ftsort.cc:1702 #12 0x0000557b19524df0 in fts_parallel_merge (arg=0x154e540d58f0) at /test/10.6_dbg/storage/innobase/row/row0ftsort.cc:1089 #13 0x0000557b1981b67f in tpool::task::execute (this=0x154e540d7eb0) at /test/10.6_dbg/tpool/task.cc:52 #14 0x0000557b1981a25f in tpool::thread_pool_generic::worker_main (this=0x557b1b35bb20, thread_var=0x557b1b397ad0) at /test/10.6_dbg/tpool/tpool_generic.cc:518 #15 0x0000557b1981a598 in std::__invoke_impl<void, void (tpool::thread_pool_generic::*)(tpool::worker_data*), tpool::thread_pool_generic*, tpool::worker_data*> (__t=<optimized out>, __f=<optimized out>) at /usr/include/c++/9/bits/invoke.h:89 #16 std::__invoke<void (tpool::thread_pool_generic::*)(tpool::worker_data*), tpool::thread_pool_generic*, tpool::worker_data*> (__fn=<optimized out>) at /usr/include/c++/9/bits/invoke.h:95 #17 std::thread::_Invoker<std::tuple<void (tpool::thread_pool_generic::*)(tpool::worker_data*), tpool::thread_pool_generic*, tpool::worker_data*> >::_M_invoke<0ul, 1ul, 2ul> (this=<optimized out>) at /usr/include/c++/9/thread:244 #18 std::thread::_Invoker<std::tuple<void (tpool::thread_pool_generic::*)(tpool::worker_data*), tpool::thread_pool_generic*, tpool::worker_data*> >::operator() (this=<optimized out>) at /usr/include/c++/9/thread:251 #19 std::thread::_State_impl<std::thread::_Invoker<std::tuple<void (tpool::thread_pool_generic::*)(tpool::worker_data*), tpool::thread_pool_generic*, tpool::worker_data*> > >::_M_run (this=<optimized out>) at /usr/include/c++/9/thread:195 #20 0x0000154ea0511d84 in ?? () from /usr/lib/x86_64-linux-gnu/libstdc++.so.6 #21 0x0000154ea062d609 in start_thread (arg=<optimized out>) at pthread_create.c:477 #22 0x0000154ea021c293 in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95 Bug confirmed present in: MariaDB: 10.1.48 (dbg), 10.2.35 (dbg), 10.3.26 (dbg), 10.4.16 (dbg), 10.5.7 (dbg), 10.6.0 (dbg) MySQL: 5.6.50 (dbg), 5.7.32 (dbg), 8.0.22 (dbg) Bug confirmed not present in: MariaDB: 10.1.48 (opt), 10.2.35 (opt), 10.3.26 (opt), 10.4.16 (opt), 10.5.7 (opt), 10.6.0 (opt) MySQL: 5.5.62 (dbg), 5.5.62 (opt), 5.6.50 (opt), 5.7.32 (opt), 8.0.22 (opt)
            Roel Roel Van de Paar made changes -
            Affects Version/s 10.6 [ 24028 ]
            Roel Roel Van de Paar made changes -
            Labels upstream
            Roel Roel Van de Paar added a comment - - edited

            All unique ID's seen so far (across various testcases, and versions of MD and MS)

            SIGABRT|ut_dbg_assertion_failed|fts_encode_int|fts_cache_node_add_positions|fts_cache_add_doc
            SIGABRT|ut_dbg_assertion_failed|fts_encode_int|fts_cache_node_add_positions|row_fts_insert_tuple
            SIGABRT|ut_dbg_assertion_failed|fts_optimize_node|fts_optimize_word|fts_optimize_compact
            SIGABRT|ut_dbg_assertion_failed|fts_query_filter_doc_ids|fts_query_read_node|fts_query_index_fetch_nodes
            doc_id == src_node->last_doc_id|SIGABRT|fts_optimize_node|fts_optimize_word|fts_optimize_compact|fts_optimize_words
            doc_id == src_node->last_doc_id|SIGABRT|ut_dbg_assertion_failed|fts_optimize_node|fts_optimize_word|fts_optimize_compact
            val <= 4294967295u|SIGABRT|fts_encode_int|fts_cache_node_add_positions|fts_cache_add_doc|fts_add_doc_by_id
            val <= 4294967295u|SIGABRT|fts_encode_int|fts_cache_node_add_positions|row_fts_insert_tuple|row_fts_merge_insert
            val <= 4294967295u|SIGABRT|ut_dbg_assertion_failed|fts_encode_int|fts_cache_node_add_positions|fts_cache_add_doc
            val <= 4294967295u|SIGABRT|ut_dbg_assertion_failed|fts_encode_int|fts_cache_node_add_positions|row_fts_insert_tuple
            val <= 4294967295u|SIGSEGV|fts_encode_int|fts_cache_node_add_positions|row_fts_insert_tuple|row_fts_merge_insert
            pos == node->first_doc_id|SIGABRT|fts_query_filter_doc_ids|fts_query_read_node|fts_query_index_fetch_nodes|fetch_step
            pos == node->first_doc_id|SIGABRT|ut_dbg_assertion_failed|fts_query_filter_doc_ids|fts_query_read_node|fts_query_index_fetch_nodes
            

            Roel Roel Van de Paar added a comment - - edited All unique ID's seen so far (across various testcases, and versions of MD and MS) SIGABRT|ut_dbg_assertion_failed|fts_encode_int|fts_cache_node_add_positions|fts_cache_add_doc SIGABRT|ut_dbg_assertion_failed|fts_encode_int|fts_cache_node_add_positions|row_fts_insert_tuple SIGABRT|ut_dbg_assertion_failed|fts_optimize_node|fts_optimize_word|fts_optimize_compact SIGABRT|ut_dbg_assertion_failed|fts_query_filter_doc_ids|fts_query_read_node|fts_query_index_fetch_nodes doc_id == src_node->last_doc_id|SIGABRT|fts_optimize_node|fts_optimize_word|fts_optimize_compact|fts_optimize_words doc_id == src_node->last_doc_id|SIGABRT|ut_dbg_assertion_failed|fts_optimize_node|fts_optimize_word|fts_optimize_compact val <= 4294967295u|SIGABRT|fts_encode_int|fts_cache_node_add_positions|fts_cache_add_doc|fts_add_doc_by_id val <= 4294967295u|SIGABRT|fts_encode_int|fts_cache_node_add_positions|row_fts_insert_tuple|row_fts_merge_insert val <= 4294967295u|SIGABRT|ut_dbg_assertion_failed|fts_encode_int|fts_cache_node_add_positions|fts_cache_add_doc val <= 4294967295u|SIGABRT|ut_dbg_assertion_failed|fts_encode_int|fts_cache_node_add_positions|row_fts_insert_tuple val <= 4294967295u|SIGSEGV|fts_encode_int|fts_cache_node_add_positions|row_fts_insert_tuple|row_fts_merge_insert pos == node->first_doc_id|SIGABRT|fts_query_filter_doc_ids|fts_query_read_node|fts_query_index_fetch_nodes|fetch_step pos == node->first_doc_id|SIGABRT|ut_dbg_assertion_failed|fts_query_filter_doc_ids|fts_query_read_node|fts_query_index_fetch_nodes

            Report for Elena's testcase here

            CREATE TABLE t1 (FTS_DOC_ID BIGINT UNSIGNED NOT NULL AUTO_INCREMENT, c TINYTEXT, PRIMARY KEY (FTS_DOC_ID), FULLTEXT KEY (c)) ENGINE=InnoDB;
            INSERT INTO t1 VALUES (1,'txt');
            UPDATE t1 SET FTS_DOC_ID = 197505260223;
            SET @innodb_optimize_fulltext_only.save= @@innodb_optimize_fulltext_only;
            SET GLOBAL innodb_optimize_fulltext_only = 1;
            OPTIMIZE TABLE t1;
            

            Leads to:

            10.6.0 5d4599f9750140f92cfdbbe4d292ae1b8dd456f8 (Debug)

            mysqld: /test/10.6_dbg/storage/innobase/include/fts0vlc.ic:96: ulint fts_encode_int(ulint, byte*): Assertion `val <= 4294967295u' failed.
            

            10.6.0 5d4599f9750140f92cfdbbe4d292ae1b8dd456f8 (Debug)

            Core was generated by `/test/MD211020-mariadb-10.6.0-linux-x86_64-dbg/bin/mysqld --no-defaults --core-'.
            Program terminated with signal SIGABRT, Aborted.
            #0  __pthread_kill (threadid=<optimized out>, signo=signo@entry=6)
                at ../sysdeps/unix/sysv/linux/pthread_kill.c:56
            [Current thread is 1 (Thread 0x14b784087700 (LWP 1907992))]
            (gdb) bt
            #0  __pthread_kill (threadid=<optimized out>, signo=signo@entry=6) at ../sysdeps/unix/sysv/linux/pthread_kill.c:56
            #1  0x000055c318697021 in my_write_core (sig=sig@entry=6) at /test/10.6_dbg/mysys/stacktrace.c:424
            #2  0x000055c317dde321 in handle_fatal_signal (sig=6) at /test/10.6_dbg/sql/signal_handler.cc:330
            #3  <signal handler called>
            #4  __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50
            #5  0x000014b785c65859 in __GI_abort () at abort.c:79
            #6  0x000014b785c65729 in __assert_fail_base (fmt=0x14b785dfb588 "%s%s%s:%u: %s%sAssertion `%s' failed.\n%n", assertion=0x55c318acec3c "val <= 4294967295u", file=0x55c318acdba0 "/test/10.6_dbg/storage/innobase/include/fts0vlc.ic", line=96, function=<optimized out>) at assert.c:92
            #7  0x000014b785c76f36 in __GI___assert_fail (assertion=assertion@entry=0x55c318acec3c "val <= 4294967295u", file=file@entry=0x55c318acdba0 "/test/10.6_dbg/storage/innobase/include/fts0vlc.ic", line=line@entry=96, function=function@entry=0x55c318acdbd8 "ulint fts_encode_int(ulint, byte*)") at assert.c:101
            #8  0x000055c3185b758d in fts_encode_int (buf=0x14b738022d1b "_DOC_ID_INDEX\245\003", val=197505260222) at /test/10.6_dbg/storage/innobase/include/fts0vlc.ic:96
            #9  fts_cache_node_add_positions (cache=cache@entry=0x14b738020548, node=node@entry=0x14b7380210a0, doc_id=doc_id@entry=197505260223, positions=0x14b738089700) at /test/10.6_dbg/storage/innobase/fts/fts0fts.cc:1296
            #10 0x000055c3185b7a46 in fts_cache_add_doc (cache=0x14b738020548, index_cache=0x14b7380209b0, doc_id=doc_id@entry=197505260223, tokens=0x14b738089918) at /test/10.6_dbg/storage/innobase/fts/fts0fts.cc:1392
            #11 0x000055c3185bec16 in fts_add_doc_by_id (ftt=ftt@entry=0x14b73809dd38, doc_id=doc_id@entry=197505260223, fts_indexes=<optimized out>) at /test/10.6_dbg/storage/innobase/fts/fts0fts.cc:3507
            #12 0x000055c3185bfafc in fts_add (ftt=ftt@entry=0x14b73809dd38, row=row@entry=0x14b738071868) at /test/10.6_dbg/storage/innobase/fts/fts0fts.cc:2808
            #13 0x000055c3185bfc81 in fts_commit_table (ftt=0x14b73809dd38) at /test/10.6_dbg/storage/innobase/fts/fts0fts.cc:2980
            #14 fts_commit (trx=trx@entry=0x14b770f743a0) at /test/10.6_dbg/storage/innobase/fts/fts0fts.cc:3029
            #15 0x000055c318441a66 in trx_t::commit_low (this=this@entry=0x14b770f743a0, mtr=0x14b784084d20) at /test/10.6_dbg/storage/innobase/trx/trx0trx.cc:1514
            #16 0x000055c318441e76 in trx_t::commit (this=this@entry=0x14b770f743a0) at /test/10.6_dbg/storage/innobase/trx/trx0trx.cc:1566
            #17 0x000055c3184420c4 in trx_commit_for_mysql (trx=trx@entry=0x14b770f743a0) at /test/10.6_dbg/storage/innobase/trx/trx0trx.cc:1698
            #18 0x000055c3181d2c04 in innobase_commit_low (trx=trx@entry=0x14b770f743a0) at /test/10.6_dbg/storage/innobase/handler/ha_innodb.cc:3762
            #19 0x000055c3181d2c84 in innobase_commit_ordered_2 (trx=trx@entry=0x14b770f743a0, thd=thd@entry=0x14b738000db8) at /test/10.6_dbg/storage/innobase/handler/ha_innodb.cc:3868
            #20 0x000055c3181d2fc9 in innobase_commit (hton=<optimized out>, thd=0x14b738000db8, commit_trx=<optimized out>) at /test/10.6_dbg/storage/innobase/handler/ha_innodb.cc:3972
            #21 0x000055c317de3d1a in commit_one_phase_2 (thd=thd@entry=0x14b738000db8, all=all@entry=false, trans=trans@entry=0x14b738004528, is_real_trans=is_real_trans@entry=true, rw_trans=rw_trans@entry=true) at /test/10.6_dbg/sql/handler.cc:1929
            #22 0x000055c317de4035 in ha_commit_one_phase (thd=thd@entry=0x14b738000db8, all=all@entry=false, rw_trans=rw_trans@entry=true) at /test/10.6_dbg/sql/handler.cc:1881
            #23 0x000055c317df7efe in ha_commit_trans (thd=thd@entry=0x14b738000db8, all=all@entry=false) at /test/10.6_dbg/sql/handler.cc:1686
            #24 0x000055c317c897f2 in trans_commit_stmt (thd=thd@entry=0x14b738000db8) at /test/10.6_dbg/sql/transaction.cc:472
            #25 0x000055c317b21b55 in mysql_execute_command (thd=thd@entry=0x14b738000db8) at /test/10.6_dbg/sql/sql_parse.cc:5864
            #26 0x000055c317b07fd2 in mysql_parse (thd=thd@entry=0x14b738000db8, rawbuf=<optimized out>, length=<optimized out>, parser_state=parser_state@entry=0x14b7840863d0) at /test/10.6_dbg/sql/sql_parse.cc:7833
            #27 0x000055c317b160c7 in dispatch_command (command=command@entry=COM_QUERY, thd=thd@entry=0x14b738000db8, packet=packet@entry=0x14b738008ce9 "UPDATE t1 SET FTS_DOC_ID = 197505260223", packet_length=packet_length@entry=39) at /test/10.6_dbg/sql/sql_class.h:1253
            #28 0x000055c317b193d2 in do_command (thd=0x14b738000db8) at /test/10.6_dbg/sql/sql_parse.cc:1343
            #29 0x000055c317c73994 in do_handle_one_connection (connect=<optimized out>, connect@entry=0x55c31bf800f8, put_in_cache=put_in_cache@entry=true) at /test/10.6_dbg/sql/sql_connect.cc:1410
            #30 0x000055c317c7409b in handle_one_connection (arg=arg@entry=0x55c31bf800f8) at /test/10.6_dbg/sql/sql_connect.cc:1312
            #31 0x000055c318127abb in pfs_spawn_thread (arg=0x55c31bea8418) at /test/10.6_dbg/storage/perfschema/pfs.cc:2201
            #32 0x000014b786173609 in start_thread (arg=<optimized out>) at pthread_create.c:477
            #33 0x000014b785d62293 in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95
            

            Bug confirmed present in:
            MariaDB: 10.1.48 (dbg), 10.1.48 (opt), 10.2.35 (dbg), 10.2.35 (opt), 10.3.26 (dbg), 10.3.26 (opt), 10.4.16 (dbg), 10.4.16 (opt), 10.5.7 (dbg), 10.5.7 (opt), 10.6.0 (dbg), 10.6.0 (opt)
            MySQL: 5.6.50 (dbg), 5.6.50 (opt), 5.7.32 (dbg), 5.7.32 (opt), 8.0.22 (dbg), 8.0.22 (opt)

            Bug confirmed not present in:
            MySQL: 5.5.62 (dbg), 5.5.62 (opt)

            Roel Roel Van de Paar added a comment - Report for Elena's testcase here CREATE TABLE t1 (FTS_DOC_ID BIGINT UNSIGNED NOT NULL AUTO_INCREMENT, c TINYTEXT, PRIMARY KEY (FTS_DOC_ID), FULLTEXT KEY (c)) ENGINE=InnoDB; INSERT INTO t1 VALUES (1,'txt'); UPDATE t1 SET FTS_DOC_ID = 197505260223; SET @innodb_optimize_fulltext_only.save= @@innodb_optimize_fulltext_only; SET GLOBAL innodb_optimize_fulltext_only = 1; OPTIMIZE TABLE t1; Leads to: 10.6.0 5d4599f9750140f92cfdbbe4d292ae1b8dd456f8 (Debug) mysqld: /test/10.6_dbg/storage/innobase/include/fts0vlc.ic:96: ulint fts_encode_int(ulint, byte*): Assertion `val <= 4294967295u' failed. 10.6.0 5d4599f9750140f92cfdbbe4d292ae1b8dd456f8 (Debug) Core was generated by `/test/MD211020-mariadb-10.6.0-linux-x86_64-dbg/bin/mysqld --no-defaults --core-'. Program terminated with signal SIGABRT, Aborted. #0 __pthread_kill (threadid=<optimized out>, signo=signo@entry=6) at ../sysdeps/unix/sysv/linux/pthread_kill.c:56 [Current thread is 1 (Thread 0x14b784087700 (LWP 1907992))] (gdb) bt #0 __pthread_kill (threadid=<optimized out>, signo=signo@entry=6) at ../sysdeps/unix/sysv/linux/pthread_kill.c:56 #1 0x000055c318697021 in my_write_core (sig=sig@entry=6) at /test/10.6_dbg/mysys/stacktrace.c:424 #2 0x000055c317dde321 in handle_fatal_signal (sig=6) at /test/10.6_dbg/sql/signal_handler.cc:330 #3 <signal handler called> #4 __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50 #5 0x000014b785c65859 in __GI_abort () at abort.c:79 #6 0x000014b785c65729 in __assert_fail_base (fmt=0x14b785dfb588 "%s%s%s:%u: %s%sAssertion `%s' failed.\n%n", assertion=0x55c318acec3c "val <= 4294967295u", file=0x55c318acdba0 "/test/10.6_dbg/storage/innobase/include/fts0vlc.ic", line=96, function=<optimized out>) at assert.c:92 #7 0x000014b785c76f36 in __GI___assert_fail (assertion=assertion@entry=0x55c318acec3c "val <= 4294967295u", file=file@entry=0x55c318acdba0 "/test/10.6_dbg/storage/innobase/include/fts0vlc.ic", line=line@entry=96, function=function@entry=0x55c318acdbd8 "ulint fts_encode_int(ulint, byte*)") at assert.c:101 #8 0x000055c3185b758d in fts_encode_int (buf=0x14b738022d1b "_DOC_ID_INDEX\245\003", val=197505260222) at /test/10.6_dbg/storage/innobase/include/fts0vlc.ic:96 #9 fts_cache_node_add_positions (cache=cache@entry=0x14b738020548, node=node@entry=0x14b7380210a0, doc_id=doc_id@entry=197505260223, positions=0x14b738089700) at /test/10.6_dbg/storage/innobase/fts/fts0fts.cc:1296 #10 0x000055c3185b7a46 in fts_cache_add_doc (cache=0x14b738020548, index_cache=0x14b7380209b0, doc_id=doc_id@entry=197505260223, tokens=0x14b738089918) at /test/10.6_dbg/storage/innobase/fts/fts0fts.cc:1392 #11 0x000055c3185bec16 in fts_add_doc_by_id (ftt=ftt@entry=0x14b73809dd38, doc_id=doc_id@entry=197505260223, fts_indexes=<optimized out>) at /test/10.6_dbg/storage/innobase/fts/fts0fts.cc:3507 #12 0x000055c3185bfafc in fts_add (ftt=ftt@entry=0x14b73809dd38, row=row@entry=0x14b738071868) at /test/10.6_dbg/storage/innobase/fts/fts0fts.cc:2808 #13 0x000055c3185bfc81 in fts_commit_table (ftt=0x14b73809dd38) at /test/10.6_dbg/storage/innobase/fts/fts0fts.cc:2980 #14 fts_commit (trx=trx@entry=0x14b770f743a0) at /test/10.6_dbg/storage/innobase/fts/fts0fts.cc:3029 #15 0x000055c318441a66 in trx_t::commit_low (this=this@entry=0x14b770f743a0, mtr=0x14b784084d20) at /test/10.6_dbg/storage/innobase/trx/trx0trx.cc:1514 #16 0x000055c318441e76 in trx_t::commit (this=this@entry=0x14b770f743a0) at /test/10.6_dbg/storage/innobase/trx/trx0trx.cc:1566 #17 0x000055c3184420c4 in trx_commit_for_mysql (trx=trx@entry=0x14b770f743a0) at /test/10.6_dbg/storage/innobase/trx/trx0trx.cc:1698 #18 0x000055c3181d2c04 in innobase_commit_low (trx=trx@entry=0x14b770f743a0) at /test/10.6_dbg/storage/innobase/handler/ha_innodb.cc:3762 #19 0x000055c3181d2c84 in innobase_commit_ordered_2 (trx=trx@entry=0x14b770f743a0, thd=thd@entry=0x14b738000db8) at /test/10.6_dbg/storage/innobase/handler/ha_innodb.cc:3868 #20 0x000055c3181d2fc9 in innobase_commit (hton=<optimized out>, thd=0x14b738000db8, commit_trx=<optimized out>) at /test/10.6_dbg/storage/innobase/handler/ha_innodb.cc:3972 #21 0x000055c317de3d1a in commit_one_phase_2 (thd=thd@entry=0x14b738000db8, all=all@entry=false, trans=trans@entry=0x14b738004528, is_real_trans=is_real_trans@entry=true, rw_trans=rw_trans@entry=true) at /test/10.6_dbg/sql/handler.cc:1929 #22 0x000055c317de4035 in ha_commit_one_phase (thd=thd@entry=0x14b738000db8, all=all@entry=false, rw_trans=rw_trans@entry=true) at /test/10.6_dbg/sql/handler.cc:1881 #23 0x000055c317df7efe in ha_commit_trans (thd=thd@entry=0x14b738000db8, all=all@entry=false) at /test/10.6_dbg/sql/handler.cc:1686 #24 0x000055c317c897f2 in trans_commit_stmt (thd=thd@entry=0x14b738000db8) at /test/10.6_dbg/sql/transaction.cc:472 #25 0x000055c317b21b55 in mysql_execute_command (thd=thd@entry=0x14b738000db8) at /test/10.6_dbg/sql/sql_parse.cc:5864 #26 0x000055c317b07fd2 in mysql_parse (thd=thd@entry=0x14b738000db8, rawbuf=<optimized out>, length=<optimized out>, parser_state=parser_state@entry=0x14b7840863d0) at /test/10.6_dbg/sql/sql_parse.cc:7833 #27 0x000055c317b160c7 in dispatch_command (command=command@entry=COM_QUERY, thd=thd@entry=0x14b738000db8, packet=packet@entry=0x14b738008ce9 "UPDATE t1 SET FTS_DOC_ID = 197505260223", packet_length=packet_length@entry=39) at /test/10.6_dbg/sql/sql_class.h:1253 #28 0x000055c317b193d2 in do_command (thd=0x14b738000db8) at /test/10.6_dbg/sql/sql_parse.cc:1343 #29 0x000055c317c73994 in do_handle_one_connection (connect=<optimized out>, connect@entry=0x55c31bf800f8, put_in_cache=put_in_cache@entry=true) at /test/10.6_dbg/sql/sql_connect.cc:1410 #30 0x000055c317c7409b in handle_one_connection (arg=arg@entry=0x55c31bf800f8) at /test/10.6_dbg/sql/sql_connect.cc:1312 #31 0x000055c318127abb in pfs_spawn_thread (arg=0x55c31bea8418) at /test/10.6_dbg/storage/perfschema/pfs.cc:2201 #32 0x000014b786173609 in start_thread (arg=<optimized out>) at pthread_create.c:477 #33 0x000014b785d62293 in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95 Bug confirmed present in: MariaDB: 10.1.48 (dbg), 10.1.48 (opt), 10.2.35 (dbg), 10.2.35 (opt), 10.3.26 (dbg), 10.3.26 (opt), 10.4.16 (dbg), 10.4.16 (opt), 10.5.7 (dbg), 10.5.7 (opt), 10.6.0 (dbg), 10.6.0 (opt) MySQL: 5.6.50 (dbg), 5.6.50 (opt), 5.7.32 (dbg), 5.7.32 (opt), 8.0.22 (dbg), 8.0.22 (opt) Bug confirmed not present in: MySQL: 5.5.62 (dbg), 5.5.62 (opt)
            Roel Roel Van de Paar made changes -
            Labels upstream affects-tests upstream
            Roel Roel Van de Paar added a comment - - edited

            Two more stack traces with this testcase:

            SET SESSION insert_id = 100000000000;
            CREATE TABLE articles (FTS_DOC_ID BIGINT UNSIGNED AUTO_INCREMENT NOT NULL PRIMARY KEY, title VARCHAR(200), body TEXT) ENGINE=InnoDB;
            INSERT INTO articles (title,body) VALUES ('MySQL TutORial','DBMS stANDs FOR DATABASE ...'), ('How TO USE MySQL Well','AFTER you went through a ...'), ('Optimizing MySQL','In this tutORial we will SHOW ...'), ('1001 MySQL Tricks','1. Never run mysqld AS root. 2. ...'), ('MySQL vs. YourSQL','In the following DATABASE comparison ...'), (' (that''s me)','WHEN configured properly, MySQL ...');
            CREATE FULLTEXT INDEX idx ON articles (title, body);
            SELECT * FROM articles WHERE MATCH (title,body) AGAINST ('+mySQL -yourSQL' IN BOOLEAN MODE);
            

            10.6.0 c3d4e5718262c0e385f641fbed055b00397fcbf6 (Optimized)

            InnoDB: Failing assertion: pos == node->first_doc_id
            

            10.6.0 c3d4e5718262c0e385f641fbed055b00397fcbf6 (Optimized)

            Core was generated by `/test/MD201120-mariadb-10.6.0-linux-x86_64-opt/bin/mysqld --no-defaults --core-'.
            Program terminated with signal SIGABRT, Aborted.
            #0  __pthread_kill (threadid=<optimized out>, signo=signo@entry=6)
                at ../sysdeps/unix/sysv/linux/pthread_kill.c:56
            [Current thread is 1 (Thread 0x14fe6010c700 (LWP 2508422))]
            (gdb) bt
            #0  __pthread_kill (threadid=<optimized out>, signo=signo@entry=6) at ../sysdeps/unix/sysv/linux/pthread_kill.c:56
            #1  0x00005613c5745c5f in my_write_core (sig=sig@entry=6) at /test/10.6_opt/mysys/stacktrace.c:424
            #2  0x00005613c5176550 in handle_fatal_signal (sig=6) at /test/10.6_opt/sql/signal_handler.cc:330
            #3  <signal handler called>
            #4  __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50
            #5  0x000014fe77dcd859 in __GI_abort () at abort.c:79
            #6  0x00005613c4e3ae72 in ut_dbg_assertion_failed (expr=expr@entry=0x5613c5a7666b "pos == node->first_doc_id", file=file@entry=0x5613c5a762e0 "/test/10.6_opt/storage/innobase/fts/fts0que.cc", line=line@entry=3243) at /test/10.6_opt/storage/innobase/ut/ut0dbg.cc:60
            #7  0x00005613c4e571e6 in fts_query_filter_doc_ids (query=0x14fe601080c0, word=0x14fe2405f2d8, data=0x14fe24064af8, len=22, calc_doc_count=0, node=<optimized out>, node=<optimized out>, word_freq=<optimized out>, word_freq=<optimized out>) at /test/10.6_opt/storage/innobase/fts/fts0que.cc:3243
            #8  0x00005613c56a3979 in fts_query_read_node (query=0x14fe601080c0, exp=0x14fe24d6d980, word=<optimized out>, word=<optimized out>) at /test/10.6_opt/storage/innobase/fts/fts0que.cc:3427
            #9  0x00005613c56a3a44 in fts_query_index_fetch_nodes (row=<optimized out>, user_arg=<optimized out>) at /test/10.6_opt/storage/innobase/include/que0que.ic:209
            #10 0x00005613c557a15e in fetch_step (thr=thr@entry=0x14fe24d6ee10) at /test/10.6_opt/storage/innobase/row/row0sel.cc:2343
            #11 0x00005613c55331a8 in que_thr_step (thr=<optimized out>) at /test/10.6_opt/storage/innobase/que/que0que.cc:931
            #12 que_run_threads_low (thr=<optimized out>) at /test/10.6_opt/storage/innobase/que/que0que.cc:1009
            #13 que_run_threads (thr=<optimized out>) at /test/10.6_opt/storage/innobase/que/que0que.cc:1049
            #14 0x00005613c56a9f55 in fts_eval_sql (trx=trx@entry=0x14fe75505228, graph=<optimized out>) at /test/10.6_opt/storage/innobase/fts/fts0sql.cc:213
            #15 0x00005613c569c72f in fts_index_fetch_nodes (trx=trx@entry=0x14fe75505228, graph=graph@entry=0x14fe60107b50, fts_table=fts_table@entry=0x14fe60108108, word=word@entry=0x14fe60107b70, fetch=fetch@entry=0x14fe60107bd0) at /test/10.6_opt/storage/innobase/fts/fts0opt.cc:532
            #16 0x00005613c56a7707 in fts_query_intersect (token=0x14fe60107b70, query=0x14fe601080c0) at /test/10.6_opt/storage/innobase/fts/fts0que.cc:1311
            #17 fts_query_execute (token=0x14fe60107b70, query=0x14fe601080c0) at /test/10.6_opt/storage/innobase/fts/fts0que.cc:2918
            #18 fts_query_visitor (oper=<optimized out>, node=<optimized out>, arg=0x14fe601080c0) at /test/10.6_opt/storage/innobase/fts/fts0que.cc:3046
            #19 0x00005613c56d0703 in fts_ast_visit (oper=FTS_EXIST_SKIP, node=0x14fe24021578, visitor=0x5613c56a6ab0 <fts_query_visitor(fts_ast_oper_t, fts_ast_node_t*, void*)>, arg=<optimized out>, has_ignore=0x14fe60107f7f) at /test/10.6_opt/storage/innobase/fts/fts0ast.cc:693
            #20 0x00005613c56d0792 in fts_ast_visit (oper=<optimized out>, oper@entry=FTS_NONE, node=0x14fe24064248, visitor=visitor@entry=0x5613c56a6ab0 <fts_query_visitor(fts_ast_oper_t, fts_ast_node_t*, void*)>, arg=arg@entry=0x14fe601080c0, has_ignore=has_ignore@entry=0x14fe6010802f) at /test/10.6_opt/storage/innobase/fts/fts0ast.cc:718
            #21 0x00005613c56a4c6e in fts_query (trx=trx@entry=0x14fe75504180, index=index@entry=0x14fe2404ed20, flags=flags@entry=3, query_str=query_str@entry=0x14fe24064698 "+mySQL -yourSQL", query_len=<optimized out>, result=result@entry=0x14fe601083f8) at /test/10.6_opt/storage/innobase/fts/fts0que.cc:4072
            #22 0x00005613c5497798 in ha_innobase::ft_init_ext (this=0x14fe24020a20, flags=3, keynr=<optimized out>, key=<optimized out>) at /test/10.6_opt/storage/innobase/handler/ha_innodb.cc:9161
            #23 0x00005613c51eb063 in Item_func_match::init_search (this=0x14fe24011540, thd=thd@entry=0x14fe24000c58, no_order=no_order@entry=false) at /test/10.6_opt/sql/sql_string.h:630
            #24 0x00005613c4f05ae5 in init_ftfuncs (thd=0x14fe24000c58, select_lex=<optimized out>, no_order=false) at /test/10.6_opt/sql/sql_base.cc:8938
            #25 0x00005613c4fcc8b9 in JOIN::optimize_stage2 (this=<optimized out>) at /test/10.6_opt/sql/sql_select.cc:2797
            #26 0x00005613c4fcf99a in JOIN::optimize_inner (this=0x14fe24012058) at /test/10.6_opt/sql/sql_select.cc:2277
            #27 0x00005613c4fd1a83 in JOIN::optimize (this=this@entry=0x14fe24012058) at /test/10.6_opt/sql/sql_select.cc:1627
            #28 0x00005613c4fd1b47 in mysql_select (thd=0x14fe24000c58, tables=0x14fe24010ad0, fields=<optimized out>, conds=0x14fe24011540, og_num=0, order=0x0, group=0x0, having=0x0, proc_param=0x0, select_options=2147748608, result=0x14fe24012030, unit=0x14fe24004c28, select_lex=0x14fe240104d0) at /test/10.6_opt/sql/sql_select.cc:4651
            #29 0x00005613c4fd2567 in handle_select (thd=thd@entry=0x14fe24000c58, lex=lex@entry=0x14fe24004b60, result=result@entry=0x14fe24012030, setup_tables_done_option=setup_tables_done_option@entry=0) at /test/10.6_opt/sql/sql_select.cc:417
            #30 0x00005613c4f61551 in execute_sqlcom_select (thd=0x14fe24000c58, all_tables=0x14fe24010ad0) at /test/10.6_opt/sql/sql_parse.cc:6118
            #31 0x00005613c4f6f243 in mysql_execute_command (thd=0x14fe24000c58) at /test/10.6_opt/sql/sql_parse.cc:3820
            #32 0x00005613c4f5beff in mysql_parse (thd=0x14fe24000c58, rawbuf=<optimized out>, length=<optimized out>, parser_state=<optimized out>) at /test/10.6_opt/sql/sql_parse.cc:7883
            #33 0x00005613c4f67857 in dispatch_command (command=COM_QUERY, thd=0x14fe24000c58, packet=0x14fe24008019 "SELECT * FROM articles WHERE MATCH (title,body) AGAINST ('+mySQL -yourSQL' IN BOOLEAN MODE)", packet_length=<optimized out>) at /test/10.6_opt/sql/sql_class.h:1254
            #34 0x00005613c4f69c32 in do_command (thd=0x14fe24000c58) at /test/10.6_opt/sql/sql_parse.cc:1348
            #35 0x00005613c506e801 in do_handle_one_connection (connect=<optimized out>, connect@entry=0x5613c80944c8, put_in_cache=put_in_cache@entry=true) at /test/10.6_opt/sql/sql_connect.cc:1410
            #36 0x00005613c506ec7d in handle_one_connection (arg=arg@entry=0x5613c80944c8) at /test/10.6_opt/sql/sql_connect.cc:1312
            #37 0x00005613c53f4726 in pfs_spawn_thread (arg=0x5613c8010438) at /test/10.6_opt/storage/perfschema/pfs.cc:2201
            #38 0x000014fe782db609 in start_thread (arg=<optimized out>) at pthread_create.c:477
            #39 0x000014fe77eca293 in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95
            

            10.1.48 (Optimized)

            InnoDB: Failing assertion: pos == node->first_doc_id
            

            10.1.48 (Optimized)

            Core was generated by `/test/MD201020-mariadb-10.1.48-linux-x86_64-opt/bin/mysqld --no-defaults --core'.
            Program terminated with signal SIGABRT, Aborted.
            #0  __pthread_kill (threadid=<optimized out>, signo=signo@entry=6)
                at ../sysdeps/unix/sysv/linux/pthread_kill.c:56
            [Current thread is 1 (Thread 0x14ada31fb700 (LWP 2586288))]
            (gdb) bt
            #0  __pthread_kill (threadid=<optimized out>, signo=signo@entry=6) at ../sysdeps/unix/sysv/linux/pthread_kill.c:56
            #1  0x000055bf20d3498f in my_write_core (sig=sig@entry=6) at /test/10.1_opt/mysys/stacktrace.c:387
            #2  0x000055bf2088d904 in handle_fatal_signal (sig=6) at /test/10.1_opt/sql/signal_handler.cc:296
            #3  <signal handler called>
            #4  __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50
            #5  0x000014adc8484859 in __GI_abort () at abort.c:79
            #6  0x000055bf20ce761d in fts_query_filter_doc_ids (calc_doc_count=0, word_freq=0x14ad7c0100f0, word_freq=0x14ad7c0100f0, node=0x14ada31f5b50, node=0x14ada31f5b50, len=22, data=0x14ad7c033f68, word=0x14ad7c0100f0, query=0x14ada31f6470) at /test/10.1_opt/storage/xtradb/fts/fts0que.cc:3107
            #7  fts_query_read_node (query=query@entry=0x14ada31f6470, exp=0x14ad7c03f988, word=<optimized out>, word=<optimized out>) at /test/10.1_opt/storage/xtradb/fts/fts0que.cc:3289
            #8  0x000055bf20ce76f0 in fts_query_index_fetch_nodes (row=<optimized out>, user_arg=<optimized out>) at /test/10.1_opt/storage/xtradb/include/que0que.ic:226
            #9  0x000055bf20bc9236 in fetch_step (thr=thr@entry=0x14ad7c040de0) at /test/10.1_opt/storage/xtradb/row/row0sel.cc:2171
            #10 0x000055bf20b8a668 in que_thr_step (thr=0x14ad7c040de0) at /test/10.1_opt/storage/xtradb/que/que0que.cc:1069
            #11 que_run_threads_low (thr=0x14ad7c040de0) at /test/10.1_opt/storage/xtradb/que/que0que.cc:1147
            #12 que_run_threads (thr=0x14ad7c040de0) at /test/10.1_opt/storage/xtradb/que/que0que.cc:1188
            #13 0x000055bf20ceabe1 in fts_eval_sql (trx=trx@entry=0x14ad7c034798, graph=<optimized out>) at /test/10.1_opt/storage/xtradb/fts/fts0sql.cc:232
            #14 0x000055bf20cdee3d in fts_index_fetch_nodes (trx=trx@entry=0x14ad7c034798, graph=graph@entry=0x14ada31f61e0, fts_table=fts_table@entry=0x14ada31f64b8, word=word@entry=0x14ada31f61c0, fetch=fetch@entry=0x14ada31f6200) at /test/10.1_opt/storage/xtradb/fts/fts0opt.cc:534
            #15 0x000055bf20ce92f6 in fts_query_intersect (token=0x14ada31f61c0, query=0x14ada31f6470) at /test/10.1_opt/storage/xtradb/fts/fts0que.cc:1336
            #16 fts_query_execute (token=0x14ada31f61c0, query=0x14ada31f6470) at /test/10.1_opt/storage/xtradb/fts/fts0que.cc:2808
            #17 fts_query_visitor (oper=<optimized out>, node=<optimized out>, arg=0x14ada31f6470) at /test/10.1_opt/storage/xtradb/fts/fts0que.cc:2921
            #18 0x000055bf20cf729c in fts_ast_visit (oper=oper@entry=FTS_EXIST_SKIP, node=0x14ad7c0117f0, node@entry=0x14ad7c012de0, visitor=visitor@entry=0x55bf20ce81d0 <fts_query_visitor(fts_ast_oper_t, fts_ast_node_t*, void*)>, arg=arg@entry=0x14ada31f6470, has_ignore=has_ignore@entry=0x14ada31f633f) at /test/10.1_opt/storage/xtradb/fts/fts0ast.cc:589
            #19 0x000055bf20cf7472 in fts_ast_visit (oper=<optimized out>, oper@entry=FTS_NONE, node=0x14ad7c012de0, visitor=visitor@entry=0x55bf20ce81d0 <fts_query_visitor(fts_ast_oper_t, fts_ast_node_t*, void*)>, arg=arg@entry=0x14ada31f6470, has_ignore=has_ignore@entry=0x14ada31f63ef) at /test/10.1_opt/storage/xtradb/fts/fts0ast.cc:614
            #20 0x000055bf20ce61b4 in fts_query (trx=trx@entry=0x14ad7c002468, index=index@entry=0x14ad7c01c388, flags=flags@entry=3, query_str=query_str@entry=0x14ad7c012fe8 "+mySQL -yourSQL", query_len=<optimized out>, result=result@entry=0x14ada31f65f8) at /test/10.1_opt/storage/xtradb/fts/fts0que.cc:4015
            #21 0x000055bf20afc62a in ha_innobase::ft_init_ext (this=0x14ad7c01a1e0, flags=3, keynr=<optimized out>, key=<optimized out>) at /test/10.1_opt/storage/xtradb/handler/ha_innodb.cc:10624
            #22 0x000055bf208f6384 in Item_func_match::init_search (this=0x14ad7c009aa0, thd=thd@entry=0x55bf23a30018, no_order=no_order@entry=false) at /test/10.1_opt/sql/sql_string.h:315
            #23 0x000055bf206bd9d1 in init_ftfuncs (thd=0x55bf23a30018, select_lex=<optimized out>, no_order=false) at /test/10.1_opt/sql/sql_base.cc:9286
            #24 0x000055bf207570bd in JOIN::optimize_inner (this=<optimized out>) at /test/10.1_opt/sql/sql_select.cc:1850
            #25 JOIN::optimize_inner (this=<optimized out>) at /test/10.1_opt/sql/sql_select.cc:1090
            #26 0x000055bf207582da in JOIN::optimize (this=0x14ad7c009d08) at /test/10.1_opt/sql/sql_select.cc:1063
            #27 JOIN::optimize (this=0x14ad7c009d08) at /test/10.1_opt/sql/sql_select.cc:1055
            #28 0x000055bf20758a62 in mysql_select (thd=thd@entry=0x55bf23a30018, rref_pointer_array=rref_pointer_array@entry=0x55bf23a34350, tables=0x14ad7c0091a0, wild_num=<optimized out>, fields=@0x55bf23a341c0: {<base_list> = {<Sql_alloc> = {<No data fields>}, first = 0x14ad7c009148, last = 0x14ad7c00a600, elements = 3}, <No data fields>}, conds=<optimized out>, og_num=0, order=0x0, group=0x0, having=0x0, proc_param=0x0, select_options=2147748608, result=0x14ad7c009ce8, unit=0x55bf23a339a0, select_lex=0x55bf23a340a8) at /test/10.1_opt/sql/sql_select.cc:3490
            #29 0x000055bf20758dc4 in handle_select (thd=thd@entry=0x55bf23a30018, lex=lex@entry=0x55bf23a338e0, result=result@entry=0x14ad7c009ce8, setup_tables_done_option=setup_tables_done_option@entry=0) at /test/10.1_opt/sql/sql_select.cc:377
            #30 0x000055bf206f4851 in execute_sqlcom_select (thd=thd@entry=0x55bf23a30018, all_tables=0x14ad7c0091a0) at /test/10.1_opt/sql/sql_parse.cc:5682
            #31 0x000055bf20701786 in mysql_execute_command (thd=0x55bf23a30018) at /test/10.1_opt/sql/sql_parse.cc:3029
            #32 0x000055bf20704757 in mysql_parse (thd=0x55bf23a30018, rawbuf=<optimized out>, length=<optimized out>, parser_state=<optimized out>) at /test/10.1_opt/sql/sql_parse.cc:7200
            #33 0x000055bf207075c1 in dispatch_command (command=command@entry=COM_QUERY, thd=thd@entry=0x55bf23a30018, packet=packet@entry=0x55bf23a35339 "SELECT * FROM articles WHERE MATCH (title,body) AGAINST ('+mySQL -yourSQL' IN BOOLEAN MODE)", packet_length=packet_length@entry=91) at /test/10.1_opt/sql/sql_class.h:1064
            #34 0x000055bf2070859e in do_command (thd=0x55bf23a30018) at /test/10.1_opt/sql/sql_parse.cc:1123
            #35 0x000055bf207da2de in do_handle_one_connection (thd_arg=thd_arg@entry=0x55bf23a30018) at /test/10.1_opt/sql/sql_connect.cc:1331
            #36 0x000055bf207da412 in handle_one_connection (arg=0x55bf23a30018) at /test/10.1_opt/sql/sql_connect.cc:1242
            #37 0x000014adc8a3b609 in start_thread (arg=<optimized out>) at pthread_create.c:477
            #38 0x000014adc8581293 in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95
            

            MS 5.6.50 (Optimized)

            InnoDB: Failing assertion: pos == node->first_doc_id
            

            MS 5.6.50 (Optimized)

            Core was generated by `/test/MS241020-mysql-5.6.50-linux-x86_64-opt/bin/mysqld --no-defaults --core --'.
            Program terminated with signal SIGABRT, Aborted.
            #0  __pthread_kill (threadid=<optimized out>, signo=signo@entry=6)
                at ../sysdeps/unix/sysv/linux/pthread_kill.c:56
            [Current thread is 1 (Thread 0x15171e0a4700 (LWP 2580700))]
            (gdb) bt
            #0  __pthread_kill (threadid=<optimized out>, signo=signo@entry=6) at ../sysdeps/unix/sysv/linux/pthread_kill.c:56
            #1  0x000055a8fe4f3c6f in my_write_core (sig=sig@entry=6) at /test/5.6_opt/mysys/stacktrace.c:436
            #2  0x000055a8fe280cfb in handle_fatal_signal (sig=6) at /test/5.6_opt/sql/signal_handler.cc:237
            #3  <signal handler called>
            #4  __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50
            #5  0x0000151744596859 in __GI_abort () at abort.c:79
            #6  0x000055a8fe1a423a in fts_query_filter_doc_ids (query=0x15171e0a00c0, word=0x1516f8021f90, data=0x1516f8022088, len=22, calc_doc_count=0, node=<optimized out>, node=<optimized out>, word_freq=<optimized out>, word_freq=<optimized out>) at /test/5.6_opt/storage/innobase/fts/fts0que.cc:3093
            #7  0x000055a8fe6a4859 in fts_query_read_node (query=0x15171e0a00c0, exp=0x1516f8042030, word=<optimized out>, word=<optimized out>) at /test/5.6_opt/storage/innobase/fts/fts0que.cc:3275
            #8  0x000055a8fe6a4933 in fts_query_index_fetch_nodes (row=<optimized out>, user_arg=<optimized out>) at /test/5.6_opt/storage/innobase/include/que0que.ic:234
            #9  0x000055a8fe5c8d76 in fetch_step (thr=thr@entry=0x1516f8043488) at /test/5.6_opt/storage/innobase/row/row0sel.cc:2175
            #10 0x000055a8fe5967b8 in que_thr_step (thr=0x1516f8043488) at /test/5.6_opt/storage/innobase/que/que0que.cc:1071
            #11 que_run_threads_low (thr=0x1516f8043488) at /test/5.6_opt/storage/innobase/que/que0que.cc:1149
            #12 que_run_threads (thr=0x1516f8043488) at /test/5.6_opt/storage/innobase/que/que0que.cc:1190
            #13 0x000055a8fe6a9195 in fts_eval_sql (trx=trx@entry=0x1516f8033458, graph=<optimized out>) at /test/5.6_opt/storage/innobase/fts/fts0sql.cc:294
            #14 0x000055a8fe6a1ac6 in fts_index_fetch_nodes (trx=trx@entry=0x1516f8033458, graph=graph@entry=0x15171e09fe20, fts_table=fts_table@entry=0x15171e0a0110, word=word@entry=0x15171e09fe00, fetch=fetch@entry=0x15171e09fe40) at /test/5.6_opt/storage/innobase/fts/fts0opt.cc:550
            #15 0x000055a8fe6a790f in fts_query_intersect (token=0x15171e09fe00, query=0x15171e0a00c0) at /test/5.6_opt/storage/innobase/fts/fts0que.cc:1332
            #16 fts_query_execute (token=0x15171e09fe00, query=0x15171e0a00c0) at /test/5.6_opt/storage/innobase/fts/fts0que.cc:2783
            #17 fts_query_visitor (oper=<optimized out>, node=<optimized out>, arg=0x15171e0a00c0) at /test/5.6_opt/storage/innobase/fts/fts0que.cc:2896
            #18 0x000055a8fe6b3d02 in fts_ast_visit (oper=FTS_EXIST_SKIP, node=0x1516f8020560, visitor=0x55a8fe6a6e40 <fts_query_visitor(fts_ast_oper_t, fts_ast_node_t*, void*)>, arg=<optimized out>, has_ignore=0x15171e09ff87) at /test/5.6_opt/storage/innobase/fts/fts0ast.cc:594
            #19 0x000055a8fe6b3d72 in fts_ast_visit (oper=<optimized out>, oper@entry=FTS_NONE, node=0x1516f80372b0, visitor=visitor@entry=0x55a8fe6a6e40 <fts_query_visitor(fts_ast_oper_t, fts_ast_node_t*, void*)>, arg=arg@entry=0x15171e0a00c0, has_ignore=has_ignore@entry=0x15171e0a003f) at /test/5.6_opt/storage/innobase/fts/fts0ast.cc:615
            #20 0x000055a8fe6a5914 in fts_query (trx=trx@entry=0x1516f8010988, index=index@entry=0x1516f8022b08, flags=flags@entry=3, query_str=query_str@entry=0x1516f803a0b0 "+mySQL -yourSQL", query_len=<optimized out>, result=result@entry=0x15171e0a0278) at /test/5.6_opt/storage/innobase/fts/fts0que.cc:4004
            #21 0x000055a8fe52b1f1 in ha_innobase::ft_init_ext (this=0x1516f8020670, flags=3, keynr=<optimized out>, key=<optimized out>) at /test/5.6_opt/storage/innobase/handler/ha_innodb.cc:8337
            #22 0x000055a8fe2284d4 in Item_func_match::init_search (this=0x1516f80019a0, thd=thd@entry=0x55a8ff4af4a0, no_order=no_order@entry=false) at /test/5.6_opt/sql/sql_string.h:272
            #23 0x000055a8fe2b9c73 in init_ftfuncs (thd=0x55a8ff4af4a0, select_lex=<optimized out>, no_order=false) at /test/5.6_opt/sql/sql_base.cc:9452
            #24 0x000055a8fe4563b0 in JOIN::optimize (this=this@entry=0x1516f8001bd8) at /test/5.6_opt/sql/sql_optimizer.h:302
            #25 0x000055a8fe322caf in mysql_execute_select (free_join=true, select_lex=0x55a8ff4b1958, thd=0x55a8ff4af4a0) at /test/5.6_opt/sql/sql_select.cc:1094
            #26 mysql_select (thd=0x55a8ff4af4a0, tables=<optimized out>, wild_num=1, fields=<optimized out>, conds=0x1516f80019a0, order=<optimized out>, group=<optimized out>, having=0x0, select_options=2147748608, result=0x1516f8001bb0, unit=0x55a8ff4b1310, select_lex=0x55a8ff4b1958) at /test/5.6_opt/sql/sql_select.cc:1229
            #27 0x000055a8fe32360e in handle_select (thd=thd@entry=0x55a8ff4af4a0, result=result@entry=0x1516f8001bb0, setup_tables_done_option=setup_tables_done_option@entry=0) at /test/5.6_opt/sql/sql_select.cc:108
            #28 0x000055a8fe2f739d in execute_sqlcom_select (thd=0x55a8ff4af4a0, all_tables=0x1516f8001100) at /test/5.6_opt/sql/sql_parse.cc:5162
            #29 0x000055a8fe3013c4 in mysql_execute_command (thd=0x55a8ff4af4a0) at /test/5.6_opt/sql/sql_parse.cc:2717
            #30 0x000055a8fe303678 in mysql_parse (thd=thd@entry=0x55a8ff4af4a0, rawbuf=<optimized out>, length=<optimized out>, parser_state=parser_state@entry=0x15171e0a3670) at /test/5.6_opt/sql/sql_parse.cc:6538
            #31 0x000055a8fe3059ef in dispatch_command (command=<optimized out>, thd=0x55a8ff4af4a0, packet=0x55a8ff593eb1 "SELECT * FROM articles WHERE MATCH (title,body) AGAINST ('+mySQL -yourSQL' IN BOOLEAN MODE)", packet_length=91) at /test/5.6_opt/sql/sql_class.h:888
            #32 0x000055a8fe2d13f2 in do_handle_one_connection (thd_arg=thd_arg@entry=0x55a8ff4af4a0) at /test/5.6_opt/sql/sql_connect.cc:989
            #33 0x000055a8fe2d14b2 in handle_one_connection (arg=arg@entry=0x55a8ff4af4a0) at /test/5.6_opt/sql/sql_connect.cc:906
            #34 0x000055a8fe729719 in pfs_spawn_thread (arg=0x55a8ff4a0990) at /test/5.6_opt/storage/perfschema/pfs.cc:1868
            #35 0x0000151744ab7609 in start_thread (arg=<optimized out>) at pthread_create.c:477
            #36 0x0000151744693293 in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95
            

            Roel Roel Van de Paar added a comment - - edited Two more stack traces with this testcase: SET SESSION insert_id = 100000000000; CREATE TABLE articles (FTS_DOC_ID BIGINT UNSIGNED AUTO_INCREMENT NOT NULL PRIMARY KEY, title VARCHAR(200), body TEXT) ENGINE=InnoDB; INSERT INTO articles (title,body) VALUES ('MySQL TutORial','DBMS stANDs FOR DATABASE ...'), ('How TO USE MySQL Well','AFTER you went through a ...'), ('Optimizing MySQL','In this tutORial we will SHOW ...'), ('1001 MySQL Tricks','1. Never run mysqld AS root. 2. ...'), ('MySQL vs. YourSQL','In the following DATABASE comparison ...'), (' (that''s me)','WHEN configured properly, MySQL ...'); CREATE FULLTEXT INDEX idx ON articles (title, body); SELECT * FROM articles WHERE MATCH (title,body) AGAINST ('+mySQL -yourSQL' IN BOOLEAN MODE); 10.6.0 c3d4e5718262c0e385f641fbed055b00397fcbf6 (Optimized) InnoDB: Failing assertion: pos == node->first_doc_id 10.6.0 c3d4e5718262c0e385f641fbed055b00397fcbf6 (Optimized) Core was generated by `/test/MD201120-mariadb-10.6.0-linux-x86_64-opt/bin/mysqld --no-defaults --core-'. Program terminated with signal SIGABRT, Aborted. #0 __pthread_kill (threadid=<optimized out>, signo=signo@entry=6) at ../sysdeps/unix/sysv/linux/pthread_kill.c:56 [Current thread is 1 (Thread 0x14fe6010c700 (LWP 2508422))] (gdb) bt #0 __pthread_kill (threadid=<optimized out>, signo=signo@entry=6) at ../sysdeps/unix/sysv/linux/pthread_kill.c:56 #1 0x00005613c5745c5f in my_write_core (sig=sig@entry=6) at /test/10.6_opt/mysys/stacktrace.c:424 #2 0x00005613c5176550 in handle_fatal_signal (sig=6) at /test/10.6_opt/sql/signal_handler.cc:330 #3 <signal handler called> #4 __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50 #5 0x000014fe77dcd859 in __GI_abort () at abort.c:79 #6 0x00005613c4e3ae72 in ut_dbg_assertion_failed (expr=expr@entry=0x5613c5a7666b "pos == node->first_doc_id", file=file@entry=0x5613c5a762e0 "/test/10.6_opt/storage/innobase/fts/fts0que.cc", line=line@entry=3243) at /test/10.6_opt/storage/innobase/ut/ut0dbg.cc:60 #7 0x00005613c4e571e6 in fts_query_filter_doc_ids (query=0x14fe601080c0, word=0x14fe2405f2d8, data=0x14fe24064af8, len=22, calc_doc_count=0, node=<optimized out>, node=<optimized out>, word_freq=<optimized out>, word_freq=<optimized out>) at /test/10.6_opt/storage/innobase/fts/fts0que.cc:3243 #8 0x00005613c56a3979 in fts_query_read_node (query=0x14fe601080c0, exp=0x14fe24d6d980, word=<optimized out>, word=<optimized out>) at /test/10.6_opt/storage/innobase/fts/fts0que.cc:3427 #9 0x00005613c56a3a44 in fts_query_index_fetch_nodes (row=<optimized out>, user_arg=<optimized out>) at /test/10.6_opt/storage/innobase/include/que0que.ic:209 #10 0x00005613c557a15e in fetch_step (thr=thr@entry=0x14fe24d6ee10) at /test/10.6_opt/storage/innobase/row/row0sel.cc:2343 #11 0x00005613c55331a8 in que_thr_step (thr=<optimized out>) at /test/10.6_opt/storage/innobase/que/que0que.cc:931 #12 que_run_threads_low (thr=<optimized out>) at /test/10.6_opt/storage/innobase/que/que0que.cc:1009 #13 que_run_threads (thr=<optimized out>) at /test/10.6_opt/storage/innobase/que/que0que.cc:1049 #14 0x00005613c56a9f55 in fts_eval_sql (trx=trx@entry=0x14fe75505228, graph=<optimized out>) at /test/10.6_opt/storage/innobase/fts/fts0sql.cc:213 #15 0x00005613c569c72f in fts_index_fetch_nodes (trx=trx@entry=0x14fe75505228, graph=graph@entry=0x14fe60107b50, fts_table=fts_table@entry=0x14fe60108108, word=word@entry=0x14fe60107b70, fetch=fetch@entry=0x14fe60107bd0) at /test/10.6_opt/storage/innobase/fts/fts0opt.cc:532 #16 0x00005613c56a7707 in fts_query_intersect (token=0x14fe60107b70, query=0x14fe601080c0) at /test/10.6_opt/storage/innobase/fts/fts0que.cc:1311 #17 fts_query_execute (token=0x14fe60107b70, query=0x14fe601080c0) at /test/10.6_opt/storage/innobase/fts/fts0que.cc:2918 #18 fts_query_visitor (oper=<optimized out>, node=<optimized out>, arg=0x14fe601080c0) at /test/10.6_opt/storage/innobase/fts/fts0que.cc:3046 #19 0x00005613c56d0703 in fts_ast_visit (oper=FTS_EXIST_SKIP, node=0x14fe24021578, visitor=0x5613c56a6ab0 <fts_query_visitor(fts_ast_oper_t, fts_ast_node_t*, void*)>, arg=<optimized out>, has_ignore=0x14fe60107f7f) at /test/10.6_opt/storage/innobase/fts/fts0ast.cc:693 #20 0x00005613c56d0792 in fts_ast_visit (oper=<optimized out>, oper@entry=FTS_NONE, node=0x14fe24064248, visitor=visitor@entry=0x5613c56a6ab0 <fts_query_visitor(fts_ast_oper_t, fts_ast_node_t*, void*)>, arg=arg@entry=0x14fe601080c0, has_ignore=has_ignore@entry=0x14fe6010802f) at /test/10.6_opt/storage/innobase/fts/fts0ast.cc:718 #21 0x00005613c56a4c6e in fts_query (trx=trx@entry=0x14fe75504180, index=index@entry=0x14fe2404ed20, flags=flags@entry=3, query_str=query_str@entry=0x14fe24064698 "+mySQL -yourSQL", query_len=<optimized out>, result=result@entry=0x14fe601083f8) at /test/10.6_opt/storage/innobase/fts/fts0que.cc:4072 #22 0x00005613c5497798 in ha_innobase::ft_init_ext (this=0x14fe24020a20, flags=3, keynr=<optimized out>, key=<optimized out>) at /test/10.6_opt/storage/innobase/handler/ha_innodb.cc:9161 #23 0x00005613c51eb063 in Item_func_match::init_search (this=0x14fe24011540, thd=thd@entry=0x14fe24000c58, no_order=no_order@entry=false) at /test/10.6_opt/sql/sql_string.h:630 #24 0x00005613c4f05ae5 in init_ftfuncs (thd=0x14fe24000c58, select_lex=<optimized out>, no_order=false) at /test/10.6_opt/sql/sql_base.cc:8938 #25 0x00005613c4fcc8b9 in JOIN::optimize_stage2 (this=<optimized out>) at /test/10.6_opt/sql/sql_select.cc:2797 #26 0x00005613c4fcf99a in JOIN::optimize_inner (this=0x14fe24012058) at /test/10.6_opt/sql/sql_select.cc:2277 #27 0x00005613c4fd1a83 in JOIN::optimize (this=this@entry=0x14fe24012058) at /test/10.6_opt/sql/sql_select.cc:1627 #28 0x00005613c4fd1b47 in mysql_select (thd=0x14fe24000c58, tables=0x14fe24010ad0, fields=<optimized out>, conds=0x14fe24011540, og_num=0, order=0x0, group=0x0, having=0x0, proc_param=0x0, select_options=2147748608, result=0x14fe24012030, unit=0x14fe24004c28, select_lex=0x14fe240104d0) at /test/10.6_opt/sql/sql_select.cc:4651 #29 0x00005613c4fd2567 in handle_select (thd=thd@entry=0x14fe24000c58, lex=lex@entry=0x14fe24004b60, result=result@entry=0x14fe24012030, setup_tables_done_option=setup_tables_done_option@entry=0) at /test/10.6_opt/sql/sql_select.cc:417 #30 0x00005613c4f61551 in execute_sqlcom_select (thd=0x14fe24000c58, all_tables=0x14fe24010ad0) at /test/10.6_opt/sql/sql_parse.cc:6118 #31 0x00005613c4f6f243 in mysql_execute_command (thd=0x14fe24000c58) at /test/10.6_opt/sql/sql_parse.cc:3820 #32 0x00005613c4f5beff in mysql_parse (thd=0x14fe24000c58, rawbuf=<optimized out>, length=<optimized out>, parser_state=<optimized out>) at /test/10.6_opt/sql/sql_parse.cc:7883 #33 0x00005613c4f67857 in dispatch_command (command=COM_QUERY, thd=0x14fe24000c58, packet=0x14fe24008019 "SELECT * FROM articles WHERE MATCH (title,body) AGAINST ('+mySQL -yourSQL' IN BOOLEAN MODE)", packet_length=<optimized out>) at /test/10.6_opt/sql/sql_class.h:1254 #34 0x00005613c4f69c32 in do_command (thd=0x14fe24000c58) at /test/10.6_opt/sql/sql_parse.cc:1348 #35 0x00005613c506e801 in do_handle_one_connection (connect=<optimized out>, connect@entry=0x5613c80944c8, put_in_cache=put_in_cache@entry=true) at /test/10.6_opt/sql/sql_connect.cc:1410 #36 0x00005613c506ec7d in handle_one_connection (arg=arg@entry=0x5613c80944c8) at /test/10.6_opt/sql/sql_connect.cc:1312 #37 0x00005613c53f4726 in pfs_spawn_thread (arg=0x5613c8010438) at /test/10.6_opt/storage/perfschema/pfs.cc:2201 #38 0x000014fe782db609 in start_thread (arg=<optimized out>) at pthread_create.c:477 #39 0x000014fe77eca293 in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95 10.1.48 (Optimized) InnoDB: Failing assertion: pos == node->first_doc_id 10.1.48 (Optimized) Core was generated by `/test/MD201020-mariadb-10.1.48-linux-x86_64-opt/bin/mysqld --no-defaults --core'. Program terminated with signal SIGABRT, Aborted. #0 __pthread_kill (threadid=<optimized out>, signo=signo@entry=6) at ../sysdeps/unix/sysv/linux/pthread_kill.c:56 [Current thread is 1 (Thread 0x14ada31fb700 (LWP 2586288))] (gdb) bt #0 __pthread_kill (threadid=<optimized out>, signo=signo@entry=6) at ../sysdeps/unix/sysv/linux/pthread_kill.c:56 #1 0x000055bf20d3498f in my_write_core (sig=sig@entry=6) at /test/10.1_opt/mysys/stacktrace.c:387 #2 0x000055bf2088d904 in handle_fatal_signal (sig=6) at /test/10.1_opt/sql/signal_handler.cc:296 #3 <signal handler called> #4 __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50 #5 0x000014adc8484859 in __GI_abort () at abort.c:79 #6 0x000055bf20ce761d in fts_query_filter_doc_ids (calc_doc_count=0, word_freq=0x14ad7c0100f0, word_freq=0x14ad7c0100f0, node=0x14ada31f5b50, node=0x14ada31f5b50, len=22, data=0x14ad7c033f68, word=0x14ad7c0100f0, query=0x14ada31f6470) at /test/10.1_opt/storage/xtradb/fts/fts0que.cc:3107 #7 fts_query_read_node (query=query@entry=0x14ada31f6470, exp=0x14ad7c03f988, word=<optimized out>, word=<optimized out>) at /test/10.1_opt/storage/xtradb/fts/fts0que.cc:3289 #8 0x000055bf20ce76f0 in fts_query_index_fetch_nodes (row=<optimized out>, user_arg=<optimized out>) at /test/10.1_opt/storage/xtradb/include/que0que.ic:226 #9 0x000055bf20bc9236 in fetch_step (thr=thr@entry=0x14ad7c040de0) at /test/10.1_opt/storage/xtradb/row/row0sel.cc:2171 #10 0x000055bf20b8a668 in que_thr_step (thr=0x14ad7c040de0) at /test/10.1_opt/storage/xtradb/que/que0que.cc:1069 #11 que_run_threads_low (thr=0x14ad7c040de0) at /test/10.1_opt/storage/xtradb/que/que0que.cc:1147 #12 que_run_threads (thr=0x14ad7c040de0) at /test/10.1_opt/storage/xtradb/que/que0que.cc:1188 #13 0x000055bf20ceabe1 in fts_eval_sql (trx=trx@entry=0x14ad7c034798, graph=<optimized out>) at /test/10.1_opt/storage/xtradb/fts/fts0sql.cc:232 #14 0x000055bf20cdee3d in fts_index_fetch_nodes (trx=trx@entry=0x14ad7c034798, graph=graph@entry=0x14ada31f61e0, fts_table=fts_table@entry=0x14ada31f64b8, word=word@entry=0x14ada31f61c0, fetch=fetch@entry=0x14ada31f6200) at /test/10.1_opt/storage/xtradb/fts/fts0opt.cc:534 #15 0x000055bf20ce92f6 in fts_query_intersect (token=0x14ada31f61c0, query=0x14ada31f6470) at /test/10.1_opt/storage/xtradb/fts/fts0que.cc:1336 #16 fts_query_execute (token=0x14ada31f61c0, query=0x14ada31f6470) at /test/10.1_opt/storage/xtradb/fts/fts0que.cc:2808 #17 fts_query_visitor (oper=<optimized out>, node=<optimized out>, arg=0x14ada31f6470) at /test/10.1_opt/storage/xtradb/fts/fts0que.cc:2921 #18 0x000055bf20cf729c in fts_ast_visit (oper=oper@entry=FTS_EXIST_SKIP, node=0x14ad7c0117f0, node@entry=0x14ad7c012de0, visitor=visitor@entry=0x55bf20ce81d0 <fts_query_visitor(fts_ast_oper_t, fts_ast_node_t*, void*)>, arg=arg@entry=0x14ada31f6470, has_ignore=has_ignore@entry=0x14ada31f633f) at /test/10.1_opt/storage/xtradb/fts/fts0ast.cc:589 #19 0x000055bf20cf7472 in fts_ast_visit (oper=<optimized out>, oper@entry=FTS_NONE, node=0x14ad7c012de0, visitor=visitor@entry=0x55bf20ce81d0 <fts_query_visitor(fts_ast_oper_t, fts_ast_node_t*, void*)>, arg=arg@entry=0x14ada31f6470, has_ignore=has_ignore@entry=0x14ada31f63ef) at /test/10.1_opt/storage/xtradb/fts/fts0ast.cc:614 #20 0x000055bf20ce61b4 in fts_query (trx=trx@entry=0x14ad7c002468, index=index@entry=0x14ad7c01c388, flags=flags@entry=3, query_str=query_str@entry=0x14ad7c012fe8 "+mySQL -yourSQL", query_len=<optimized out>, result=result@entry=0x14ada31f65f8) at /test/10.1_opt/storage/xtradb/fts/fts0que.cc:4015 #21 0x000055bf20afc62a in ha_innobase::ft_init_ext (this=0x14ad7c01a1e0, flags=3, keynr=<optimized out>, key=<optimized out>) at /test/10.1_opt/storage/xtradb/handler/ha_innodb.cc:10624 #22 0x000055bf208f6384 in Item_func_match::init_search (this=0x14ad7c009aa0, thd=thd@entry=0x55bf23a30018, no_order=no_order@entry=false) at /test/10.1_opt/sql/sql_string.h:315 #23 0x000055bf206bd9d1 in init_ftfuncs (thd=0x55bf23a30018, select_lex=<optimized out>, no_order=false) at /test/10.1_opt/sql/sql_base.cc:9286 #24 0x000055bf207570bd in JOIN::optimize_inner (this=<optimized out>) at /test/10.1_opt/sql/sql_select.cc:1850 #25 JOIN::optimize_inner (this=<optimized out>) at /test/10.1_opt/sql/sql_select.cc:1090 #26 0x000055bf207582da in JOIN::optimize (this=0x14ad7c009d08) at /test/10.1_opt/sql/sql_select.cc:1063 #27 JOIN::optimize (this=0x14ad7c009d08) at /test/10.1_opt/sql/sql_select.cc:1055 #28 0x000055bf20758a62 in mysql_select (thd=thd@entry=0x55bf23a30018, rref_pointer_array=rref_pointer_array@entry=0x55bf23a34350, tables=0x14ad7c0091a0, wild_num=<optimized out>, fields=@0x55bf23a341c0: {<base_list> = {<Sql_alloc> = {<No data fields>}, first = 0x14ad7c009148, last = 0x14ad7c00a600, elements = 3}, <No data fields>}, conds=<optimized out>, og_num=0, order=0x0, group=0x0, having=0x0, proc_param=0x0, select_options=2147748608, result=0x14ad7c009ce8, unit=0x55bf23a339a0, select_lex=0x55bf23a340a8) at /test/10.1_opt/sql/sql_select.cc:3490 #29 0x000055bf20758dc4 in handle_select (thd=thd@entry=0x55bf23a30018, lex=lex@entry=0x55bf23a338e0, result=result@entry=0x14ad7c009ce8, setup_tables_done_option=setup_tables_done_option@entry=0) at /test/10.1_opt/sql/sql_select.cc:377 #30 0x000055bf206f4851 in execute_sqlcom_select (thd=thd@entry=0x55bf23a30018, all_tables=0x14ad7c0091a0) at /test/10.1_opt/sql/sql_parse.cc:5682 #31 0x000055bf20701786 in mysql_execute_command (thd=0x55bf23a30018) at /test/10.1_opt/sql/sql_parse.cc:3029 #32 0x000055bf20704757 in mysql_parse (thd=0x55bf23a30018, rawbuf=<optimized out>, length=<optimized out>, parser_state=<optimized out>) at /test/10.1_opt/sql/sql_parse.cc:7200 #33 0x000055bf207075c1 in dispatch_command (command=command@entry=COM_QUERY, thd=thd@entry=0x55bf23a30018, packet=packet@entry=0x55bf23a35339 "SELECT * FROM articles WHERE MATCH (title,body) AGAINST ('+mySQL -yourSQL' IN BOOLEAN MODE)", packet_length=packet_length@entry=91) at /test/10.1_opt/sql/sql_class.h:1064 #34 0x000055bf2070859e in do_command (thd=0x55bf23a30018) at /test/10.1_opt/sql/sql_parse.cc:1123 #35 0x000055bf207da2de in do_handle_one_connection (thd_arg=thd_arg@entry=0x55bf23a30018) at /test/10.1_opt/sql/sql_connect.cc:1331 #36 0x000055bf207da412 in handle_one_connection (arg=0x55bf23a30018) at /test/10.1_opt/sql/sql_connect.cc:1242 #37 0x000014adc8a3b609 in start_thread (arg=<optimized out>) at pthread_create.c:477 #38 0x000014adc8581293 in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95 MS 5.6.50 (Optimized) InnoDB: Failing assertion: pos == node->first_doc_id MS 5.6.50 (Optimized) Core was generated by `/test/MS241020-mysql-5.6.50-linux-x86_64-opt/bin/mysqld --no-defaults --core --'. Program terminated with signal SIGABRT, Aborted. #0 __pthread_kill (threadid=<optimized out>, signo=signo@entry=6) at ../sysdeps/unix/sysv/linux/pthread_kill.c:56 [Current thread is 1 (Thread 0x15171e0a4700 (LWP 2580700))] (gdb) bt #0 __pthread_kill (threadid=<optimized out>, signo=signo@entry=6) at ../sysdeps/unix/sysv/linux/pthread_kill.c:56 #1 0x000055a8fe4f3c6f in my_write_core (sig=sig@entry=6) at /test/5.6_opt/mysys/stacktrace.c:436 #2 0x000055a8fe280cfb in handle_fatal_signal (sig=6) at /test/5.6_opt/sql/signal_handler.cc:237 #3 <signal handler called> #4 __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50 #5 0x0000151744596859 in __GI_abort () at abort.c:79 #6 0x000055a8fe1a423a in fts_query_filter_doc_ids (query=0x15171e0a00c0, word=0x1516f8021f90, data=0x1516f8022088, len=22, calc_doc_count=0, node=<optimized out>, node=<optimized out>, word_freq=<optimized out>, word_freq=<optimized out>) at /test/5.6_opt/storage/innobase/fts/fts0que.cc:3093 #7 0x000055a8fe6a4859 in fts_query_read_node (query=0x15171e0a00c0, exp=0x1516f8042030, word=<optimized out>, word=<optimized out>) at /test/5.6_opt/storage/innobase/fts/fts0que.cc:3275 #8 0x000055a8fe6a4933 in fts_query_index_fetch_nodes (row=<optimized out>, user_arg=<optimized out>) at /test/5.6_opt/storage/innobase/include/que0que.ic:234 #9 0x000055a8fe5c8d76 in fetch_step (thr=thr@entry=0x1516f8043488) at /test/5.6_opt/storage/innobase/row/row0sel.cc:2175 #10 0x000055a8fe5967b8 in que_thr_step (thr=0x1516f8043488) at /test/5.6_opt/storage/innobase/que/que0que.cc:1071 #11 que_run_threads_low (thr=0x1516f8043488) at /test/5.6_opt/storage/innobase/que/que0que.cc:1149 #12 que_run_threads (thr=0x1516f8043488) at /test/5.6_opt/storage/innobase/que/que0que.cc:1190 #13 0x000055a8fe6a9195 in fts_eval_sql (trx=trx@entry=0x1516f8033458, graph=<optimized out>) at /test/5.6_opt/storage/innobase/fts/fts0sql.cc:294 #14 0x000055a8fe6a1ac6 in fts_index_fetch_nodes (trx=trx@entry=0x1516f8033458, graph=graph@entry=0x15171e09fe20, fts_table=fts_table@entry=0x15171e0a0110, word=word@entry=0x15171e09fe00, fetch=fetch@entry=0x15171e09fe40) at /test/5.6_opt/storage/innobase/fts/fts0opt.cc:550 #15 0x000055a8fe6a790f in fts_query_intersect (token=0x15171e09fe00, query=0x15171e0a00c0) at /test/5.6_opt/storage/innobase/fts/fts0que.cc:1332 #16 fts_query_execute (token=0x15171e09fe00, query=0x15171e0a00c0) at /test/5.6_opt/storage/innobase/fts/fts0que.cc:2783 #17 fts_query_visitor (oper=<optimized out>, node=<optimized out>, arg=0x15171e0a00c0) at /test/5.6_opt/storage/innobase/fts/fts0que.cc:2896 #18 0x000055a8fe6b3d02 in fts_ast_visit (oper=FTS_EXIST_SKIP, node=0x1516f8020560, visitor=0x55a8fe6a6e40 <fts_query_visitor(fts_ast_oper_t, fts_ast_node_t*, void*)>, arg=<optimized out>, has_ignore=0x15171e09ff87) at /test/5.6_opt/storage/innobase/fts/fts0ast.cc:594 #19 0x000055a8fe6b3d72 in fts_ast_visit (oper=<optimized out>, oper@entry=FTS_NONE, node=0x1516f80372b0, visitor=visitor@entry=0x55a8fe6a6e40 <fts_query_visitor(fts_ast_oper_t, fts_ast_node_t*, void*)>, arg=arg@entry=0x15171e0a00c0, has_ignore=has_ignore@entry=0x15171e0a003f) at /test/5.6_opt/storage/innobase/fts/fts0ast.cc:615 #20 0x000055a8fe6a5914 in fts_query (trx=trx@entry=0x1516f8010988, index=index@entry=0x1516f8022b08, flags=flags@entry=3, query_str=query_str@entry=0x1516f803a0b0 "+mySQL -yourSQL", query_len=<optimized out>, result=result@entry=0x15171e0a0278) at /test/5.6_opt/storage/innobase/fts/fts0que.cc:4004 #21 0x000055a8fe52b1f1 in ha_innobase::ft_init_ext (this=0x1516f8020670, flags=3, keynr=<optimized out>, key=<optimized out>) at /test/5.6_opt/storage/innobase/handler/ha_innodb.cc:8337 #22 0x000055a8fe2284d4 in Item_func_match::init_search (this=0x1516f80019a0, thd=thd@entry=0x55a8ff4af4a0, no_order=no_order@entry=false) at /test/5.6_opt/sql/sql_string.h:272 #23 0x000055a8fe2b9c73 in init_ftfuncs (thd=0x55a8ff4af4a0, select_lex=<optimized out>, no_order=false) at /test/5.6_opt/sql/sql_base.cc:9452 #24 0x000055a8fe4563b0 in JOIN::optimize (this=this@entry=0x1516f8001bd8) at /test/5.6_opt/sql/sql_optimizer.h:302 #25 0x000055a8fe322caf in mysql_execute_select (free_join=true, select_lex=0x55a8ff4b1958, thd=0x55a8ff4af4a0) at /test/5.6_opt/sql/sql_select.cc:1094 #26 mysql_select (thd=0x55a8ff4af4a0, tables=<optimized out>, wild_num=1, fields=<optimized out>, conds=0x1516f80019a0, order=<optimized out>, group=<optimized out>, having=0x0, select_options=2147748608, result=0x1516f8001bb0, unit=0x55a8ff4b1310, select_lex=0x55a8ff4b1958) at /test/5.6_opt/sql/sql_select.cc:1229 #27 0x000055a8fe32360e in handle_select (thd=thd@entry=0x55a8ff4af4a0, result=result@entry=0x1516f8001bb0, setup_tables_done_option=setup_tables_done_option@entry=0) at /test/5.6_opt/sql/sql_select.cc:108 #28 0x000055a8fe2f739d in execute_sqlcom_select (thd=0x55a8ff4af4a0, all_tables=0x1516f8001100) at /test/5.6_opt/sql/sql_parse.cc:5162 #29 0x000055a8fe3013c4 in mysql_execute_command (thd=0x55a8ff4af4a0) at /test/5.6_opt/sql/sql_parse.cc:2717 #30 0x000055a8fe303678 in mysql_parse (thd=thd@entry=0x55a8ff4af4a0, rawbuf=<optimized out>, length=<optimized out>, parser_state=parser_state@entry=0x15171e0a3670) at /test/5.6_opt/sql/sql_parse.cc:6538 #31 0x000055a8fe3059ef in dispatch_command (command=<optimized out>, thd=0x55a8ff4af4a0, packet=0x55a8ff593eb1 "SELECT * FROM articles WHERE MATCH (title,body) AGAINST ('+mySQL -yourSQL' IN BOOLEAN MODE)", packet_length=91) at /test/5.6_opt/sql/sql_class.h:888 #32 0x000055a8fe2d13f2 in do_handle_one_connection (thd_arg=thd_arg@entry=0x55a8ff4af4a0) at /test/5.6_opt/sql/sql_connect.cc:989 #33 0x000055a8fe2d14b2 in handle_one_connection (arg=arg@entry=0x55a8ff4af4a0) at /test/5.6_opt/sql/sql_connect.cc:906 #34 0x000055a8fe729719 in pfs_spawn_thread (arg=0x55a8ff4a0990) at /test/5.6_opt/storage/perfschema/pfs.cc:1868 #35 0x0000151744ab7609 in start_thread (arg=<optimized out>) at pthread_create.c:477 #36 0x0000151744693293 in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95
            Roel Roel Van de Paar made changes -
            Labels affects-tests upstream affects-tests regression-10.6 upstream
            Roel Roel Van de Paar made changes -
            Labels affects-tests regression-10.6 upstream affects-tests upstream
            Roel Roel Van de Paar made changes -
            Summary Assertion `val <= 4294967295u' failed in fts_encode_int Assertion `val <= 4294967295u' failed in fts_encode_int | InnoDB: Failing assertion: pos == node->first_doc_id
            elenst Elena Stepanova made changes -
            julien.fritsch Julien Fritsch made changes -
            Priority Major [ 3 ] Critical [ 2 ]

            thiru It would be great if we could fix this as it generates many stacks. Apparently avoiding deferred processing may be an option? Thank you.

            Roel Roel Van de Paar added a comment - thiru It would be great if we could fix this as it generates many stacks. Apparently avoiding deferred processing may be an option? Thank you.
            thiru Thirunarayanan Balathandayuthapani made changes -
            Status Open [ 1 ] In Progress [ 3 ]

            Patch is in bb-10.2-MDEV-19522

            thiru Thirunarayanan Balathandayuthapani added a comment - Patch is in bb-10.2- MDEV-19522
            thiru Thirunarayanan Balathandayuthapani made changes -
            Assignee Thirunarayanan Balathandayuthapani [ thiru ] Marko Mäkelä [ marko ]
            Status In Progress [ 3 ] In Review [ 10002 ]
            marko Marko Mäkelä added a comment - - edited

            Thank you. I posted some review comments.

            If I understood correctly, the fix may be too intrusive. The problem in fts_cache_node_add_positions() does not appear to be that the FTS_DOC_ID value itself does not fit in 32 bits, but that the difference doc_id - node->last_doc_id will not fit. (By the way, on 32-bit CPUs, that difference is being happily truncated to 32 bits.)

            I think that we should check if we can fix fts_encode_int() without a format-breaking change. Let us consider how 32-bit values are currently encoded into 5 bytes:

            		/* Best to keep the limitations of the 32/64 bit versions
            		identical, at least for the time being. */
            		ut_ad(val <= 4294967295u);
             
            		*buf++ = (byte)(val >> 28);
            		*buf++ = (byte)((val >> 21) & 0x7F);
            		*buf++ = (byte)((val >> 14) & 0x7F);
            		*buf++ = (byte)((val >> 7) & 0x7F);
            		*buf = (byte)(val & 0x7F);
             
            		len = 5;
            	}
             
            	/* High-bit on means "last byte in the encoded integer". */
            	*buf |= 0x80;
            

            A value 0bEEEEEEEEFFFFFFFFGGGGGGGGHHHHHHHH that is larger than 268435455 would be encoded into 5 bytes as follows:

            0b0000EEEE,
            0b0EEEEFFF,
            0b0FFFFFGG,
            0b0GGGGGGH,
            0b1HHHHHHH
            

            In this peculiar encoding, we waste ⅛ of the bytes for the "last byte" marker bit. A more commonplace and efficient encoding would be to encode the length in the first byte, using some kind of a unary encoding (a number of '1' bits followed by a '0' bit). Exactly that is being used in mach_write_compressed(), which already existed when this problematic encoding was created. That encoding was probably invented in some compression format in the 1980s or 1970s.

            Anyway, it seems possible to extend the encoding in a backward-compatible way. We can see above that the most significant 4 bits of the first byte are 0 for any 5-byte encoded integer. Maybe we could just extend this peculiar encoding in the straightforward fashion, so that a 64-bit word (with not too many leading zeroes) would be encoded in up to 10 bytes as follows:

            0bAAAAAAAABBBBBBBBCCCCCCCCDDDDDDDDEEEEEEEEFFFFFFFFGGGGGGGGHHHHHHHH;
             
            0b0000000A,
            0b0AAAAAAA,
            0b0BBBBBBB,
            0b0BCCCCCC,
            0b0CCDDDDD,
            0b0DDDEEEE,
            0b0EEEEFFF,
            0b0FFFFFGG,
            0b0GGGGGGH,
            0b1HHHHHHH
            

            As you can see above, a 63-bit value would fit in 9 bytes and a 56-bit value in 8 bytes.

            I think that we should try replace any ulint (size_t) with the 64-bit fts_doc_id_t wherever applicable, and extend the encoding as suggested above.

            marko Marko Mäkelä added a comment - - edited Thank you. I posted some review comments . If I understood correctly, the fix may be too intrusive. The problem in fts_cache_node_add_positions() does not appear to be that the FTS_DOC_ID value itself does not fit in 32 bits, but that the difference doc_id - node->last_doc_id will not fit. (By the way, on 32-bit CPUs, that difference is being happily truncated to 32 bits.) I think that we should check if we can fix fts_encode_int() without a format-breaking change. Let us consider how 32-bit values are currently encoded into 5 bytes: /* Best to keep the limitations of the 32/64 bit versions identical, at least for the time being. */ ut_ad(val <= 4294967295u);   *buf++ = (byte)(val >> 28); *buf++ = (byte)((val >> 21) & 0x7F); *buf++ = (byte)((val >> 14) & 0x7F); *buf++ = (byte)((val >> 7) & 0x7F); *buf = (byte)(val & 0x7F);   len = 5; }   /* High-bit on means "last byte in the encoded integer". */ *buf |= 0x80; A value 0bEEEEEEEEFFFFFFFFGGGGGGGGHHHHHHHH that is larger than 268435455 would be encoded into 5 bytes as follows: 0b0000EEEE, 0b0EEEEFFF, 0b0FFFFFGG, 0b0GGGGGGH, 0b1HHHHHHH In this peculiar encoding, we waste ⅛ of the bytes for the "last byte" marker bit. A more commonplace and efficient encoding would be to encode the length in the first byte, using some kind of a unary encoding (a number of '1' bits followed by a '0' bit). Exactly that is being used in mach_write_compressed() , which already existed when this problematic encoding was created. That encoding was probably invented in some compression format in the 1980s or 1970s. Anyway, it seems possible to extend the encoding in a backward-compatible way. We can see above that the most significant 4 bits of the first byte are 0 for any 5-byte encoded integer. Maybe we could just extend this peculiar encoding in the straightforward fashion, so that a 64-bit word (with not too many leading zeroes) would be encoded in up to 10 bytes as follows: 0bAAAAAAAABBBBBBBBCCCCCCCCDDDDDDDDEEEEEEEEFFFFFFFFGGGGGGGGHHHHHHHH;   0b0000000A, 0b0AAAAAAA, 0b0BBBBBBB, 0b0BCCCCCC, 0b0CCDDDDD, 0b0DDDEEEE, 0b0EEEEFFF, 0b0FFFFFGG, 0b0GGGGGGH, 0b1HHHHHHH As you can see above, a 63-bit value would fit in 9 bytes and a 56-bit value in 8 bytes. I think that we should try replace any ulint ( size_t ) with the 64-bit fts_doc_id_t wherever applicable, and extend the encoding as suggested above.
            marko Marko Mäkelä made changes -
            Assignee Marko Mäkelä [ marko ] Thirunarayanan Balathandayuthapani [ thiru ]
            Status In Review [ 10002 ] Stalled [ 10000 ]
            thiru Thirunarayanan Balathandayuthapani made changes -
            Status Stalled [ 10000 ] In Progress [ 3 ]
            thiru Thirunarayanan Balathandayuthapani made changes -
            Assignee Thirunarayanan Balathandayuthapani [ thiru ] Marko Mäkelä [ marko ]
            Status In Progress [ 3 ] In Review [ 10002 ]

            I posted a few comments. The unit test must cover values larger than 9223372036854775808 (2⁶³).

            marko Marko Mäkelä added a comment - I posted a few comments. The unit test must cover values larger than 9223372036854775808 (2⁶³).
            marko Marko Mäkelä made changes -
            Assignee Marko Mäkelä [ marko ] Thirunarayanan Balathandayuthapani [ thiru ]
            Status In Review [ 10002 ] Stalled [ 10000 ]
            marko Marko Mäkelä made changes -
            issue.field.resolutiondate 2021-10-21 13:32:39.0 2021-10-21 13:32:39.08
            marko Marko Mäkelä made changes -
            Fix Version/s 10.2.41 [ 26032 ]
            Fix Version/s 10.3.32 [ 26029 ]
            Fix Version/s 10.4.22 [ 26031 ]
            Fix Version/s 10.5.13 [ 26026 ]
            Fix Version/s 10.6.5 [ 26034 ]
            Fix Version/s 10.2 [ 14601 ]
            Fix Version/s 10.3 [ 22126 ]
            Fix Version/s 10.4 [ 22408 ]
            Fix Version/s 10.5 [ 23123 ]
            Resolution Fixed [ 1 ]
            Status Stalled [ 10000 ] Closed [ 6 ]
            serg Sergei Golubchik made changes -
            Workflow MariaDB v3 [ 96818 ] MariaDB v4 [ 156221 ]

            People

              thiru Thirunarayanan Balathandayuthapani
              elenst Elena Stepanova
              Votes:
              2 Vote for this issue
              Watchers:
              6 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.