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

Assertion `(longlong) n_rows >= 0' failed in get_frame_cursor on SELECT

    XMLWordPrintable

Details

    Description

      CREATE TABLE t (c INT) ENGINE=InnoDB;
      SELECT SUM(c) OVER (ROWS BETWEEN 10000000000000000000 FOLLOWING AND 1 FOLLOWING) FROM t;
      

      Leads to:

      11.0.1 f2dc4d4c10ac36a73b5c1eb765352d3aee808d66 (Debug)

      mariadbd: /test/11.0_dbg/sql/sql_window.cc:2484: Frame_cursor* get_frame_cursor(THD*, Window_spec*, bool): Assertion `(longlong) n_rows >= 0' failed.
      

      11.0.1 f2dc4d4c10ac36a73b5c1eb765352d3aee808d66 (Debug)

      Core was generated by `/test/MD180223-mariadb-11.0.1-linux-x86_64-dbg/bin/mariadbd --no-defaults --cor'.
      Program terminated with signal SIGABRT, Aborted.
      #0  __pthread_kill_implementation (no_tid=0, signo=6, threadid=22506032211520)
          at ./nptl/pthread_kill.c:44
      [Current thread is 1 (Thread 0x1478180e2640 (LWP 673114))]
      (gdb) bt
      #0  __pthread_kill_implementation (no_tid=0, signo=6, threadid=22506032211520) at ./nptl/pthread_kill.c:44
      #1  __pthread_kill_internal (signo=6, threadid=22506032211520) at ./nptl/pthread_kill.c:78
      #2  __GI___pthread_kill (threadid=22506032211520, signo=signo@entry=6) at ./nptl/pthread_kill.c:89
      #3  0x0000147844d7a476 in __GI_raise (sig=sig@entry=6) at ../sysdeps/posix/raise.c:26
      #4  0x0000147844d607f3 in __GI_abort () at ./stdlib/abort.c:79
      #5  0x0000147844d6071b in __assert_fail_base (fmt=0x147844f15150 "%s%s%s:%u: %s%sAssertion `%s' failed.\n%n", assertion=0x563d4d0f933a "(longlong) n_rows >= 0", file=0x563d4d0f8df0 "/test/11.0_dbg/sql/sql_window.cc", line=2484, function=<optimized out>) at ./assert/assert.c:92
      #6  0x0000147844d71e96 in __GI___assert_fail (assertion=0x563d4d0f933a "(longlong) n_rows >= 0", file=0x563d4d0f8df0 "/test/11.0_dbg/sql/sql_window.cc", line=2484, function=0x563d4d0f8f88 "Frame_cursor* get_frame_cursor(THD*, Window_spec*, bool)") at ./assert/assert.c:101
      #7  0x0000563d4c7af9df in get_frame_cursor (thd=thd@entry=0x14779c000d58, spec=0x14779c013bc8, is_top_bound=is_top_bound@entry=true) at /test/11.0_dbg/sql/sql_window.cc:2484
      #8  0x0000563d4c7b1d9c in get_window_functions_required_cursors (thd=thd@entry=0x14779c000d58, window_functions=@0x14779c016d40: {<base_list> = {<Sql_alloc> = {<No data fields>}, first = 0x14779c016d60, last = 0x14779c016d60, elements = 1}, <No data fields>}, cursor_managers=cursor_managers@entry=0x1478180e0220) at /test/11.0_dbg/sql/sql_window.cc:2733
      #9  0x0000563d4c7b2c4f in Window_func_runner::exec (this=this@entry=0x14779c016d38, thd=thd@entry=0x14779c000d58, tbl=0x14779c069a20, filesort_result=0x14779c06b680) at /test/11.0_dbg/sql/sql_window.cc:3035
      #10 0x0000563d4c7b2d86 in Window_funcs_sort::exec (this=0x14779c016d30, join=join@entry=0x14779c014ef8, keep_filesort_result=<optimized out>) at /test/11.0_dbg/sql/sql_window.cc:3067
      #11 0x0000563d4c7b34c9 in Window_funcs_computation::exec (this=0x14779c016d10, join=join@entry=0x14779c014ef8, keep_last_filesort_result=keep_last_filesort_result@entry=true) at /test/11.0_dbg/sql/sql_window.cc:3196
      #12 0x0000563d4c61b5d8 in AGGR_OP::end_send (this=this@entry=0x14779c016bc0) at /test/11.0_dbg/sql/sql_select.cc:31257
      #13 0x0000563d4c61ba44 in sub_select_postjoin_aggr (join=0x14779c014ef8, join_tab=0x14779c065e00, end_of_records=<optimized out>) at /test/11.0_dbg/sql/sql_select.cc:22494
      #14 0x0000563d4c5f2415 in sub_select (join=0x14779c014ef8, join_tab=0x14779c065a00, end_of_records=true) at /test/11.0_dbg/sql/sql_select.cc:22731
      #15 0x0000563d4c6286b1 in do_select (procedure=0x0, join=0x14779c014ef8) at /test/11.0_dbg/sql/sql_select.cc:22331
      #16 JOIN::exec_inner (this=this@entry=0x14779c014ef8) at /test/11.0_dbg/sql/sql_select.cc:4888
      #17 0x0000563d4c628be0 in JOIN::exec (this=this@entry=0x14779c014ef8) at /test/11.0_dbg/sql/sql_select.cc:4666
      #18 0x0000563d4c626b18 in mysql_select (thd=thd@entry=0x14779c000d58, tables=0x14779c013e20, fields=@0x14779c013500: {<base_list> = {<Sql_alloc> = {<No data fields>}, first = 0x14779c013cf8, last = 0x14779c013cf8, elements = 1}, <No data fields>}, conds=0x0, og_num=0, order=0x0, group=0x0, having=0x0, proc_param=0x0, select_options=2164525824, result=0x14779c014ed0, unit=0x14779c004fa0, select_lex=0x14779c013248) at /test/11.0_dbg/sql/sql_select.cc:5146
      #19 0x0000563d4c62728b in handle_select (thd=thd@entry=0x14779c000d58, lex=lex@entry=0x14779c004ec8, result=result@entry=0x14779c014ed0, setup_tables_done_option=setup_tables_done_option@entry=0) at /test/11.0_dbg/sql/sql_select.cc:608
      #20 0x0000563d4c58ce8d in execute_sqlcom_select (thd=thd@entry=0x14779c000d58, all_tables=0x14779c013e20) at /test/11.0_dbg/sql/sql_parse.cc:6267
      #21 0x0000563d4c5984af in mysql_execute_command (thd=thd@entry=0x14779c000d58, is_called_from_prepared_stmt=is_called_from_prepared_stmt@entry=false) at /test/11.0_dbg/sql/sql_parse.cc:3949
      #22 0x0000563d4c59f7cf in mysql_parse (thd=thd@entry=0x14779c000d58, rawbuf=<optimized out>, length=<optimized out>, parser_state=parser_state@entry=0x1478180e12c0) at /test/11.0_dbg/sql/sql_parse.cc:8002
      #23 0x0000563d4c5a1963 in dispatch_command (command=command@entry=COM_QUERY, thd=thd@entry=0x14779c000d58, packet=packet@entry=0x14779c00ae19 "", packet_length=packet_length@entry=87, blocking=blocking@entry=true) at /test/11.0_dbg/sql/sql_class.h:242
      #24 0x0000563d4c5a37bc in do_command (thd=0x14779c000d58, blocking=blocking@entry=true) at /test/11.0_dbg/sql/sql_parse.cc:1407
      #25 0x0000563d4c6f46e2 in do_handle_one_connection (connect=<optimized out>, connect@entry=0x563d4f610ae8, put_in_cache=put_in_cache@entry=true) at /test/11.0_dbg/sql/sql_connect.cc:1416
      #26 0x0000563d4c6f4941 in handle_one_connection (arg=0x563d4f610ae8) at /test/11.0_dbg/sql/sql_connect.cc:1318
      #27 0x0000147844dccb43 in start_thread (arg=<optimized out>) at ./nptl/pthread_create.c:442
      #28 0x0000147844e5ea00 in clone3 () at ../sysdeps/unix/sysv/linux/x86_64/clone3.S:81
      

      Bug confirmed present in:
      MariaDB: 10.3.38 (dbg), 10.4.29 (dbg), 10.5.20 (dbg), 10.6.13 (dbg), 10.7.8 (dbg), 10.8.8 (dbg), 10.9.6 (dbg), 10.10.4 (dbg), 10.11.2 (dbg), 11.0.1 (dbg)

      Bug (or feature/syntax) confirmed not present in:
      MariaDB: 10.3.38 (opt), 10.4.29 (opt), 10.5.20 (opt), 10.6.13 (opt), 10.7.8 (opt), 10.8.8 (opt), 10.9.6 (opt), 10.10.4 (opt), 10.11.2 (opt), 11.0.1 (opt)
      MySQL: 5.5.62 (dbg), 5.5.62 (opt), 5.6.51 (dbg), 5.6.51 (opt), 5.7.40 (dbg), 5.7.40 (opt), 8.0.31 (dbg), 8.0.31 (opt)

      Attachments

        Activity

          People

            psergei Sergei Petrunia
            Roel Roel Van de Paar
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:

              Git Integration

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