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

JSON_TABLE: Assertion `!cmp(&table_ref->db, &table_ref->table->s->db) || (table_ref->schema_table && is_infoschema_db(&table_ref->table->s->db)) || table_ref->is_materialized_derived()' failed on NATURAL JOIN between JSON tables

    XMLWordPrintable

Details

    • Bug
    • Status: Closed (View Workflow)
    • Major
    • Resolution: Fixed
    • N/A
    • N/A
    • JSON
    • None

    Description

      MariaDB [test]> select * from json_table('{"a":"foo"}', '$' columns (f for ordinality)) as jt1 natural join json_table('{"a":"bar"}', '$' columns (f for ordinality)) as jt2;
      ERROR 2013 (HY000): Lost connection to MySQL server during query
      

      bb-10.5-hf 6dfb3fab2

      mysqld: /data/src/bb-10.5-hf/sql/table.cc:6487: const char* Natural_join_column::safe_db_name(): Assertion `!cmp(&table_ref->db, &table_ref->table->s->db) 
      || (table_ref->schema_table && is_infoschema_db(&table_ref->table->s->db)) || table_ref->is_materialized_derived()' failed.
      200419  1:48:42 [ERROR] mysqld got signal 6 ;
       
      #7  0x00007f5e3345c102 in __GI___assert_fail (assertion=0x55e6bdd730e0 "!cmp(&table_ref->db, &table_ref->table->s->db) || (table_ref->schema_table && is_infoschema_db(&table_ref->table->s->db)) || table_ref->is_materialized_derived()", file=0x55e6bdd6e620 "/data/src/bb-10.5-hf/sql/table.cc", line=6487, function=0x55e6bdd775c0 <Natural_join_column::safe_db_name()::__PRETTY_FUNCTION__> "const char* Natural_join_column::safe_db_name()") at assert.c:101
      #8  0x000055e6bc119051 in Natural_join_column::safe_db_name (this=0x62b00008a168) at /data/src/bb-10.5-hf/sql/table.cc:6483
      #9  0x000055e6bc11c40f in Field_iterator_table_ref::get_db_name (this=0x7f5e1008b790) at /data/src/bb-10.5-hf/sql/table.cc:6728
      #10 0x000055e6bbbfb00a in check_grant_all_columns (thd=0x62b00007e270, want_access_arg=SELECT_ACL, fields=0x7f5e1008b790) at /data/src/bb-10.5-hf/sql/sql_acl.cc:8271
      #11 0x000055e6bbc67b09 in insert_fields (thd=0x62b00007e270, context=0x62b000085498, db_name=0x0, table_name=0x0, it=0x7f5e1008bd30, any_privileges=false, hidden_bit_fields=0x62b000085750) at /data/src/bb-10.5-hf/sql/sql_base.cc:8056
      #12 0x000055e6bbc63a18 in setup_wild (thd=0x62b00007e270, tables=0x62b000086ad0, fields=..., sum_func_list=0x62b000089d68, select_lex=0x62b000085440) at /data/src/bb-10.5-hf/sql/sql_base.cc:7506
      #13 0x000055e6bbe807d1 in JOIN::prepare (this=0x62b000089a48, tables_init=0x62b000086ad0, 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=0x62b000085440, unit_arg=0x62b0000821b8) at /data/src/bb-10.5-hf/sql/sql_select.cc:1230
      #14 0x000055e6bbea5d21 in mysql_select (thd=0x62b00007e270, tables=0x62b000086ad0, fields=..., conds=0x0, og_num=0, order=0x0, group=0x0, having=0x0, proc_param=0x0, select_options=2147748608, result=0x62b000089a18, unit=0x62b0000821b8, select_lex=0x62b000085440) at /data/src/bb-10.5-hf/sql/sql_select.cc:4634
      #15 0x000055e6bbe78430 in handle_select (thd=0x62b00007e270, lex=0x62b0000820f8, result=0x62b000089a18, setup_tables_done_option=0) at /data/src/bb-10.5-hf/sql/sql_select.cc:416
      #16 0x000055e6bbdeaa48 in execute_sqlcom_select (thd=0x62b00007e270, all_tables=0x62b000086ad0) at /data/src/bb-10.5-hf/sql/sql_parse.cc:6138
      #17 0x000055e6bbdd94fb in mysql_execute_command (thd=0x62b00007e270) at /data/src/bb-10.5-hf/sql/sql_parse.cc:3904
      #18 0x000055e6bbdf5836 in mysql_parse (thd=0x62b00007e270, rawbuf=0x62b000085290 "select * from json_table('{\"a\":\"foo\"}', '$' columns (f for ordinality)) as jt1 natural join json_table('{\"a\":\"bar\"}', '$' columns (f for ordinality)) as jt2", length=156, parser_state=0x7f5e1008da90, is_com_multi=false, is_next_command=false) at /data/src/bb-10.5-hf/sql/sql_parse.cc:7918
      #19 0x000055e6bbdcc08c in dispatch_command (command=COM_QUERY, thd=0x62b00007e270, packet=0x6290000d7271 "select * from json_table('{\"a\":\"foo\"}', '$' columns (f for ordinality)) as jt1 natural join json_table('{\"a\":\"bar\"}', '$' columns (f for ordinality)) as jt2", packet_length=156, is_com_multi=false, is_next_command=false) at /data/src/bb-10.5-hf/sql/sql_parse.cc:1844
      #20 0x000055e6bbdc8ace in do_command (thd=0x62b00007e270) at /data/src/bb-10.5-hf/sql/sql_parse.cc:1363
      #21 0x000055e6bc1e1072 in do_handle_one_connection (connect=0x6100000046b0, put_in_cache=true) at /data/src/bb-10.5-hf/sql/sql_connect.cc:1422
      #22 0x000055e6bc1e0908 in handle_one_connection (arg=0x6100000045b0) at /data/src/bb-10.5-hf/sql/sql_connect.cc:1319
      #23 0x00007f5e33cd6fa3 in start_thread (arg=<optimized out>) at pthread_create.c:486
      #24 0x00007f5e335254cf 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.