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

JSON_TABLE: Assertion `l_offset >= 0 && table->s->rec_buff_length - l_offset > 0' failed upon CREATE .. SELECT

    XMLWordPrintable

Details

    Description

      Maybe the root cause is outside JSON_TABLE, but I couldn't modify the test case to avoid using JSON_TABLE.

      SET NAMES utf8;
      CREATE TABLE t AS SELECT * FROM JSON_TABLE('{}', '$' COLUMNS(a CHAR(16) PATH '$.*', b TIMESTAMP PATH '$**.*')) AS jt;
       
      # Cleanup
      DROP TABLE t;
      

      bb-10.6-mdev17399-hf 3530463bc2

      mariadbd: /data/src/bb-10.6-mdev17399-hf/sql/field.h:1155: const uchar* Field::ptr_in_record(const uchar*) const: Assertion `l_offset >= 0 && table->s->rec_buff_length - l_offset > 0' failed.
      210318 18:27:31 [ERROR] mysqld got signal 6 ;
       
      #7  0x00007f36c5e95f36 in __GI___assert_fail (assertion=0x560847f659a0 "l_offset >= 0 && table->s->rec_buff_length - l_offset > 0", file=0x560847f656e0 "/data/src/bb-10.6-mdev17399-hf/sql/field.h", line=1155, function=0x560847f65a00 "const uchar* Field::ptr_in_record(const uchar*) const") at assert.c:101
      #8  0x000056084619ac0e in Field::ptr_in_record (this=0x61900008a918, record=0x61900008aa38 "\377", ' ' <repeats 16 times>) at /data/src/bb-10.6-mdev17399-hf/sql/field.h:1155
      #9  0x00005608465e3289 in Column_definition::Column_definition (this=0x62b00003c728, thd=0x62b000069288, old_field=0x62b00003c648, orig_field=0x61900008a918) at /data/src/bb-10.6-mdev17399-hf/sql/field.cc:10816
      #10 0x0000560845d7ae4c in Create_field::Create_field (this=0x62b00003c728, thd=0x62b000069288, old_field=0x62b00003c648, orig_field=0x61900008a918) at /data/src/bb-10.6-mdev17399-hf/sql/field.h:5616
      #11 0x0000560845d7206c in select_create::create_table_from_items (this=0x62b00003b998, thd=0x62b000069288, items=0x7f36bcccee70, lock=0x7f36bcccee50, hooks=0x7f36bccceef0) at /data/src/bb-10.6-mdev17399-hf/sql/sql_insert.cc:4421
      #12 0x0000560845d73f47 in select_create::prepare (this=0x62b00003b998, _values=..., u=0x62b00006d460) at /data/src/bb-10.6-mdev17399-hf/sql/sql_insert.cc:4663
      #13 0x0000560845ecbf2d in JOIN::prepare (this=0x62b00003baa0, tables_init=0x62b00003a850, conds_init=0x0, og_num=0, order_init=0x0, skip_order_by=false, group_init=0x0, having_init=0x0, proc_param_init=0x0, select_lex_arg=0x62b000038b78, unit_arg=0x62b00006d460) at /data/src/bb-10.6-mdev17399-hf/sql/sql_select.cc:1515
      #14 0x0000560845eee223 in mysql_select (thd=0x62b000069288, tables=0x62b00003a850, fields=..., conds=0x0, og_num=0, order=0x0, group=0x0, having=0x0, proc_param=0x0, select_options=2201171004160, result=0x62b00003b998, unit=0x62b00006d460, select_lex=0x62b000038b78) at /data/src/bb-10.6-mdev17399-hf/sql/sql_select.cc:4723
      #15 0x0000560845ebf822 in handle_select (thd=0x62b000069288, lex=0x62b00006d398, result=0x62b00003b998, setup_tables_done_option=0) at /data/src/bb-10.6-mdev17399-hf/sql/sql_select.cc:417
      #16 0x00005608460d341c in Sql_cmd_create_table_like::execute (this=0x62b000038400, thd=0x62b000069288) at /data/src/bb-10.6-mdev17399-hf/sql/sql_table.cc:12205
      #17 0x0000560845e27440 in mysql_execute_command (thd=0x62b000069288) at /data/src/bb-10.6-mdev17399-hf/sql/sql_parse.cc:5972
      #18 0x0000560845e34c6d in mysql_parse (thd=0x62b000069288, rawbuf=0x62b0000382a8 "CREATE TABLE t AS SELECT * FROM JSON_TABLE('{}', '$' COLUMNS(a CHAR(16) PATH '$.*', b TIMESTAMP PATH '$**.*')) AS jt", length=116, parser_state=0x7f36bccd07b0) at /data/src/bb-10.6-mdev17399-hf/sql/sql_parse.cc:8000
      #19 0x0000560845e0b6a8 in dispatch_command (command=COM_QUERY, thd=0x62b000069288, packet=0x62900024e289 "CREATE TABLE t AS SELECT * FROM JSON_TABLE('{}', '$' COLUMNS(a CHAR(16) PATH '$.*', b TIMESTAMP PATH '$**.*')) AS jt", packet_length=116, blocking=true) at /data/src/bb-10.6-mdev17399-hf/sql/sql_parse.cc:1886
      #20 0x0000560845e083e3 in do_command (thd=0x62b000069288, blocking=true) at /data/src/bb-10.6-mdev17399-hf/sql/sql_parse.cc:1397
      #21 0x0000560846249e85 in do_handle_one_connection (connect=0x61100000ad48, put_in_cache=true) at /data/src/bb-10.6-mdev17399-hf/sql/sql_connect.cc:1410
      #22 0x00005608462497e2 in handle_one_connection (arg=0x61100000ac08) at /data/src/bb-10.6-mdev17399-hf/sql/sql_connect.cc:1312
      #23 0x0000560846f5408b in pfs_spawn_thread (arg=0x616000102a08) at /data/src/bb-10.6-mdev17399-hf/storage/perfschema/pfs.cc:2201
      #24 0x00007f36c63ad609 in start_thread (arg=<optimized out>) at pthread_create.c:477
      #25 0x00007f36c5f81293 in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95
      

      Attachments

        Issue Links

          Activity

            People

              holyfoot Alexey Botchkov
              elenst Elena Stepanova
              Votes:
              0 Vote for this issue
              Watchers:
              1 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.