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

Assertion `precision > 0' failed with a window function or window aggregate function

    XMLWordPrintable

    Details

      Description

      CREATE TABLE t1 (d DECIMAL(1,0) UNSIGNED);
      INSERT INTO t1 VALUES (1),(2);
      SELECT LAST_VALUE(d) OVER () FROM t1;
      # Can also be MIN(d) etc.
      

      10.2 e1f0f0dd0

      mysqld: /data/src/10.2/strings/decimal.c:1460: decimal_bin_size: Assertion `precision > 0' failed.
      170214  2:05:50 [ERROR] mysqld got signal 6 ;
       
      #7  0x00007f27c9a05312 in __GI___assert_fail (assertion=0x7f27cd2beee5 "precision > 0", file=0x7f27cd2bec60 "/data/src/10.2/strings/decimal.c", line=1460, function=0x7f27cd2bf150 <__PRETTY_FUNCTION__.11264> "decimal_bin_size") at assert.c:101
      #8  0x00007f27ccf23786 in decimal_bin_size (precision=0, scale=0) at /data/src/10.2/strings/decimal.c:1460
      #9  0x00007f27cc56d4b4 in my_decimal_get_binary_size (precision=0, scale=0) at /data/src/10.2/sql/my_decimal.h:263
      #10 0x00007f27cc727b4d in Field_new_decimal::Field_new_decimal (this=0x7f27c0c28060, len_arg=1, maybe_null_arg=true, name=0x7f27c0c644e8 "LAST_VALUE(d) OVER ()", dec_arg=0 '\000', unsigned_arg=false) at /data/src/10.2/sql/field.cc:2983
      #11 0x00007f27cc727cb9 in Field_new_decimal::create_from_item (mem_root=0x7f27c0d88b40, item=0x7f27c0c643f8) at /data/src/10.2/sql/field.cc:3028
      #12 0x00007f27cc551b7b in Item::create_tmp_field (this=0x7f27c0c643f8, group=false, table=0x7f27c0d88088, convert_int_length=9) at /data/src/10.2/sql/sql_select.cc:15880
      #13 0x00007f27cc428ff1 in Item::create_tmp_field (this=0x7f27c0c643f8, group=false, table=0x7f27c0d88088) at /data/src/10.2/sql/item.h:1722
      #14 0x00007f27cc551c80 in create_tmp_field_from_item (thd=0x7f27c0c16070, item=0x7f27c0c643f8, table=0x7f27c0d88088, copy_func=0x7f27cd5fe4f8, modify_item=true) at /data/src/10.2/sql/sql_select.cc:15924
      #15 0x00007f27cc5523cd in create_tmp_field (thd=0x7f27c0c16070, table=0x7f27c0d88088, item=0x7f27c0c643f8, type=Item::WINDOW_FUNC_ITEM, copy_func=0x7f27cd5fe4f8, from_field=0x7f27c0d89138, default_field=0x7f27c0d89118, group=false, modify_item=true, table_cant_handle_bit_fields=false, make_copy_field=false) at /data/src/10.2/sql/sql_select.cc:16142
      #16 0x00007f27cc5537cb in create_tmp_table (thd=0x7f27c0c16070, param=0x7f27c0c66da8, fields=..., group=0x0, distinct=false, save_sum_fields=false, select_options=2147748608, rows_limit=18446744073709551615, table_alias=0x7f27ccf6f664 "", do_not_open=true, keep_row_order=false) at /data/src/10.2/sql/sql_select.cc:16525
      #17 0x00007f27cc5308bd in JOIN::create_postjoin_aggr_table (this=0x7f27c0c64c68, tab=0x7f27c0c66268, table_fields=0x7f27c0c64f80, table_group=0x0, save_sum_fields=false, distinct=false, keep_row_order=false) at /data/src/10.2/sql/sql_select.cc:2813
      #18 0x00007f27cc52ecbc in JOIN::make_aggr_tables_info (this=0x7f27c0c64c68) at /data/src/10.2/sql/sql_select.cc:2392
      #19 0x00007f27cc52dec1 in JOIN::optimize_inner (this=0x7f27c0c64c68) at /data/src/10.2/sql/sql_select.cc:2150
      #20 0x00007f27cc52a3e8 in JOIN::optimize (this=0x7f27c0c64c68) at /data/src/10.2/sql/sql_select.cc:1081
      #21 0x00007f27cc533160 in mysql_select (thd=0x7f27c0c16070, tables=0x7f27c0c64560, wild_num=0, fields=..., conds=0x0, og_num=0, order=0x0, group=0x0, having=0x0, proc_param=0x0, select_options=2147748608, result=0x7f27c0c64c48, unit=0x7f27c0c19b50, select_lex=0x7f27c0c1a280) at /data/src/10.2/sql/sql_select.cc:3633
      #22 0x00007f27cc527dbb in handle_select (thd=0x7f27c0c16070, lex=0x7f27c0c19a88, result=0x7f27c0c64c48, setup_tables_done_option=0) at /data/src/10.2/sql/sql_select.cc:373
      #23 0x00007f27cc4f4255 in execute_sqlcom_select (thd=0x7f27c0c16070, all_tables=0x7f27c0c64560) at /data/src/10.2/sql/sql_parse.cc:6415
      #24 0x00007f27cc4ea294 in mysql_execute_command (thd=0x7f27c0c16070) at /data/src/10.2/sql/sql_parse.cc:3448
      #25 0x00007f27cc4f7c26 in mysql_parse (thd=0x7f27c0c16070, rawbuf=0x7f27c0c64088 "SELECT LAST_VALUE(d) OVER () FROM t1", length=36, parser_state=0x7f27cd5ffdd0, is_com_multi=false, is_next_command=false) at /data/src/10.2/sql/sql_parse.cc:7858
      #26 0x00007f27cc4e5d03 in dispatch_command (command=COM_QUERY, thd=0x7f27c0c16070, packet=0x7f27c0c58071 "SELECT LAST_VALUE(d) OVER () FROM t1", packet_length=36, is_com_multi=false, is_next_command=false) at /data/src/10.2/sql/sql_parse.cc:1812
      #27 0x00007f27cc4e4673 in do_command (thd=0x7f27c0c16070) at /data/src/10.2/sql/sql_parse.cc:1362
      #28 0x00007f27cc62d462 in do_handle_one_connection (connect=0x7f27c9071410) at /data/src/10.2/sql/sql_connect.cc:1354
      #29 0x00007f27cc62d1ef in handle_one_connection (arg=0x7f27c9071410) at /data/src/10.2/sql/sql_connect.cc:1260
      #30 0x00007f27cc97271c in pfs_spawn_thread (arg=0x7f27c900f9f0) at /data/src/10.2/storage/perfschema/pfs.cc:1862
      #31 0x00007f27cbb120a4 in start_thread (arg=0x7f27cd601300) at pthread_create.c:309
      #32 0x00007f27c9abf87d in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:111
      

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              varun Varun Gupta
              Reporter:
              elenst Elena Stepanova
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: