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

Assertion `item->type() == Item::FIELD_ITEM' fails with outer_join_with_cache+join_cache_hashed, join_cache_level > 2

    XMLWordPrintable

Details

    • Bug
    • Status: Closed (View Workflow)
    • Blocker
    • Resolution: Fixed
    • 10.0.1, 5.5.30
    • 10.0.5, 5.5.33
    • None
    • None

    Description

      The problem appeared on 5.5 with the following merge:

      revno: 3671 [merge]
      revision-id: sergii@pisem.net-20130228214729-t0xhegqa9uzsr1k9
      parent: sergii@pisem.net-20130228191953-70sigyi7o2viwe53
      parent: sergii@pisem.net-20130228204847-vlit40812mz8af3u
      committer: Sergei Golubchik <sergii@pisem.net>
      branch nick: 5.5
      timestamp: Thu 2013-02-28 22:47:29 +0100
      message:
        5.3->5.5 merge

      It's possible that the underlying issue also exists on 5.3, but there is no visible indication of it.

      On 5.5:

      mysqld: /data/bzr/5.5/sql/sql_select.cc:1371: int JOIN::optimize(): Assertion `item->type() == Item::FIELD_ITEM' failed.
      130423  1:52:20 [ERROR] mysqld got signal 6 ;

      #7  0x00007faaa6625192 in __GI___assert_fail (assertion=0xd2ed00 "item->type() == Item::FIELD_ITEM", file=0xd2e9e0 "/data/bzr/5.5/sql/sql_select.cc", line=1371, function=0xd31d10 "int JOIN::optimize()") at assert.c:103
      #8  0x0000000000640b02 in JOIN::optimize (this=0x7faa900202f8) at /data/bzr/5.5/sql/sql_select.cc:1371
      #9  0x00000000006469e1 in mysql_select (thd=0x3117820, rref_pointer_array=0x311a828, tables=0x7faa900077f0, wild_num=1, fields=..., conds=0x7faa9001afd0, og_num=0, order=0x0, group=0x0, having=0x0, proc_param=0x0, select_options=2147748608, result=0x7faa9001b1b8, unit=0x3119ef8, select_lex=0x311a5d0) at /data/bzr/5.5/sql/sql_select.cc:3048
      #10 0x000000000063d5ea in handle_select (thd=0x3117820, lex=0x3119e48, result=0x7faa9001b1b8, setup_tables_done_option=0) at /data/bzr/5.5/sql/sql_select.cc:318
      #11 0x000000000061643d in execute_sqlcom_select (thd=0x3117820, all_tables=0x7faa900077f0) at /data/bzr/5.5/sql/sql_parse.cc:4641
      #12 0x000000000060ee8c in mysql_execute_command (thd=0x3117820) at /data/bzr/5.5/sql/sql_parse.cc:2195
      #13 0x0000000000618cdc in mysql_parse (thd=0x3117820, rawbuf=0x7faa900074c8 "SELECT * FROM country AS t1, country AS t2 LEFT JOIN country AS t3 ON ( t2.code = t3.code )\nWHERE t1.code = t2.code AND ( t1.code = ( SELECT MIN(code) FROM country ) OR 0 )", length=172, parser_state=0x7faa9bd08500) at /data/bzr/5.5/sql/sql_parse.cc:5759
      #14 0x000000000060c3dc in dispatch_command (command=COM_QUERY, thd=0x3117820, packet=0x320cc41 "SELECT * FROM country AS t1, country AS t2 LEFT JOIN country AS t3 ON ( t2.code = t3.code )\nWHERE t1.code = t2.code AND ( t1.code = ( SELECT MIN(code) FROM country ) OR 0 )", packet_length=172) at /data/bzr/5.5/sql/sql_parse.cc:1068
      #15 0x000000000060b61d in do_command (thd=0x3117820) at /data/bzr/5.5/sql/sql_parse.cc:794
      #16 0x000000000071092d in do_handle_one_connection (thd_arg=0x3117820) at /data/bzr/5.5/sql/sql_connect.cc:1266
      #17 0x0000000000710314 in handle_one_connection (arg=0x3117820) at /data/bzr/5.5/sql/sql_connect.cc:1181
      #18 0x000000000096c0b8 in pfs_spawn_thread (arg=0x31b5a70) at /data/bzr/5.5/storage/perfschema/pfs.cc:1015
      #19 0x00007faaa73f5e9a in start_thread (arg=0x7faa9bd09700) at pthread_create.c:308
      #20 0x00007faaa66e9cbd in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:112

      revision-id: knielsen@knielsen-hq.org-20130422142239-e1b8ly4fsw30i2c5
      revno: 3734
      branch-nick: 5.5
      BUILD/compile-pentium-debug-max-no-ndb

      Test case:

      SET join_cache_level=3;
      SET optimizer_switch = 'in_to_exists=on,outer_join_with_cache=on,join_cache_hashed=on';
      CREATE TABLE country (code varchar(3));
      INSERT INTO country VALUES ('USA'),('FRA');
       
      SELECT * FROM country AS t1, country AS t2 LEFT JOIN country AS t3 ON ( t2.code = t3.code )
      WHERE t1.code = t2.code AND ( t1.code = ( SELECT MIN(code) FROM country ) OR 0 ); 

      Minimal optimizer_switch: in_to_exists=on,outer_join_with_cache=on,join_cache_hashed=on
      Full optimizer_switch (default):

      index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=on,derived_merge=on,derived_with_keys=on,firstmatch=on,loosescan=on,materialization=on,in_to_exists=on,semijoin=on,partial_match_rowid_merge=on,partial_match_table_scan=on,subquery_cache=on,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=on,semijoin_with_cache=on,join_cache_incremental=on,join_cache_hashed=on,join_cache_bka=on,optimize_join_buffer_size=off,table_elimination=on,extended_keys=off

      EXPLAIN also fails.

      Attachments

        Issue Links

          Activity

            People

              igor Igor Babaev
              elenst Elena Stepanova
              Votes:
              0 Vote for this issue
              Watchers:
              2 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.