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

Assertion `nr >= 0.0' failed in Item_std_field::val_real

    XMLWordPrintable

    Details

      Description

      CREATE TABLE t1 (a BIGINT);
      INSERT INTO t1 VALUES (4565524122246840320),(-3837066882519662592);
       
      SELECT STDDEV(CONCAT('1' + a, 10)) AS f FROM t1 GROUP BY CHAR(a);
       
      # Cleanup
      DROP TABLE t1;
      

      10.2 a4d4836f

      mysqld: /data/src/10.2/sql/item_sum.cc:2838: virtual double Item_std_field::val_real(): Assertion `nr >= 0.0' failed.
      210130 20:26:25 [ERROR] mysqld got signal 6 ;
       
      #7  0x00007fe547f7df36 in __GI___assert_fail (assertion=0x56331ce22da0 "nr >= 0.0", file=0x56331ce22918 "/data/src/10.2/sql/item_sum.cc", line=2838, function=0x56331ce23300 "virtual double Item_std_field::val_real()") at assert.c:101
      #8  0x000056331c629051 in Item_std_field::val_real (this=0x7fe5300158f8) at /data/src/10.2/sql/item_sum.cc:2838
      #9  0x000056331c56c1ec in Item::send (this=0x7fe5300158f8, protocol=0x7fe530001348, buffer=0x7fe5420d5c70) at /data/src/10.2/sql/item.cc:6953
      #10 0x000056331c1e1f7d in Protocol::send_result_set_row (this=0x7fe530001348, row_items=0x7fe530013ab0) at /data/src/10.2/sql/protocol.cc:992
      #11 0x000056331c278f8c in select_send::send_data (this=0x7fe530013710, items=...) at /data/src/10.2/sql/sql_class.cc:2734
      #12 0x000056331c334f00 in end_send (join=0x7fe530013730, join_tab=0x7fe530015170, end_of_records=false) at /data/src/10.2/sql/sql_select.cc:20030
      #13 0x000056331c332910 in evaluate_join_record (join=0x7fe530013730, join_tab=0x7fe530014dc0, error=0) at /data/src/10.2/sql/sql_select.cc:19078
      #14 0x000056331c347343 in AGGR_OP::end_send (this=0x7fe5300157b0) at /data/src/10.2/sql/sql_select.cc:26878
      #15 0x000056331c331c99 in sub_select_postjoin_aggr (join=0x7fe530013730, join_tab=0x7fe530014dc0, end_of_records=true) at /data/src/10.2/sql/sql_select.cc:18573
      #16 0x000056331c331fcd in sub_select (join=0x7fe530013730, join_tab=0x7fe530014a10, end_of_records=true) at /data/src/10.2/sql/sql_select.cc:18809
      #17 0x000056331c3317b1 in do_select (join=0x7fe530013730, procedure=0x0) at /data/src/10.2/sql/sql_select.cc:18404
      #18 0x000056331c30b3cf in JOIN::exec_inner (this=0x7fe530013730) at /data/src/10.2/sql/sql_select.cc:3641
      #19 0x000056331c30a876 in JOIN::exec (this=0x7fe530013730) at /data/src/10.2/sql/sql_select.cc:3436
      #20 0x000056331c30ba38 in mysql_select (thd=0x7fe530000d90, tables=0x7fe530012dd0, wild_num=0, fields=..., conds=0x0, og_num=1, order=0x0, group=0x7fe5300135f0, having=0x0, proc_param=0x0, select_options=2147748608, result=0x7fe530013710, unit=0x7fe530004988, select_lex=0x7fe5300050c8) at /data/src/10.2/sql/sql_select.cc:3836
      #21 0x000056331c2ffbb2 in handle_select (thd=0x7fe530000d90, lex=0x7fe5300048c8, result=0x7fe530013710, setup_tables_done_option=0) at /data/src/10.2/sql/sql_select.cc:361
      #22 0x000056331c2ca2bc in execute_sqlcom_select (thd=0x7fe530000d90, all_tables=0x7fe530012dd0) at /data/src/10.2/sql/sql_parse.cc:6248
      #23 0x000056331c2c0c6b in mysql_execute_command (thd=0x7fe530000d90) at /data/src/10.2/sql/sql_parse.cc:3559
      #24 0x000056331c2ce065 in mysql_parse (thd=0x7fe530000d90, rawbuf=0x7fe5300126f8 "SELECT STDDEV(CONCAT('1' + a, 10)) AS f FROM t1 GROUP BY CHAR(a)", length=64, parser_state=0x7fe5420d75f0, is_com_multi=false, is_next_command=false) at /data/src/10.2/sql/sql_parse.cc:7763
      #25 0x000056331c2bc33e in dispatch_command (command=COM_QUERY, thd=0x7fe530000d90, packet=0x7fe530008b51 "", packet_length=64, is_com_multi=false, is_next_command=false) at /data/src/10.2/sql/sql_parse.cc:1827
      #26 0x000056331c2bae39 in do_command (thd=0x7fe530000d90) at /data/src/10.2/sql/sql_parse.cc:1381
      #27 0x000056331c415754 in do_handle_one_connection (connect=0x56331f24a9c0) at /data/src/10.2/sql/sql_connect.cc:1336
      #28 0x000056331c4154b9 in handle_one_connection (arg=0x56331f24a9c0) at /data/src/10.2/sql/sql_connect.cc:1241
      #29 0x000056331cc3da48 in pfs_spawn_thread (arg=0x56331f22ddd0) at /data/src/10.2/storage/perfschema/pfs.cc:1869
      #30 0x00007fe54848d609 in start_thread (arg=<optimized out>) at pthread_create.c:477
      #31 0x00007fe548069293 in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95
      

      All of MariaDB 5.5-10.6 and (at least) MySQL 5.6-8.0 are affected.

      The corresponding upstream bug report is probably the internal #16521799 mentioned in the comments to https://bugs.mysql.com/bug.php?id=74946 (the test case from #74946 itself does not fail on MariaDB, only on MySQL, but it doesn't have STDDEV which the comment mentions).

        Attachments

          Activity

            People

            Assignee:
            sanja Oleksandr Byelkin
            Reporter:
            elenst Elena Stepanova
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Dates

              Created:
              Updated:

                Git Integration