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

Assertion `je->state == JST_KEY' failed in Geometry::create_from_json

    XMLWordPrintable

Details

    Description

      Ref MDEV-19723

      SELECT ST_ASTEXT (ST_GEOMFROMGEOJSON ("{ \"type\": \"GEOMETRYCOLLECTION\", \"coordinates\": [102.0, 0.0]}"));
      

      Leads to:

      10.6.0 a3e3225cd3b816d47621e749e21a71b6a864a96a (Debug)

      mysqld: /test/10.6_dbg/sql/spatial.cc:513: static Geometry* Geometry::create_from_json(Geometry_buffer*, json_engine_t*, bool, String*): Assertion `je->state == JST_KEY' failed.
      

      10.6.0 a3e3225cd3b816d47621e749e21a71b6a864a96a (Debug)

      Core was generated by `/test/MD150421-mariadb-10.6.0-linux-x86_64-dbg/bin/mysqld --no-defaults --core-'.
      Program terminated with signal SIGABRT, Aborted.
      #0  __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50
      [Current thread is 1 (Thread 0x14caec984700 (LWP 2315813))]
      (gdb) bt
      #0  __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50
      #1  0x000014caf7de9859 in __GI_abort () at abort.c:79
      #2  0x000014caf7de9729 in __assert_fail_base (fmt=0x14caf7f7f588 "%s%s%s:%u: %s%sAssertion `%s' failed.\n%n", assertion=0x55799330b991 "je->state == JST_KEY", file=0x55799330b8d9 "/test/10.6_dbg/sql/spatial.cc", line=513, function=<optimized out>) at assert.c:92
      #3  0x000014caf7dfaf36 in __GI___assert_fail (assertion=assertion@entry=0x55799330b991 "je->state == JST_KEY", file=file@entry=0x55799330b8d9 "/test/10.6_dbg/sql/spatial.cc", line=line@entry=513, function=function@entry=0x55799330be10 "static Geometry* Geometry::create_from_json(Geometry_buffer*, json_engine_t*, bool, String*)") at assert.c:101
      #4  0x0000557992965e65 in Geometry::create_from_json (buffer=buffer@entry=0x14caec9821d0, je=je@entry=0x14caec9820e0, er_on_3D=er_on_3D@entry=false, res=res@entry=0x14caec982240) at /test/10.6_dbg/sql/spatial.cc:513
      #5  0x0000557992840fa2 in Item_func_geometry_from_json::val_str (this=0x14ca94014488, str=0x14caec982240) at /test/10.6_dbg/sql/item_geofunc.cc:159
      #6  0x000055799284229b in Item_func_as_wkt::val_str_ascii (this=0x14ca940145f8, str=0x14caec9823d0) at /test/10.6_dbg/sql/item_geofunc.cc:201
      #7  0x000055799286caf8 in Item_func::val_str_from_val_str_ascii (this=0x14ca940145f8, str=0x14caec9823d0, ascii_buffer=0x14ca940146c0) at /test/10.6_dbg/sql/item_strfunc.cc:98
      #8  0x000055799280a3ea in Item_str_ascii_func::val_str (this=<optimized out>, str=<optimized out>) at /test/10.6_dbg/sql/item_strfunc.h:88
      #9  0x00005579926abb46 in Type_handler::Item_send_str (this=<optimized out>, item=0x14ca940145f8, protocol=0x14ca940013a0, buf=<optimized out>) at /test/10.6_dbg/sql/sql_type.cc:7434
      #10 0x00005579925f9061 in Type_handler_string_result::Item_send (this=<optimized out>, item=<optimized out>, protocol=<optimized out>, buf=<optimized out>) at /test/10.6_dbg/sql/sql_type.h:5434
      #11 0x00005579923b51c2 in Item::send (this=0x14ca940145f8, protocol=0x14ca940013a0, buffer=0x14caec9823a0) at /test/10.6_dbg/sql/item.h:1066
      #12 0x00005579923b28cc in Protocol::send_result_set_row (this=this@entry=0x14ca940013a0, row_items=row_items@entry=0x14ca94013f98) at /test/10.6_dbg/sql/protocol.cc:1331
      #13 0x0000557992448cd1 in select_send::send_data (this=0x14ca94015010, items=@0x14ca94013f98: {<base_list> = {<Sql_alloc> = {<No data fields>}, first = 0x14ca940146e0, last = 0x14ca940146e0, elements = 1}, <No data fields>}) at /test/10.6_dbg/sql/sql_class.cc:3020
      #14 0x00005579925393bd in select_result_sink::send_data_with_check (sent=0, u=<optimized out>, items=<optimized out>, this=<optimized out>) at /test/10.6_dbg/sql/sql_class.h:5567
      #15 JOIN::exec_inner (this=this@entry=0x14ca94015038) at /test/10.6_dbg/sql/sql_select.cc:4361
      #16 0x000055799253a41a in JOIN::exec (this=this@entry=0x14ca94015038) at /test/10.6_dbg/sql/sql_select.cc:4273
      #17 0x00005579925384f3 in mysql_select (thd=thd@entry=0x14ca94000db8, tables=0x0, fields=@0x14ca94013f98: {<base_list> = {<Sql_alloc> = {<No data fields>}, first = 0x14ca940146e0, last = 0x14ca940146e0, elements = 1}, <No data fields>}, conds=0x0, og_num=0, order=0x0, group=0x0, having=0x0, proc_param=0x0, select_options=2147748608, result=0x14ca94015010, unit=0x14ca94004f90, select_lex=0x14ca94013e48) at /test/10.6_dbg/sql/sql_select.cc:4749
      #18 0x00005579925387b9 in handle_select (thd=thd@entry=0x14ca94000db8, lex=lex@entry=0x14ca94004ec8, result=result@entry=0x14ca94015010, setup_tables_done_option=setup_tables_done_option@entry=0) at /test/10.6_dbg/sql/sql_select.cc:419
      #19 0x00005579924ab8b5 in execute_sqlcom_select (thd=thd@entry=0x14ca94000db8, all_tables=0x0) at /test/10.6_dbg/sql/sql_parse.cc:6244
      #20 0x00005579924b877d in mysql_execute_command (thd=thd@entry=0x14ca94000db8) at /test/10.6_dbg/sql/sql_parse.cc:3940
      #21 0x00005579924a4a06 in mysql_parse (thd=thd@entry=0x14ca94000db8, rawbuf=<optimized out>, length=<optimized out>, parser_state=parser_state@entry=0x14caec983410) at /test/10.6_dbg/sql/sql_parse.cc:8017
      #22 0x00005579924b37df in dispatch_command (command=command@entry=COM_QUERY, thd=thd@entry=0x14ca94000db8, packet=packet@entry=0x14ca9400b369 "", packet_length=packet_length@entry=108, blocking=blocking@entry=true) at /test/10.6_dbg/sql/sql_class.h:1331
      #23 0x00005579924b6bd5 in do_command (thd=0x14ca94000db8, blocking=blocking@entry=true) at /test/10.6_dbg/sql/sql_parse.cc:1406
      #24 0x000055799261077c in do_handle_one_connection (connect=<optimized out>, connect@entry=0x55799624e518, put_in_cache=put_in_cache@entry=true) at /test/10.6_dbg/sql/sql_connect.cc:1410
      #25 0x0000557992610d81 in handle_one_connection (arg=arg@entry=0x55799624e518) at /test/10.6_dbg/sql/sql_connect.cc:1312
      #26 0x0000557992abea03 in pfs_spawn_thread (arg=0x557996172c98) at /test/10.6_dbg/storage/perfschema/pfs.cc:2201
      #27 0x000014caf82f7609 in start_thread (arg=<optimized out>) at pthread_create.c:477
      #28 0x000014caf7ee6293 in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95
      

      Bug confirmed present in:
      MariaDB: 10.2.38 (dbg), 10.3.29 (dbg), 10.4.19 (dbg), 10.5.10 (dbg), 10.6.0 (dbg)

      Bug (or feature/syntax) confirmed not present in:
      MariaDB: 10.2.38 (opt), 10.3.29 (opt), 10.4.19 (opt), 10.5.10 (opt), 10.6.0 (opt)
      MySQL: 5.5.62 (dbg), 5.5.62 (opt), 5.6.51 (dbg), 5.6.51 (opt), 5.7.33 (dbg), 5.7.33 (opt), 8.0.23 (dbg), 8.0.23 (opt)

      This issue remains critical (affect_tests), as other issues may be masked due to the generic outcome. Please fix asap.

      Attachments

        Issue Links

          Activity

            People

              holyfoot Alexey Botchkov
              Roel Roel Van de Paar
              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.