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

Assertion `precision > 0' failed in decimal_bin_size upon CREATE TABLE .. SELECT

    XMLWordPrintable

Details

    Description

      CREATE TABLE t1 (d DECIMAL(43,0) UNSIGNED);
      CREATE TABLE t2 AS SELECT IFNULL( SLEEP(0.01), NULL DIV d ) AS f FROM t1;
       
      # Cleanup
      DROP TABLE t1, t2;
      

      10.3 a93ac8d95f

      mysqld: /data/src/10.3/strings/decimal.c:1466: decimal_bin_size: Assertion `precision > 0' failed.
      181118  4:31:54 [ERROR] mysqld got signal 6 ;
       
      #7  0x00007f2ce46b6ee2 in __assert_fail () from /lib/x86_64-linux-gnu/libc.so.6
      #8  0x0000557f9a947f35 in decimal_bin_size (precision=0, scale=0) at /data/src/10.3/strings/decimal.c:1466
      #9  0x0000557f99ed1d40 in my_decimal_get_binary_size (precision=0, scale=0) at /data/src/10.3/sql/my_decimal.h:263
      #10 0x0000557f9a105760 in Field_new_decimal::Field_new_decimal (this=0x7f2ccc016a68, ptr_arg=0x0, len_arg=0, null_ptr_arg=0x557f9a997e9f "", null_bit_arg=0 '\000', unireg_check_arg=Field::NONE, field_name_arg=0x7f2ccc015978, dec_arg=0 '\000', zero_arg=false, unsigned_arg=false) at /data/src/10.3/sql/field.cc:3097
      #11 0x0000557f9a02e5c8 in Type_handler_newdecimal::make_table_field (this=0x557f9b5e2888 <type_handler_newdecimal>, name=0x7f2ccc015978, addr=..., attr=..., table=0x7f2cde85afe0) at /data/src/10.3/sql/sql_type.cc:2170
      #12 0x0000557f9a02dd6c in Type_handler::make_and_init_table_field (this=0x557f9b5e2888 <type_handler_newdecimal>, name=0x7f2ccc015978, addr=..., attr=..., table=0x7f2cde85afe0) at /data/src/10.3/sql/sql_type.cc:1997
      #13 0x0000557f99d41fc7 in Item::tmp_table_field_from_field_type (this=0x7f2ccc015928, table=0x7f2cde85afe0) at /data/src/10.3/sql/item.h:708
      #14 0x0000557f99dc990b in Item_func::create_field_for_create_select (this=0x7f2ccc015928, table=0x7f2cde85afe0) at /data/src/10.3/sql/item_func.h:190
      #15 0x0000557f99e11b1e in select_create::create_table_from_items (this=0x7f2ccc0162a8, thd=0x7f2ccc000b00, items=0x7f2cde85c140, lock=0x7f2cde85c130, hooks=0x7f2cde85c180) at /data/src/10.3/sql/sql_insert.cc:4160
      #16 0x0000557f99e125c9 in select_create::prepare (this=0x7f2ccc0162a8, _values=..., u=0x7f2ccc0049b0) at /data/src/10.3/sql/sql_insert.cc:4405
      #17 0x0000557f99e8a729 in JOIN::prepare (this=0x7f2ccc0163a0, tables_init=0x7f2ccc015a50, wild_num=0, conds_init=0x0, og_num=0, order_init=0x0, skip_order_by=false, group_init=0x0, having_init=0x0, proc_param_init=0x0, select_lex_arg=0x7f2ccc005120, unit_arg=0x7f2ccc0049b0) at /data/src/10.3/sql/sql_select.cc:1339
      #18 0x0000557f99e9481d in mysql_select (thd=0x7f2ccc000b00, tables=0x7f2ccc015a50, wild_num=0, fields=..., conds=0x0, og_num=0, order=0x0, group=0x0, having=0x0, proc_param=0x0, select_options=2416184064, result=0x7f2ccc0162a8, unit=0x7f2ccc0049b0, select_lex=0x7f2ccc005120) at /data/src/10.3/sql/sql_select.cc:4205
      #19 0x0000557f99e86874 in handle_select (thd=0x7f2ccc000b00, lex=0x7f2ccc0048e8, result=0x7f2ccc0162a8, setup_tables_done_option=0) at /data/src/10.3/sql/sql_select.cc:385
      #20 0x0000557f99e48dc0 in mysql_execute_command (thd=0x7f2ccc000b00) at /data/src/10.3/sql/sql_parse.cc:4239
      #21 0x0000557f99e55423 in mysql_parse (thd=0x7f2ccc000b00, rawbuf=0x7f2ccc014cd8 "CREATE TABLE t2 AS SELECT IFNULL( SLEEP(0.01), NULL DIV d ) AS f FROM t1", length=72, parser_state=0x7f2cde85d5f0, is_com_multi=false, is_next_command=false) at /data/src/10.3/sql/sql_parse.cc:8090
      #22 0x0000557f99e425e9 in dispatch_command (command=COM_QUERY, thd=0x7f2ccc000b00, packet=0x7f2ccc00b1e1 "CREATE TABLE t2 AS SELECT IFNULL( SLEEP(0.01), NULL DIV d ) AS f FROM t1", packet_length=72, is_com_multi=false, is_next_command=false) at /data/src/10.3/sql/sql_parse.cc:1850
      #23 0x0000557f99e4100d in do_command (thd=0x7f2ccc000b00) at /data/src/10.3/sql/sql_parse.cc:1395
      #24 0x0000557f99fa8a94 in do_handle_one_connection (connect=0x557f9d47ab30) at /data/src/10.3/sql/sql_connect.cc:1402
      #25 0x0000557f99fa8818 in handle_one_connection (arg=0x557f9d47ab30) at /data/src/10.3/sql/sql_connect.cc:1308
      #26 0x0000557f9a43daf5 in pfs_spawn_thread (arg=0x557f9d48e490) at /data/src/10.3/storage/perfschema/pfs.cc:1862
      #27 0x00007f2ce6172494 in start_thread (arg=0x7f2cde85e700) at pthread_create.c:333
      #28 0x00007f2ce477393f in clone () from /lib/x86_64-linux-gnu/libc.so.6
      

      Not reproducible on 10.2.

      Attachments

        Issue Links

          Activity

            People

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