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

Assertion `!field->is_null()' failed in my_decimal::my_decimal fails in ONLY_FULL_GROUP_BY mode

    XMLWordPrintable

    Details

      Description

      CREATE TABLE t1(a INT, b DECIMAL(10, 0) NOT NULL);
      SET @@sql_mode='only_full_group_by';
      

      SELECT sum(a), bit_or(a) OVER () FROM t1;
      

      This query causes the assert failure.

      (lldb) bt
      * thread #2, stop reason = signal SIGABRT
        * frame #0: 0x00007fff6d8f133a libsystem_kernel.dylib`__pthread_kill + 10
          frame #1: 0x00007fff6d9ade60 libsystem_pthread.dylib`pthread_kill + 430
          frame #2: 0x00007fff6d878808 libsystem_c.dylib`abort + 120
          frame #3: 0x00007fff6d877ac6 libsystem_c.dylib`__assert_rtn + 314
          frame #4: 0x00000001006e1021 mysqld`my_decimal::my_decimal(this=0x00007000020bcde0, field=0x0000619000051b48) at my_decimal.cc:382:3
          frame #5: 0x00000001006e116d mysqld`my_decimal::my_decimal(this=0x00007000020bcde0, field=0x0000619000051b48) at my_decimal.cc:380:1
          frame #6: 0x00000001000fb231 mysqld`Field::do_field_decimal(copy=0x000062b000066958) at field_conv.cc:416:14
          frame #7: 0x0000000100f3ecb2 mysqld`copy_fields(param=0x000062b0000668b0) at sql_select.cc:25122:5
          frame #8: 0x0000000100f2de20 mysqld`end_write(join=0x000062b0000641f8, join_tab=0x000062b000066500, end_of_records=false) at sql_select.cc:21862:5
          frame #9: 0x0000000100f6643e mysqld`AGGR_OP::put_record(this=0x000062b000066bb8, end_of_records=false) at sql_select.cc:28705:30
          frame #10: 0x0000000100f33f67 mysqld`AGGR_OP::put_record(this=0x000062b000066bb8) at sql_select.h:1046:48
          frame #11: 0x0000000100eb5e29 mysqld`sub_select_postjoin_aggr(join=0x000062b0000641f8, join_tab=0x000062b000066500, end_of_records=false) at sql_select.cc:20162:13
          frame #12: 0x0000000100ecfde1 mysqld`do_select(join=0x000062b0000641f8, procedure=0x0000000000000000) at sql_select.cc:19980:14
          frame #13: 0x0000000100ecb54c mysqld`JOIN::exec_inner(this=0x000062b0000641f8) at sql_select.cc:4498:50
          frame #14: 0x0000000100ec73a2 mysqld`JOIN::exec(this=0x000062b0000641f8) at sql_select.cc:4280:3
          frame #15: 0x0000000100e1f178 mysqld`mysql_select(thd=0x000062b00005b270, tables=0x000062b000063130, wild_num=0, fields=0x000062b0000624a0, conds=0x0000000000000000, og_num=0, order=0x0000000000000000, group=0x0000000000000000, having=0x0000000000000000, proc_param=0x0000000000000000, select_options=2147748608, result=0x000062b0000641c8, unit=0x000062b00005f1c8, select_lex=0x000062b000062358) at sql_select.cc:4712:9
      
      

      These query needs to be rejected in the ONLY_FULL_GROUP_BY mode as window function has non-aggregated fields inside it

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              psergei Sergei Petrunia
              Reporter:
              varun Varun Gupta (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Dates

                Created:
                Updated:

                  Git Integration