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

investigate group by window issues

    XMLWordPrintable

Details

    Description

      CREATE TABLE t1 (i1 int );
      CREATE TABLE t2 (i2 int, j2 int );
      INSERT INTO t1 VALUES (-1),(0),(84);
       
      SELECT 1 FROM t1 WINDOW w AS (ORDER BY (SELECT i2 FROM t2 GROUP BY i2 WINDOW w2 AS (ORDER BY 1) ));
      

      leads to

      #0  __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50
      #1  0x00007ffff76d6537 in __GI_abort () at abort.c:79
      #2  0x00007ffff76d640f in __assert_fail_base (fmt=0x7ffff784e6a8 "%s%s%s:%u: %s%sAssertion `%s' failed.\n%n", assertion=0x55555687214e "field->table == table", 
          file=0x55555686f810 "/home/rex/src/mariadb/server/sql/sql_select.cc", line=18274, function=<optimized out>) at assert.c:92
      #3  0x00007ffff76e5662 in __GI___assert_fail (assertion=0x55555687214e "field->table == table", file=0x55555686f810 "/home/rex/src/mariadb/server/sql/sql_select.cc", line=18274, 
          function=0x555556872038 "TABLE* create_tmp_table(THD*, TMP_TABLE_PARAM*, List<Item>&, ORDER*, bool, bool, ulonglong, ha_rows, const LEX_CSTRING*, bool, bool)") at assert.c:101
      #4  0x0000555555cb6ecf in create_tmp_table (thd=0x7fff68000d90, param=0x7fff6806fb98, fields=..., group=0x7fff68015580, distinct=false, save_sum_fields=false, 
          select_options=2147748608, rows_limit=18446744073709551615, table_alias=0x555556f54c00 <empty_clex_str>, do_not_open=true, keep_row_order=false)
          at /home/rex/src/mariadb/server/sql/sql_select.cc:18274
      #5  0x0000555555c90aa9 in JOIN::create_postjoin_aggr_table (this=0x7fff68015b28, tab=0x7fff6806f0d8, table_fields=0x7fff68015e48, table_group=0x7fff68015580, 
          save_sum_fields=false, distinct=false, keep_row_order=false) at /home/rex/src/mariadb/server/sql/sql_select.cc:3491
      #6  0x0000555555c8f0c2 in JOIN::make_aggr_tables_info (this=0x7fff68015b28) at /home/rex/src/mariadb/server/sql/sql_select.cc:3090
      #7  0x0000555555c8da39 in JOIN::optimize_stage2 (this=0x7fff68015b28) at /home/rex/src/mariadb/server/sql/sql_select.cc:2725
      #8  0x0000555555c8b4d0 in JOIN::optimize_inner (this=0x7fff68015b28) at /home/rex/src/mariadb/server/sql/sql_select.cc:2031
      #9  0x0000555555c89919 in JOIN::optimize (this=0x7fff68015b28) at /home/rex/src/mariadb/server/sql/sql_select.cc:1547
      #10 0x0000555555c939d0 in mysql_select (thd=0x7fff68000d90, tables=0x7fff680139b0, wild_num=0, fields=..., conds=0x0, og_num=1, order=0x0, group=0x7fff68015580, having=0x0, 
          proc_param=0x0, select_options=2147748608, result=0x7fff68015b00, unit=0x7fff68004c48, select_lex=0x7fff68005408) at /home/rex/src/mariadb/server/sql/sql_select.cc:4373
      #11 0x0000555555c85141 in handle_select (thd=0x7fff68000d90, lex=0x7fff68004b88, result=0x7fff68015b00, setup_tables_done_option=0)
          at /home/rex/src/mariadb/server/sql/sql_select.cc:372
      #12 0x0000555555c4e006 in execute_sqlcom_select (thd=0x7fff68000d90, all_tables=0x7fff680139b0) at /home/rex/src/mariadb/server/sql/sql_parse.cc:6340
      #13 0x0000555555c44d42 in mysql_execute_command (thd=0x7fff68000d90) at /home/rex/src/mariadb/server/sql/sql_parse.cc:3871
      #14 0x0000555555c52099 in mysql_parse (thd=0x7fff68000d90, 
          rawbuf=0x7fff68013798 "SELECT 1 FROM t1 WINDOW w AS (ORDER BY (SELECT i2 FROM t2 GROUP BY i2 WINDOW w2 AS (ORDER BY 1) ))", length=98, parser_state=0x7ffff40a5590, 
          is_com_multi=false, is_next_command=false) at /home/rex/src/mariadb/server/sql/sql_parse.cc:7855
      #15 0x0000555555c3f206 in dispatch_command (command=COM_QUERY, thd=0x7fff68000d90, 
          packet=0x7fff68008e61 "SELECT 1 FROM t1 WINDOW w AS (ORDER BY (SELECT i2 FROM t2 GROUP BY i2 WINDOW w2 AS (ORDER BY 1) ))", packet_length=98, is_com_multi=false, 
          is_next_command=false) at /home/rex/src/mariadb/server/sql/sql_parse.cc:1852
      #16 0x0000555555c3dbf8 in do_command (thd=0x7fff68000d90) at /home/rex/src/mariadb/server/sql/sql_parse.cc:1398
      #17 0x0000555555dae3fc in do_handle_one_connection (connect=0x5555586a9430) at /home/rex/src/mariadb/server/sql/sql_connect.cc:1404
      #18 0x0000555555dae167 in handle_one_connection (arg=0x5555586a9430) at /home/rex/src/mariadb/server/sql/sql_connect.cc:1309
      #19 0x00007ffff7890ea7 in start_thread (arg=<optimized out>) at pthread_create.c:477
      #20 0x00007ffff77b0a2f in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95
      
      

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              Johnston Rex Johnston
              Votes:
              0 Vote for this issue
              Watchers:
              2 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.