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

Assertion `!(*exec_tab) || (*exec_tab >= first_tab && *exec_tab < last_tab)' fails in Item_func_dynamic_cond::val_int() with static_cond_pushdown=on

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 10.0.6
    • Component/s: None
    • Labels:
      None

      Description

      mysqld: /home/elenst/bzr/10.0-mdev83/sql/item_cmpfunc.cc:6647: virtual longlong Item_func_dynamic_cond::val_int(): Assertion `!(*exec_tab) || (*exec_tab >= first_tab && *exec_tab < last_tab)' failed.
      131029 13:15:41 [ERROR] mysqld got signal 6 ;

      #7  0x00007fa7a0666192 in __GI___assert_fail (assertion=0xe8e968 "!(*exec_tab) || (*exec_tab >= first_tab && *exec_tab < last_tab)", file=0xe8e2a8 "/home/elenst/bzr/10.0-mdev83/sql/item_cmpfunc.cc", line=6647, function=0xe8ec20 "virtual longlong Item_func_dynamic_cond::val_int()") at assert.c:103
      #8  0x00000000008461d0 in Item_func_dynamic_cond::val_int (this=0x7fa79a8fa8a0) at /home/elenst/bzr/10.0-mdev83/sql/item_cmpfunc.cc:6647
      #9  0x00000000006f2b68 in SQL_SELECT::skip_record (this=0x7fa79ab15570, thd=0x7fa79bc06070) at /home/elenst/bzr/10.0-mdev83/sql/opt_range.h:1007
      #10 0x000000000077a08e in JOIN_CACHE::check_match (this=0x7fa79ab15968, rec_ptr=0x7fa79a8d8075 "\374 N") at /home/elenst/bzr/10.0-mdev83/sql/sql_join_cache.cc:2449
      #11 0x0000000000775e8f in JOIN_CACHE::generate_full_extensions (this=0x7fa79ab15968, rec_ptr=0x7fa79a8d8075 "\374 N") at /home/elenst/bzr/10.0-mdev83/sql/sql_join_cache.cc:2390
      #12 0x0000000000775c92 in JOIN_CACHE::join_matching_records (this=0x7fa79ab15968, skip_last=false) at /home/elenst/bzr/10.0-mdev83/sql/sql_join_cache.cc:2290
      #13 0x00000000007756f0 in JOIN_CACHE::join_records (this=0x7fa79ab15968, skip_last=false) at /home/elenst/bzr/10.0-mdev83/sql/sql_join_cache.cc:2087
      #14 0x0000000000683262 in sub_select_cache (join=0x7fa79a98b088, join_tab=0x7fa79ab143c8, end_of_records=true) at /home/elenst/bzr/10.0-mdev83/sql/sql_select.cc:17307
      #15 0x0000000000683463 in sub_select (join=0x7fa79a98b088, join_tab=0x7fa79ab14088, end_of_records=true) at /home/elenst/bzr/10.0-mdev83/sql/sql_select.cc:17477
      #16 0x0000000000682eaa in do_select (join=0x7fa79a98b088, fields=0x7fa79a98b458, table=0x0, procedure=0x0) at /home/elenst/bzr/10.0-mdev83/sql/sql_select.cc:17171
      #17 0x000000000066054c in JOIN::exec_inner (this=0x7fa79a98b088) at /home/elenst/bzr/10.0-mdev83/sql/sql_select.cc:3124
      #18 0x000000000065d7e4 in JOIN::exec (this=0x7fa79a98b088) at /home/elenst/bzr/10.0-mdev83/sql/sql_select.cc:2417
      #19 0x0000000000660e07 in mysql_select (thd=0x7fa79bc06070, rref_pointer_array=0x7fa79bc09f38, tables=0x7fa79aae94c0, wild_num=0, fields=..., conds=0x7fa79a8b5ca8, og_num=0, order=0x0, group=0x0, having=0x0, proc_param=0x0, select_options=2147748608, result=0x7fa79a8b5e88, unit=0x7fa79bc095f8, select_lex=0x7fa79bc09cc8) at /home/elenst/bzr/10.0-mdev83/sql/sql_select.cc:3352
      #20 0x0000000000657092 in handle_select (thd=0x7fa79bc06070, lex=0x7fa79bc09540, result=0x7fa79a8b5e88, setup_tables_done_option=0) at /home/elenst/bzr/10.0-mdev83/sql/sql_select.cc:427
      #21 0x000000000062ab0a in execute_sqlcom_select (thd=0x7fa79bc06070, all_tables=0x7fa79aae94c0) at /home/elenst/bzr/10.0-mdev83/sql/sql_parse.cc:4894
      #22 0x0000000000622f49 in mysql_execute_command (thd=0x7fa79bc06070) at /home/elenst/bzr/10.0-mdev83/sql/sql_parse.cc:2293
      #23 0x000000000062d377 in mysql_parse (thd=0x7fa79bc06070, rawbuf=0x7fa79aae9088 "SELECT COUNT(*) FROM city_lang AS outer1, city_lang AS outer2 \nWHERE outer2.lang IN ( SELECT name FROM language ) \nAND ( outer1.population IS NULL OR outer2.lang IN ( SELECT name FROM language ) )", length=196, parser_state=0x7fa7a1e294e0) at /home/elenst/bzr/10.0-mdev83/sql/sql_parse.cc:6018
      #24 0x00000000006201a6 in dispatch_command (command=COM_QUERY, thd=0x7fa79bc06070, packet=0x7fa79effa071 "", packet_length=196) at /home/elenst/bzr/10.0-mdev83/sql/sql_parse.cc:1097
      #25 0x000000000061f66f in do_command (thd=0x7fa79bc06070) at /home/elenst/bzr/10.0-mdev83/sql/sql_parse.cc:812
      #26 0x000000000073df0d in do_handle_one_connection (thd_arg=0x7fa79bc06070) at /home/elenst/bzr/10.0-mdev83/sql/sql_connect.cc:1266
      #27 0x000000000073dc7b in handle_one_connection (arg=0x7fa79bc06070) at /home/elenst/bzr/10.0-mdev83/sql/sql_connect.cc:1181
      #28 0x00000000009a6c7a in pfs_spawn_thread (arg=0x7fa79bf69db0) at /home/elenst/bzr/10.0-mdev83/storage/perfschema/pfs.cc:1015

      revision-id: timour@askmonty.org-20131022131141-28p67jesfk9n6ynq
      revno: 3751
      branch-nick: 10.0-mdev83
      BUILD/compile-pentium-debug-max-no-ndb

      EXPLAIN:

      EXPLAIN EXTENDED
      SELECT COUNT(*) FROM city_lang AS outer1, city_lang AS outer2 
      WHERE outer2.lang IN ( SELECT name FROM language ) 
      AND ( outer1.population IS NULL OR outer2.lang IN ( SELECT name FROM language ) );
      id	select_type	table	type	possible_keys	key	key_len	ref	rows	filtered	Extra
      1	PRIMARY	outer1	ALL	NULL	NULL	NULL	NULL	2	100.00	
      1	PRIMARY	outer2	ALL	NULL	NULL	NULL	NULL	2	100.00	Using where; Using join buffer (flat, BNL join)
      1	PRIMARY	<subquery2>	eq_ref	distinct_key	distinct_key	11	func	1	100.00	
      2	MATERIALIZED	language	ALL	NULL	NULL	NULL	NULL	2	100.00	
      3	MATERIALIZED	language	ALL	NULL	NULL	NULL	NULL	2	100.00	
      Warnings:
      Note	1003	select count(0) AS `COUNT(*)` from `test`.`city_lang` `outer1` semi join (`test`.`language`) join `test`.`city_lang` `outer2` where ((isnull(`test`.`outer1`.`population`) or <expr_cache><`test`.`outer2`.`lang`>(<in_optimizer>(`test`.`outer2`.`lang`,`test`.`outer2`.`lang` in ( <materialize> (select `test`.`language`.`name` from `test`.`language` ), <primary_index_lookup>(`test`.`outer2`.`lang` in <temporary table> on distinct_key where ((`test`.`outer2`.`lang` = `<subquery3>`.`name`))))))))

      Test case:

      SET optimizer_switch='static_cond_pushdown=on';
       
      CREATE TABLE city_lang ( lang VARCHAR(8), population INT ) ENGINE=MyISAM;
      INSERT INTO city_lang VALUES ('English',100000),('Chinese',20000);
       
      CREATE TABLE language ( name VARCHAR(8)) ENGINE=MyISAM;
      INSERT INTO language VALUES ('Spanish'),('Russian');
       
      SELECT COUNT(*) FROM city_lang AS city1, city_lang AS city2 
      WHERE city2.lang IN ( SELECT name FROM language ) 
        AND ( city1.population IS NULL OR city2.lang IN ( SELECT name FROM language ) );

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              timour Timour Katchaounov (Inactive)
              Reporter:
              elenst Elena Stepanova
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: