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

Assertion `precision > 0' failed in decimal_bin_size upon SELECT with MOD short unsigned decimal

    XMLWordPrintable

Details

    • Bug
    • Status: Closed (View Workflow)
    • Major
    • Resolution: Duplicate
    • 5.5, 10.1, 10.2, 10.3, 10.4
    • N/A
    • Data types
    • None

    Description

      CREATE TABLE t1 (a DECIMAL(1,0) UNSIGNED);
      INSERT INTO t1 VALUES (1.0),(2.0);
      SELECT DISTINCT 1 MOD a FROM t1;
       
      # Cleanup
      DROP TABLE t1;
      

      10.4 fe4a4bb0

      mysqld: /data/src/10.4/strings/decimal.c:1466: decimal_bin_size: Assertion `precision > 0' failed.
      190911 13:22:30 [ERROR] mysqld got signal 6 ;
       
      #7  0x00007fc7ec623f12 in __GI___assert_fail (assertion=0x5575cef2b9c5 "precision > 0", file=0x5575cef2b740 "/data/src/10.4/strings/decimal.c", line=1466, function=0x5575cef2bc40 <__PRETTY_FUNCTION__.11647> "decimal_bin_size") at assert.c:101
      #8  0x00005575ce99de0b in decimal_bin_size (precision=0, scale=0) at /data/src/10.4/strings/decimal.c:1466
      #9  0x00005575cddaa5f1 in my_decimal_get_binary_size (precision=0, scale=0) at /data/src/10.4/sql/my_decimal.h:324
      #10 0x00005575ce03dc31 in Field_new_decimal::Field_new_decimal (this=0x7fc7d4067338, ptr_arg=0x0, len_arg=1, null_ptr_arg=0x5575cea1284e "", null_bit_arg=1 '\001', unireg_check_arg=Field::NONE, field_name_arg=0x7fc7d4013820, dec_arg=0 '\000', zero_arg=false, unsigned_arg=false) at /data/src/10.4/sql/field.cc:3199
      #11 0x00005575cdf314f9 in Type_handler_newdecimal::make_table_field (this=0x5575cf4e4bd0 <type_handler_newdecimal>, name=0x7fc7d4013820, addr=..., attr=..., table=0x7fc7d4065c68) at /data/src/10.4/sql/sql_type.cc:3170
      #12 0x00005575cdf30a6a in Type_handler::make_and_init_table_field (this=0x5575cf4e4bd0 <type_handler_newdecimal>, name=0x7fc7d4013820, addr=..., attr=..., table=0x7fc7d4065c68) at /data/src/10.4/sql/sql_type.cc:2996
      #13 0x00005575cdbed9dc in Item::tmp_table_field_from_field_type (this=0x7fc7d40137d0, table=0x7fc7d4065c68) at /data/src/10.4/sql/item.h:806
      #14 0x00005575cdd8ba32 in Item_result_field::create_tmp_field_ex (this=0x7fc7d40137d0, table=0x7fc7d4065c68, src=0x7fc7e67f36b0, param=0x7fc7e67f36a4) at /data/src/10.4/sql/sql_select.cc:17740
      #15 0x00005575cdd8bd65 in create_tmp_field (table=0x7fc7d4065c68, item=0x7fc7d40137d0, copy_func=0x7fc7e67f3800, from_field=0x7fc7d4066fd8, default_field=0x7fc7d4066fc8, group=true, modify_item=true, table_cant_handle_bit_fields=true, make_copy_field=false) at /data/src/10.4/sql/sql_select.cc:17813
      #16 0x00005575cdd8d278 in create_tmp_table (thd=0x7fc7d4000b00, param=0x7fc7d40166a0, fields=..., group=0x7fc7d4016648, distinct=false, save_sum_fields=false, select_options=2147748609, rows_limit=18446744073709551615, table_alias=0x5575cf38ed00 <empty_clex_str>, do_not_open=true, keep_row_order=false) at /data/src/10.4/sql/sql_select.cc:18187
      #17 0x00005575cdd642dd in JOIN::create_postjoin_aggr_table (this=0x7fc7d40148c8, tab=0x7fc7d4015ee0, table_fields=0x7fc7d4014be8, table_group=0x7fc7d4016648, save_sum_fields=false, distinct=false, keep_row_order=false) at /data/src/10.4/sql/sql_select.cc:3680
      #18 0x00005575cdd628fb in JOIN::make_aggr_tables_info (this=0x7fc7d40148c8) at /data/src/10.4/sql/sql_select.cc:3277
      #19 0x00005575cdd612d0 in JOIN::optimize_stage2 (this=0x7fc7d40148c8) at /data/src/10.4/sql/sql_select.cc:2921
      #20 0x00005575cdd5eb07 in JOIN::optimize_inner (this=0x7fc7d40148c8) at /data/src/10.4/sql/sql_select.cc:2219
      #21 0x00005575cdd5c5ec in JOIN::optimize (this=0x7fc7d40148c8) at /data/src/10.4/sql/sql_select.cc:1562
      #22 0x00005575cdd67814 in mysql_select (thd=0x7fc7d4000b00, tables=0x7fc7d4013900, wild_num=0, fields=..., conds=0x0, og_num=0, order=0x0, group=0x0, having=0x0, proc_param=0x0, select_options=2147748609, result=0x7fc7d40148a0, unit=0x7fc7d4004a30, select_lex=0x7fc7d40131b8) at /data/src/10.4/sql/sql_select.cc:4591
      #23 0x00005575cdd5768d in handle_select (thd=0x7fc7d4000b00, lex=0x7fc7d4004968, result=0x7fc7d40148a0, setup_tables_done_option=0) at /data/src/10.4/sql/sql_select.cc:425
      #24 0x00005575cdd1d968 in execute_sqlcom_select (thd=0x7fc7d4000b00, all_tables=0x7fc7d4013900) at /data/src/10.4/sql/sql_parse.cc:6357
      #25 0x00005575cdd12f12 in mysql_execute_command (thd=0x7fc7d4000b00) at /data/src/10.4/sql/sql_parse.cc:3899
      #26 0x00005575cdd21ab2 in mysql_parse (thd=0x7fc7d4000b00, rawbuf=0x7fc7d4013118 "SELECT DISTINCT 1 MOD a FROM t1", length=31, parser_state=0x7fc7e67f5170, is_com_multi=false, is_next_command=false) at /data/src/10.4/sql/sql_parse.cc:7909
      #27 0x00005575cdd0cab2 in dispatch_command (command=COM_QUERY, thd=0x7fc7d4000b00, packet=0x7fc7d4008321 "SELECT DISTINCT 1 MOD a FROM t1", packet_length=31, is_com_multi=false, is_next_command=false) at /data/src/10.4/sql/sql_parse.cc:1843
      #28 0x00005575cdd0b0fc in do_command (thd=0x7fc7d4000b00) at /data/src/10.4/sql/sql_parse.cc:1360
      #29 0x00005575cde94e45 in do_handle_one_connection (connect=0x5575d12f8020) at /data/src/10.4/sql/sql_connect.cc:1412
      #30 0x00005575cde94b94 in handle_one_connection (arg=0x5575d12f8020) at /data/src/10.4/sql/sql_connect.cc:1316
      #31 0x00005575ce8cc173 in pfs_spawn_thread (arg=0x5575d132d430) at /data/src/10.4/storage/perfschema/pfs.cc:1862
      #32 0x00007fc7ee1984a4 in start_thread (arg=0x7fc7e67f6700) at pthread_create.c:456
      #33 0x00007fc7ec6e0d0f in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:97
      

      Reproducible on all of 5.5-10.5, with at least InnoDB, MyISAM, Aria.
      No obvious effect on a non-debug build.

      Attachments

        Issue Links

          Activity

            People

              bar Alexander Barkov
              elenst Elena Stepanova
              Votes:
              0 Vote for this issue
              Watchers:
              1 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.