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

Assertion `0' failed in Item_sum_str::reset_field after selecting st_collect + group by

Details

    • Bug
    • Status: In Progress (View Workflow)
    • Major
    • Resolution: Unresolved
    • None
    • 12.0
    • GIS
    • None

    Description

      CREATE TABLE t1 (a int, p point );
      INSERT INTO t1 VALUES (0,st_geomfromtext('POINT(1 1)')), ( 1,st_geomfromtext('POINT(0 0)')), ( 0,st_geomfromtext('POINT(1 1)'));
       
      SELECT st_astext(ST_COLLECT(p)) FROM t1 GROUP BY a;
      DROP TABLE t1;
      

      bb-11.7-mdev-34120-gis-functions branch

      mariadbd: /11/sql/item_sum.h:2006: virtual void Item_sum_str::reset_field(): Assertion `0' failed.
      250225 16:34:15 [ERROR] mysqld got signal 6 ;
       
      /lib/x86_64-linux-gnu/libc.so.6(+0x33fd6)[0x7f782f428fd6]
      sql/item_sum.h:2006(Item_sum_str::reset_field())[0x5627dae89fb4]
      sql/sql_select.cc:29186(init_tmptable_sum_functions(Item_sum**))[0x5627da9def84]
      sql/sql_select.cc:25354(end_update(JOIN*, st_join_table*, bool))[0x5627da9c42c5]
      sql/sql_select.cc:32678(AGGR_OP::put_record(bool))[0x5627da9f98e9]
      sql/sql_select.h:1186(AGGR_OP::put_record())[0x5627daa0ed25]
      sql/sql_select.cc:23348(sub_select_postjoin_aggr(JOIN*, st_join_table*, bool))[0x5627da9b5510]
      sql/sql_select.cc:23897(evaluate_join_record(JOIN*, st_join_table*, int))[0x5627da9b835e]
      sql/sql_select.cc:23664(sub_select(JOIN*, st_join_table*, bool))[0x5627da9b6b6d]
      sql/sql_select.cc:23175(do_select(JOIN*, Procedure*))[0x5627da9b4331]
      sql/sql_select.cc:5029(JOIN::exec_inner())[0x5627da93082f]
      sql/sql_select.cc:4812(JOIN::exec())[0x5627da92dba6]
      sql/sql_select.cc:5345(mysql_select(THD*, TABLE_LIST*, List<Item>&, Item*, unsigned int, st_order*, st_order*, Item*, st_order*, unsigned long long, select_result*, st_select_lex_unit*, st_select_lex*))[0x5627da932464]
      sql/sql_select.cc:628(handle_select(THD*, LEX*, select_result*, unsigned long long))[0x5627da8ffe9a]
      sql/sql_parse.cc:6154(execute_sqlcom_select(THD*, TABLE_LIST*))[0x5627da81be01]
      sql/sql_parse.cc:3954(mysql_execute_command(THD*, bool))[0x5627da80b9ab]
      sql/sql_parse.cc:7876(mysql_parse(THD*, char*, unsigned int, Parser_state*))[0x5627da826e60]
      sql/sql_parse.cc:1894(dispatch_command(enum_server_command, THD*, char*, unsigned int, bool))[0x5627da7fd475]
      sql/sql_parse.cc:1405(do_command(THD*, bool))[0x5627da7fa118]
      sql/sql_connect.cc:1448(do_handle_one_connection(CONNECT*, bool))[0x5627dad01c0a]
      sql/sql_connect.cc:1352(handle_one_connection)[0x5627dad01595]
      perfschema/pfs.cc:2200(pfs_spawn_thread)[0x5627dba0cb08]
      nptl/pthread_create.c:478(start_thread)[0x7f782f9d9609]
       
      Query (0x6290001092a8): SELECT st_astext(ST_COLLECT(p)) FROM t1 GROUP BY a
      

      Attachments

        Issue Links

          Activity

            Gosselin Dave Gosselin added a comment - - edited

            MySQL crashes for this use case. I'll fix our implementation such that we don't crash but return NULLs instead actually I think I can do better than this and return aggregate results.

            Gosselin Dave Gosselin added a comment - - edited MySQL crashes for this use case. I'll fix our implementation such that we don't crash but return NULLs instead actually I think I can do better than this and return aggregate results.

            People

              Gosselin Dave Gosselin
              alice Alice Sherepa
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:

                Git Integration

                  Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.