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

Assertion failed: precision > 0 in decimal_bin_size upon SELECT with DISTINCT, CAST and other functions

    XMLWordPrintable

Details

    • Bug
    • Status: Closed (View Workflow)
    • Minor
    • Resolution: Fixed
    • 5.5, 10.0, 10.1, 10.2
    • 10.2.24, 10.1.39
    • Data types
    • None

    Description

      CREATE TABLE t1 (b LONGBLOB);
      INSERT IGNORE INTO t1 VALUES ('foo'),('bar');
      SELECT DISTINCT - GREATEST( b, CAST( NULL AS DATETIME ) ) AS f FROM t1;
       
      # Cleanup
      DROP TABLE t1;
      

      10.0 a660a5ed4

      mysqld: /data/src/10.0/strings/decimal.c:1460: decimal_bin_size: Assertion `precision > 0' failed.
      181003 12:12:48 [ERROR] mysqld got signal 6 ;
       
      #7  0x00007fa7001ccee2 in __assert_fail () from /lib/x86_64-linux-gnu/libc.so.6
      #8  0x0000000000e689e8 in decimal_bin_size (precision=-1, scale=6) at /data/src/10.0/strings/decimal.c:1460
      #9  0x00000000006c0e3e in my_decimal_get_binary_size (precision=4294967295, scale=6) at /data/src/10.0/sql/my_decimal.h:263
      #10 0x00000000006b7b55 in calc_group_buffer (join=0x7fa6f88fad68, group=0x7fa6f88fbfa8) at /data/src/10.0/sql/sql_select.cc:22093
      #11 0x0000000000685199 in JOIN::optimize_inner (this=0x7fa6f88fad68) at /data/src/10.0/sql/sql_select.cc:1755
      #12 0x00000000006827fc in JOIN::optimize (this=0x7fa6f88fad68) at /data/src/10.0/sql/sql_select.cc:1041
      #13 0x000000000068a7bd in mysql_select (thd=0x7fa6fa2a2070, rref_pointer_array=0x7fa6fa2a63a0, tables=0x7fa6f88fa6b0, wild_num=0, fields=..., conds=0x0, og_num=0, order=0x0, group=0x0, having=0x0, proc_param=0x0, select_options=2147748609, result=0x7fa6f88fad48, unit=0x7fa6fa2a5a08, select_lex=0x7fa6fa2a60f8) at /data/src/10.0/sql/sql_select.cc:3334
      #14 0x00000000006808c4 in handle_select (thd=0x7fa6fa2a2070, lex=0x7fa6fa2a5940, result=0x7fa6f88fad48, setup_tables_done_option=0) at /data/src/10.0/sql/sql_select.cc:377
      #15 0x0000000000654db7 in execute_sqlcom_select (thd=0x7fa6fa2a2070, all_tables=0x7fa6f88fa6b0) at /data/src/10.0/sql/sql_parse.cc:5301
      #16 0x000000000064d30d in mysql_execute_command (thd=0x7fa6fa2a2070) at /data/src/10.0/sql/sql_parse.cc:2557
      #17 0x0000000000657c14 in mysql_parse (thd=0x7fa6fa2a2070, rawbuf=0x7fa6f88fa088 "SELECT DISTINCT - GREATEST( b, CAST( NULL AS DATETIME ) ) AS f FROM t1", length=70, parser_state=0x7fa70229c640) at /data/src/10.0/sql/sql_parse.cc:6637
      #18 0x000000000064a534 in dispatch_command (command=COM_QUERY, thd=0x7fa6fa2a2070, packet=0x7fa6fb7e5071 "SELECT DISTINCT - GREATEST( b, CAST( NULL AS DATETIME ) ) AS f FROM t1", packet_length=70) at /data/src/10.0/sql/sql_parse.cc:1300
      #19 0x0000000000649834 in do_command (thd=0x7fa6fa2a2070) at /data/src/10.0/sql/sql_parse.cc:1003
      #20 0x000000000076af50 in do_handle_one_connection (thd_arg=0x7fa6fa2a2070) at /data/src/10.0/sql/sql_connect.cc:1377
      #21 0x000000000076acc2 in handle_one_connection (arg=0x7fa6fa2a2070) at /data/src/10.0/sql/sql_connect.cc:1292
      #22 0x0000000000acc98e in pfs_spawn_thread (arg=0x7fa6fa1a2370) at /data/src/10.0/storage/perfschema/pfs.cc:1861
      #23 0x00007fa701ed0494 in start_thread (arg=0x7fa70229d700) at pthread_create.c:333
      #24 0x00007fa70028993f in clone () from /lib/x86_64-linux-gnu/libc.so.6
      

      Reproducible on 5.5, 10.0, 10.1, 10.2.
      Couldn't reproduce on 10.3.

      Attachments

        Issue Links

          Activity

            People

              bar Alexander Barkov
              elenst Elena Stepanova
              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.