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

Assertion `0' failed in Item_sum_percent_rank::val_int

    XMLWordPrintable

    Details

      Description

      CREATE TABLE t1 (i int);
      INSERT INTO t1 values (1),(2),(3);
      SELECT  insert('aaa', percent_rank() over (order by 1) ,1, 'bbb') FROM t1 ;
      

      10.2 cd1a195b22d2dac248228b6b

      #3  <signal handler called>
      #4  __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50
      #5  0x00007fe630e1f859 in __GI_abort () at abort.c:79
      #6  0x00007fe630e1f729 in __assert_fail_base (fmt=0x7fe630fb5588 "%s%s%s:%u: %s%sAssertion `%s' failed.\n%n", assertion=0x561a215e0c27 "0", file=0x561a215e0ea8 "/10.2/src/sql/item_windowfunc.h", line=478, function=<optimized out>) at assert.c:92
      #7  0x00007fe630e30f36 in __GI___assert_fail (assertion=0x561a215e0c27 "0", file=0x561a215e0ea8 "/10.2/src/sql/item_windowfunc.h", line=478, function=0x561a215e0e70 "virtual longlong Item_sum_percent_rank::val_int()") at assert.c:101
      #8  0x0000561a20e95037 in Item_sum_percent_rank::val_int (this=0x7fe5d40128a8) at /10.2/src/sql/item_windowfunc.h:478
      #9  0x0000561a20e95543 in Item_window_func::val_int (this=0x7fe5d4012b58) at /10.2/src/sql/item_windowfunc.h:903
      #10 0x0000561a20cd53a0 in Item_direct_ref::val_int (this=0x7fe5d4013d58) at /10.2/src/sql/item.cc:8131
      #11 0x0000561a20d5b97b in Item_func_insert::val_str (this=0x7fe5d4012d70, str=0x7fe5d4012da0) at /10.2/src/sql/item_strfunc.cc:1446
      #12 0x0000561a20ccfd2d in Item::save_in_field (this=0x7fe5d4012d70, field=0x7fe5d40369e8, no_conversions=true) at /10.2/src/sql/item.cc:6397
      #13 0x0000561a209c1d56 in Item_result_field::save_in_result_field (this=0x7fe5d4012d70, no_conversions=true) at /10.2/src/sql/item.h:2564
      #14 0x0000561a20bf9ef8 in save_window_function_values (window_functions=..., tbl=0x7fe5d4037028, rowid_buf=0x7fe5d40349b0 "\220\254\003\324\345\177") at /10.2/src/sql/sql_window.cc:2559
      #15 0x0000561a20bfa339 in compute_window_func (thd=0x7fe5d4000d90, window_functions=..., cursor_managers=..., tbl=0x7fe5d4037028, filesort_result=0x7fe5d4193290) at /10.2/src/sql/sql_window.cc:2679
      #16 0x0000561a20bfa716 in Window_func_runner::exec (this=0x7fe5d4015c20, thd=0x7fe5d4000d90, tbl=0x7fe5d4037028, filesort_result=0x7fe5d4193290) at /10.2/src/sql/sql_window.cc:2782
      #17 0x0000561a20bfa83c in Window_funcs_sort::exec (this=0x7fe5d4015c18, join=0x7fe5d4013688, keep_filesort_result=true) at /10.2/src/sql/sql_window.cc:2810
      #18 0x0000561a20bfad36 in Window_funcs_computation::exec (this=0x7fe5d4015bf8, join=0x7fe5d4013688, keep_last_filesort_result=true) at /10.2/src/sql/sql_window.cc:2937
      #19 0x0000561a20aabafc in AGGR_OP::end_send (this=0x7fe5d4015ab8) at /10.2/src/sql/sql_select.cc:26857
      #20 0x0000561a20a96541 in sub_select_postjoin_aggr (join=0x7fe5d4013688, join_tab=0x7fe5d4014d90, end_of_records=true) at /10.2/src/sql/sql_select.cc:18583
      #21 0x0000561a20a96875 in sub_select (join=0x7fe5d4013688, join_tab=0x7fe5d40149e0, end_of_records=true) at /10.2/src/sql/sql_select.cc:18819
      #22 0x0000561a20a96059 in do_select (join=0x7fe5d4013688, procedure=0x0) at /10.2/src/sql/sql_select.cc:18414
      #23 0x0000561a20a6fc1d in JOIN::exec_inner (this=0x7fe5d4013688) at /10.2/src/sql/sql_select.cc:3651
      #24 0x0000561a20a6f0c4 in JOIN::exec (this=0x7fe5d4013688) at /10.2/src/sql/sql_select.cc:3446
      #25 0x0000561a20a7029e in mysql_select (thd=0x7fe5d4000d90, tables=0x7fe5d4012f68, wild_num=0, fields=..., conds=0x0, og_num=0, order=0x0, group=0x0, having=0x0, proc_param=0x0, select_options=2147748608, result=0x7fe5d4013668, unit=0x7fe5d4004988, select_lex=0x7fe5d40050d8) at /10.2/src/sql/sql_select.cc:3849
      #26 0x0000561a20a643f2 in handle_select (thd=0x7fe5d4000d90, lex=0x7fe5d40048c8, result=0x7fe5d4013668, setup_tables_done_option=0) at /10.2/src/sql/sql_select.cc:361
      #27 0x0000561a20a2eae6 in execute_sqlcom_select (thd=0x7fe5d4000d90, all_tables=0x7fe5d4012f68) at /10.2/src/sql/sql_parse.cc:6271
      #28 0x0000561a20a2565a in mysql_execute_command (thd=0x7fe5d4000d90) at /10.2/src/sql/sql_parse.cc:3582
      #29 0x0000561a20a328a2 in mysql_parse (thd=0x7fe5d4000d90, rawbuf=0x7fe5d4012708 "SELECT  insert('aaa', percent_rank() over (order by 1) ,1, 'bbb') FROM t1", length=73, parser_state=0x7fe627106560, is_com_multi=false, is_next_command=false) at /10.2/src/sql/sql_parse.cc:7793
      #30 0x0000561a20a20afd in dispatch_command (command=COM_QUERY, thd=0x7fe5d4000d90, packet=0x7fe5d4008b61 "", packet_length=74, is_com_multi=false, is_next_command=false) at /10.2/src/sql/sql_parse.cc:1827
      #31 0x0000561a20a1f5f8 in do_command (thd=0x7fe5d4000d90) at /10.2/src/sql/sql_parse.cc:1381
      #32 0x0000561a20b7aa7b in do_handle_one_connection (connect=0x561a22f109c0) at /10.2/src/sql/sql_connect.cc:1336
      #33 0x0000561a20b7a7e0 in handle_one_connection (arg=0x561a22f109c0) at /10.2/src/sql/sql_connect.cc:1241
      #34 0x0000561a213a6c82 in pfs_spawn_thread (arg=0x561a22ef3db0) at /10.2/src/storage/perfschema/pfs.cc:1869
      #35 0x00007fe631340609 in start_thread (arg=<optimized out>) at pthread_create.c:477
      #36 0x00007fe630f1c293 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