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

Assertion `(value & (1ULL << i)) == 0' failed in Item_sum_bit::remove_as_window after query with a window frame

    XMLWordPrintable

    Details

      Description

      CREATE TABLE t1 (pk int);
      INSERT INTO t1 values (1),(2),(3),(4),(5),(6),(7),(8),(9),(10);
       
      SELECT  bit_and(pk) over (ROWS BETWEEN 1 preceding AND 5 preceding) FROM t1 ; # also with bit_or/bix_xor
      

      10.2 cd1a195b22d2dac248228b6b

      #3  <signal handler called>
      #4  __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50
      #5  0x00007f0bf6608859 in __GI_abort () at abort.c:79
      #6  0x00007f0bf6608729 in __assert_fail_base (fmt=0x7f0bf679e588 "%s%s%s:%u: %s%sAssertion `%s' failed.\n%n", assertion=0x55ad603da93a "(value & (1ULL << i)) == 0", file=0x55ad603da1a0 "/10.2/src/sql/item_sum.cc", line=2270, function=<optimized out>) at assert.c:92
      #7  0x00007f0bf6619f36 in __GI___assert_fail (assertion=0x55ad603da93a "(value & (1ULL << i)) == 0", file=0x55ad603da1a0 "/10.2/src/sql/item_sum.cc", line=2270, function=0x55ad603da8f8 "bool Item_sum_bit::remove_as_window(ulonglong)") at assert.c:101
      #8  0x000055ad5fbadccb in Item_sum_bit::remove_as_window (this=0x7f0ba0012918, value=4) at /10.2/src/sql/item_sum.cc:2270
      #9  0x000055ad5fbb4cb7 in Item_sum_bit::remove (this=0x7f0ba0012918) at /10.2/src/sql/item_sum.h:1136
      #10 0x000055ad5fa1c1c9 in Frame_cursor::remove_value_from_items (this=0x7f0ba0016618) at /10.2/src/sql/sql_window.cc:1002
      #11 0x000055ad5fa1d98c in Frame_n_rows_preceding::move_cursor_if_possible (this=0x7f0ba0016618) at /10.2/src/sql/sql_window.cc:1767
      #12 0x000055ad5fa1d86a in Frame_n_rows_preceding::next_row (this=0x7f0ba0016618) at /10.2/src/sql/sql_window.cc:1726
      #13 0x000055ad5fa1c41f in Cursor_manager::notify_cursors_next_row (this=0x7f0ba018b090) at /10.2/src/sql/sql_window.cc:1064
      #14 0x000055ad5fa1a2ec in compute_window_func (thd=0x7f0ba0000d90, window_functions=..., cursor_managers=..., tbl=0x7f0ba0037028, filesort_result=0x7f0ba0193290) at /10.2/src/sql/sql_window.cc:2670
      #15 0x000055ad5fa1a716 in Window_func_runner::exec (this=0x7f0ba0015c20, thd=0x7f0ba0000d90, tbl=0x7f0ba0037028, filesort_result=0x7f0ba0193290) at /10.2/src/sql/sql_window.cc:2782
      #16 0x000055ad5fa1a83c in Window_funcs_sort::exec (this=0x7f0ba0015c18, join=0x7f0ba0013748, keep_filesort_result=true) at /10.2/src/sql/sql_window.cc:2810
      #17 0x000055ad5fa1ad36 in Window_funcs_computation::exec (this=0x7f0ba0015bf8, join=0x7f0ba0013748, keep_last_filesort_result=true) at /10.2/src/sql/sql_window.cc:2937
      #18 0x000055ad5f8cbafc in AGGR_OP::end_send (this=0x7f0ba0015ac8) at /10.2/src/sql/sql_select.cc:26857
      #19 0x000055ad5f8b6541 in sub_select_postjoin_aggr (join=0x7f0ba0013748, join_tab=0x7f0ba0014e18, end_of_records=true) at /10.2/src/sql/sql_select.cc:18583
      #20 0x000055ad5f8b6875 in sub_select (join=0x7f0ba0013748, join_tab=0x7f0ba0014a68, end_of_records=true) at /10.2/src/sql/sql_select.cc:18819
      #21 0x000055ad5f8b6059 in do_select (join=0x7f0ba0013748, procedure=0x0) at /10.2/src/sql/sql_select.cc:18414
      #22 0x000055ad5f88fc1d in JOIN::exec_inner (this=0x7f0ba0013748) at /10.2/src/sql/sql_select.cc:3651
      #23 0x000055ad5f88f0c4 in JOIN::exec (this=0x7f0ba0013748) at /10.2/src/sql/sql_select.cc:3446
      #24 0x000055ad5f89029e in mysql_select (thd=0x7f0ba0000d90, tables=0x7f0ba0013028, wild_num=0, fields=..., conds=0x0, og_num=0, order=0x0, group=0x0, having=0x0, proc_param=0x0, select_options=2147748608, result=0x7f0ba0013728, unit=0x7f0ba0004988, select_lex=0x7f0ba00050d8) at /10.2/src/sql/sql_select.cc:3849
      #25 0x000055ad5f8843f2 in handle_select (thd=0x7f0ba0000d90, lex=0x7f0ba00048c8, result=0x7f0ba0013728, setup_tables_done_option=0) at /10.2/src/sql/sql_select.cc:361
      #26 0x000055ad5f84eae6 in execute_sqlcom_select (thd=0x7f0ba0000d90, all_tables=0x7f0ba0013028) at /10.2/src/sql/sql_parse.cc:6271
      #27 0x000055ad5f84565a in mysql_execute_command (thd=0x7f0ba0000d90) at /10.2/src/sql/sql_parse.cc:3582
      #28 0x000055ad5f8528a2 in mysql_parse (thd=0x7f0ba0000d90, rawbuf=0x7f0ba0012708 "SELECT  bit_and(pk) over (ROWS BETWEEN 1 preceding AND 5 preceding) FROM t1", length=75, parser_state=0x7f0bf094f560, is_com_multi=false, is_next_command=false) at /10.2/src/sql/sql_parse.cc:7793
      #29 0x000055ad5f840afd in dispatch_command (command=COM_QUERY, thd=0x7f0ba0000d90, packet=0x7f0ba0008b61 "", packet_length=76, is_com_multi=false, is_next_command=false) at /10.2/src/sql/sql_parse.cc:1827
      #30 0x000055ad5f83f5f8 in do_command (thd=0x7f0ba0000d90) at /10.2/src/sql/sql_parse.cc:1381
      #31 0x000055ad5f99aa7b in do_handle_one_connection (connect=0x55ad62b15c40) at /10.2/src/sql/sql_connect.cc:1336
      #32 0x000055ad5f99a7e0 in handle_one_connection (arg=0x55ad62b15c40) at /10.2/src/sql/sql_connect.cc:1241
      #33 0x000055ad601c6c82 in pfs_spawn_thread (arg=0x55ad62af9030) at /10.2/src/storage/perfschema/pfs.cc:1869
      #34 0x00007f0bf6b29609 in start_thread (arg=<optimized out>) at pthread_create.c:477
      #35 0x00007f0bf6705293 in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95
      
      

      No visible effect on a non-debug builds

        Attachments

          Activity

            People

            Assignee:
            psergei Sergei Petrunia
            Reporter:
            alice Alice Sherepa
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Dates

              Created:
              Updated:

                Git Integration