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

[Draft] Server crashes in in base_list_iterator::next_fast

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Cannot Reproduce
    • Affects Version/s: 5.5.30
    • Fix Version/s: N/A
    • Component/s: Optimizer
    • Labels:
      None

      Description

      It is likely to be a duplicate of MDEV-4418, creating to double-check after MDEV-4418 is fixed.

      #3  <signal handler called>
      #4  0x00000000005682c3 in base_list_iterator::next_fast (this=0x7f0cb2ccbd60) at /home/elenst/bzr/5.5/sql/sql_list.h:452
      #5  0x000000000057517f in List_iterator_fast<Item>::operator++ (this=0x7f0cb2ccbd60) at /home/elenst/bzr/5.5/sql/sql_list.h:564
      #6  0x0000000000683f74 in Item_equal_iterator<List_iterator_fast, Item>::operator++ (this=0x7f0cb2ccbd60) at /home/elenst/bzr/5.5/sql/item_cmpfunc.h:1837
      #7  0x00000000008182d7 in Item_equal::contains (this=0x7f0ca40882a8, field=0x7f0ca40bd1b8) at /home/elenst/bzr/5.5/sql/item_cmpfunc.cc:5644
      #8  0x00000000007f2a39 in Item_field::find_item_equal (this=0x7f0ca4035788, cond_equal=0x7f0ca4036110) at /home/elenst/bzr/5.5/sql/item.cc:5243
      #9  0x0000000000661728 in eliminate_item_equal (cond=0x0, upper_levels=0x7f0ca4036110, item_equal=0x7f0ca4088638) at /home/elenst/bzr/5.5/sql/sql_select.cc:12123
      #10 0x00000000006620b4 in substitute_for_best_equal_field (context_tab=0x1, cond=0x7f0ca4088638, cond_equal=0x7f0ca4036110, table_join_idx=0x7f0ca4089a68) at /home/elenst/bzr/5.5/sql/sql_select.cc:12413
      #11 0x0000000000661d99 in substitute_for_best_equal_field (context_tab=0x1, cond=0x7f0ca4035e78, cond_equal=0x7f0ca407d9c0, table_join_idx=0x7f0ca4089a68) at /home/elenst/bzr/5.5/sql/sql_select.cc:12340
      #12 0x0000000000661d99 in substitute_for_best_equal_field (context_tab=0x1, cond=0x7f0ca407d8c8, cond_equal=0x7f0ca407d9c0, table_join_idx=0x7f0ca4089a68) at /home/elenst/bzr/5.5/sql/sql_select.cc:12340
      #13 0x0000000000661d99 in substitute_for_best_equal_field (context_tab=0x1, cond=0x7f0ca407da98, cond_equal=0x7f0ca407dd30, table_join_idx=0x7f0ca4089a68) at /home/elenst/bzr/5.5/sql/sql_select.cc:12340
      #14 0x0000000000661d99 in substitute_for_best_equal_field (context_tab=0x1, cond=0x7f0ca407dc38, cond_equal=0x7f0ca407dd30, table_join_idx=0x7f0ca4089a68) at /home/elenst/bzr/5.5/sql/sql_select.cc:12340
      #15 0x0000000000645452 in JOIN::optimize (this=0x7f0ca40812e8) at /home/elenst/bzr/5.5/sql/sql_select.cc:1288
      #16 0x000000000064b947 in mysql_select (thd=0x3406630, rref_pointer_array=0x34096a8, tables=0x7f0ca407be88, wild_num=0, fields=..., conds=0x7f0ca407dc38, og_num=4, order=0x7f0ca407eb08, group=0x0, having=0x0, proc_param=0x0, select_options=2147748608, result=0x7f0ca4081298, unit=0x3408d08, select_lex=0x3409400) at /home/elenst/bzr/5.5/sql/sql_select.cc:3040
      #17 0x00000000006423fc in handle_select (thd=0x3406630, lex=0x3408c58, result=0x7f0ca4081298, setup_tables_done_option=0) at /home/elenst/bzr/5.5/sql/sql_select.cc:318
      #18 0x000000000061a444 in execute_sqlcom_select (thd=0x3406630, all_tables=0x7f0ca407be88) at /home/elenst/bzr/5.5/sql/sql_parse.cc:4642
      #19 0x0000000000612e8a in mysql_execute_command (thd=0x3406630) at /home/elenst/bzr/5.5/sql/sql_parse.cc:2196
      #20 0x000000000061cce4 in mysql_parse (thd=0x3406630, rawbuf=0x7f0ca4017588 "SELECT    alias2 . `col_varchar_key` AS field1 , alias2 . `pk` AS field2 , alias2 . `col_varchar_key` AS field3 FROM ( C AS alias1 , ( C AS alias2 , B AS alias3 ) ) WHERE ( alias1 . `col_int_key` = al"..., length=841, parser_state=0x7f0cb2ccd4f0) at /home/elenst/bzr/5.5/sql/sql_parse.cc:5760
      #21 0x00000000006103ca in dispatch_command (command=COM_QUERY, thd=0x3406630, packet=0x34a83d1 "SELECT    alias2 . `col_varchar_key` AS field1 , alias2 . `pk` AS field2 , alias2 . `col_varchar_key` AS field3 FROM ( C AS alias1 , ( C AS alias2 , B AS alias3 ) ) WHERE ( alias1 . `col_int_key` = al"..., packet_length=842) at /home/elenst/bzr/5.5/sql/sql_parse.cc:1068
      #22 0x000000000060f60b in do_command (thd=0x3406630) at /home/elenst/bzr/5.5/sql/sql_parse.cc:794
      #23 0x000000000071b233 in do_handle_one_connection (thd_arg=0x3406630) at /home/elenst/bzr/5.5/sql/sql_connect.cc:1266
      #24 0x000000000071ac1a in handle_one_connection (arg=0x3406630) at /home/elenst/bzr/5.5/sql/sql_connect.cc:1181
      #25 0x0000000000977cc6 in pfs_spawn_thread (arg=0x3463a10) at /home/elenst/bzr/5.5/storage/perfschema/pfs.cc:1015
      #26 0x00007f0cc2affe9a in start_thread (arg=0x7f0cb2cce700) at pthread_create.c:308
      #27 0x00007f0cc1df3cbd in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:112
      

      bzr version-info

      revision-id: bar@mnogosearch.org-20130517061656-c023dj7qfhssrh95
      revno: 3770
      branch-nick: 5.5
      

      Draft (unsimplified) test case:

      CREATE TABLE B (
      			pk INTEGER AUTO_INCREMENT,
      			col_int_nokey INTEGER NOT NULL,
      			col_int_key INTEGER NOT NULL,
      
      			col_date_key DATE NOT NULL,
      			col_date_nokey DATE NOT NULL,
      
      			col_time_key TIME NOT NULL,
      			col_time_nokey TIME NOT NULL,
      
      			col_datetime_key DATETIME NOT NULL,
      			col_datetime_nokey DATETIME NOT NULL,
      
      			col_varchar_key VARCHAR(1) NOT NULL,
      			col_varchar_nokey VARCHAR(1) NOT NULL,
      
      			PRIMARY KEY (pk),
      			KEY (col_int_key),
      			KEY (col_date_key),
      			KEY (col_time_key),
      			KEY (col_datetime_key),
      			KEY (col_varchar_key, col_int_key)
      		)  ENGINE=Aria
      ;
      INSERT /*! IGNORE */ INTO B (
      				col_int_key, col_int_nokey,
      				col_date_key, col_date_nokey,
      				col_time_key, col_time_nokey,
      				col_datetime_key, col_datetime_nokey,
      				col_varchar_key, col_varchar_nokey
      			) VALUES (7, 1, '1900-01-01', '1900-01-01', NULL, NULL, '2001-11-04 19:07:55.051133', '2001-11-04 19:07:55.051133', 'k', 'k')
      ;
      
      CREATE TABLE C (
      			pk INTEGER AUTO_INCREMENT,
      			col_int_nokey INTEGER NOT NULL,
      			col_int_key INTEGER NOT NULL,
      
      			col_date_key DATE NOT NULL,
      			col_date_nokey DATE NOT NULL,
      
      			col_time_key TIME NOT NULL,
      			col_time_nokey TIME NOT NULL,
      
      			col_datetime_key DATETIME NOT NULL,
      			col_datetime_nokey DATETIME NOT NULL,
      
      			col_varchar_key VARCHAR(1) NOT NULL,
      			col_varchar_nokey VARCHAR(1) NOT NULL,
      
      			PRIMARY KEY (pk),
      			KEY (col_int_key),
      			KEY (col_date_key),
      			KEY (col_time_key),
      			KEY (col_datetime_key),
      			KEY (col_varchar_key, col_int_key)
      		)  ENGINE=Aria
      ;
      
      INSERT /*! IGNORE */ INTO C (
      				col_int_key, col_int_nokey,
      				col_date_key, col_date_nokey,
      				col_time_key, col_time_nokey,
      				col_datetime_key, col_datetime_nokey,
      				col_varchar_key, col_varchar_nokey
      			) VALUES (0, 4, NULL, NULL, '21:22:34.025509', '21:22:34.025509', '2002-02-13 17:30:06.013935', '2002-02-13 17:30:06.013935', 'j', 'j'),(8, 6, '2004-09-18', '2004-09-18', '10:50:38.059966', '10:50:38.059966', '2008-09-27 00:34:58.026613', '2008-09-27 00:34:58.026613', 'v', 'v'),(1, 3, '2009-12-01', '2009-12-01', '00:21:38.058143', '00:21:38.058143', '2007-05-28 00:00:00', '2007-05-28 00:00:00', 'c', 'c'),(8, 5, '2004-12-17', '2004-12-17', '04:08:02.046897', '04:08:02.046897', '2009-07-25 09:21:20.064099', '2009-07-25 09:21:20.064099', 'm', 'm'),(9, 3, '2000-03-14', '2000-03-14', '16:25:11.040240', '16:25:11.040240', '2002-01-16 00:00:00', '2002-01-16 00:00:00', 'd', 'd'),(24, 246, '2000-10-08', '2000-10-08', '10:14:58.018534', '10:14:58.018534', '2006-10-12 04:32:53.031976', '2006-10-12 04:32:53.031976', 'd', 'd'),(6, 2, '2006-05-25', '2006-05-25', '19:47:59.011283', '19:47:59.011283', '2001-02-15 03:08:38.035426', '2001-02-15 03:08:38.035426', 'y', 'y'),(1, 9, '2008-01-23', '2008-01-23', '11:14:24.032949', '11:14:24.032949', '2004-10-02 20:31:15.022553', '2004-10-02 20:31:15.022553', 't', 't'),(6, 3, '2007-06-18', '2007-06-18', NULL, NULL, '2002-08-20 22:48:00.035785', '2002-08-20 22:48:00.035785', 'd', 'd'),(2, 8, '2002-10-13', '2002-10-13', '00:00:00', '00:00:00', '1900-01-01 00:00:00', '1900-01-01 00:00:00', 's', 's'),(4, 1, '1900-01-01', '1900-01-01', '15:57:25.019666', '15:57:25.019666', '2005-08-15 00:00:00', '2005-08-15 00:00:00', 'r', 'r'),(8, 8, NULL, NULL, '07:05:51.006712', '07:05:51.006712', '1900-01-01 00:00:00', '1900-01-01 00:00:00', 'm', 'm'),(4, 8, '2006-03-09', '2006-03-09', '19:22:21.057406', '19:22:21.057406', '2008-05-16 08:09:06.002924', '2008-05-16 08:09:06.002924', 'b', 'b'),(4, 5, '2001-06-05', '2001-06-05', '03:53:16.001370', '03:53:16.001370', '2001-01-20 12:47:23.022022', '2001-01-20 12:47:23.022022', 'x', 'x'),(7, 7, '2006-05-28', '2006-05-28', '09:16:38.034570', '09:16:38.034570', '2008-07-02 00:00:00', '2008-07-02 00:00:00', 'g', 'g'),(4, 5, '2001-04-19', '2001-04-19', '15:37:26.028315', '15:37:26.028315', '1900-01-01 00:00:00', '1900-01-01 00:00:00', 'p', 'p'),(1, 1, '1900-01-01', '1900-01-01', '00:00:00', '00:00:00', '2002-12-08 11:34:58.001571', '2002-12-08 11:34:58.001571', 'q', 'q'),(9, 6, '2004-08-20', '2004-08-20', '05:03:03.047452', '05:03:03.047452', '1900-01-01 00:00:00', '1900-01-01 00:00:00', 'w', 'w'),(4, 2, '2004-10-10', '2004-10-10', '02:59:24.063764', '02:59:24.063764', '1900-01-01 00:00:00', '1900-01-01 00:00:00', 'd', 'd'),(8, 9, '2000-04-02', '2000-04-02', '00:01:58.064243', '00:01:58.064243', '2002-08-25 20:35:06.064634', '2002-08-25 20:35:06.064634', 'e', 'e')
      ;
      
      SELECT    alias2 . `col_varchar_key` AS field1 , alias2 . `pk` AS field2 , alias2 . `col_varchar_key` AS field3 FROM ( C AS alias1 , ( C AS alias2 , B AS alias3 ) ) WHERE ( alias1 . `col_int_key` = alias1 . `col_int_key` AND ( alias1 . `col_int_key` = 138 OR ( alias1 . `col_varchar_key` = 'f' AND ( alias1 . `col_varchar_key` = 'j' OR ( alias1 . `col_varchar_key` LIKE CONCAT( 'n' , '%' ) AND ( alias1 . `col_varchar_key` = alias3 . `col_varchar_key` AND ( alias1 . `col_varchar_key` = alias1 . `col_varchar_key` AND ( alias1 . `col_varchar_key` LIKE CONCAT( 'h' , '%' ) AND ( alias1 . `pk` = alias2 . `col_int_key` OR alias1 . `pk` = 178 ) ) ) ) ) ) ) ) ) AND ( alias1 . `col_varchar_key` != 'l' OR alias2 . `col_varchar_nokey` = alias1 . `col_varchar_nokey` )   ORDER BY field1, field2, field3 , alias1 . `col_datetime_key` DESC LIMIT 100 ;
      

        Gliffy Diagrams

          Attachments

            Activity

            Hide
            elenst Elena Stepanova added a comment -

            Apparently it went away with MDEV-4418 bugfix, not reproducible on the current 5.5 tree (tried on e40bc659335f7f8b69427ed2d215c34c045a5ed7).

            Show
            elenst Elena Stepanova added a comment - Apparently it went away with MDEV-4418 bugfix, not reproducible on the current 5.5 tree (tried on e40bc659335f7f8b69427ed2d215c34c045a5ed7).

              People

              • Assignee:
                Unassigned
                Reporter:
                elenst Elena Stepanova
              • Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: