[MDEV-13401] Assertion failure during main.partition test run Created: 2017-07-28  Updated: 2018-05-21  Resolved: 2018-05-21

Status: Closed
Project: MariaDB Server
Component/s: Partitioning, Storage Engine - Spider
Affects Version/s: 10.2.4
Fix Version/s: 10.3.6

Type: Bug Priority: Major
Reporter: Jacob Mathew (Inactive) Assignee: Michael Widenius
Resolution: Done Votes: 0
Labels: None
Environment:

Debug build of the 10.2-spider branch, which is currently based on 10.2.4.



 Description   

To reproduce, use a debug build of the 10.2-spider branch and run the main.partition test.

The following assertion fails in ha_partition::handle_ordered_index_scan(), at ha_partition.cc:7076, called from ha_partition::multi_range_read_next():

DBUG_ASSERT(i == uint2korr(part_rec_buf_ptr));

Stack trace:

 	mysqld.exe!my_sigabrt_handler(int sig) Line 477	C
 	mysqld.exe!raise(int signum) Line 522	C++
 	mysqld.exe!abort() Line 71	C++
 	mysqld.exe!common_assert_to_stderr<wchar_t>(const wchar_t * const expression, const wchar_t * const file_name, const unsigned int line_number) Line 150	C++
 	mysqld.exe!common_assert<wchar_t>(const wchar_t * const expression, const wchar_t * const file_name, const unsigned int line_number, void * const return_address) Line 383	C++
 	mysqld.exe!_wassert(const wchar_t * expression, const wchar_t * file_name, unsigned int line_number) Line 405	C++
>	mysqld.exe!ha_partition::handle_ordered_index_scan(unsigned char * buf, bool reverse_order) Line 7076	C++
 	mysqld.exe!ha_partition::multi_range_read_next(void * * range_info) Line 6382	C++
 	mysqld.exe!QUICK_RANGE_SELECT::get_next() Line 11191	C++
 	mysqld.exe!rr_quick(READ_RECORD * info) Line 353	C++
 	mysqld.exe!join_init_read_record(st_join_table * tab) Line 19263	C++
 	mysqld.exe!sub_select(JOIN * join, st_join_table * join_tab, bool end_of_records) Line 18340	C++
 	mysqld.exe!do_select(JOIN * join, Procedure * procedure) Line 17887	C++
 	mysqld.exe!JOIN::exec_inner() Line 3388	C++
 	mysqld.exe!JOIN::exec() Line 3200	C++
 	mysqld.exe!mysql_select(THD * thd, TABLE_LIST * tables, unsigned int wild_num, List<Item> & fields, Item * conds, unsigned int og_num, st_order * order, st_order * group, Item * having, st_order * proc_param, unsigned __int64 select_options, select_result * result, st_select_lex_unit * unit, st_select_lex * select_lex) Line 3586	C++
 	mysqld.exe!handle_select(THD * thd, LEX * lex, select_result * result, unsigned long setup_tables_done_option) Line 361	C++
 	mysqld.exe!execute_sqlcom_select(THD * thd, TABLE_LIST * all_tables) Line 6399	C++
 	mysqld.exe!mysql_execute_command(THD * thd) Line 3429	C++
 	mysqld.exe!mysql_parse(THD * thd, char * rawbuf, unsigned int length, Parser_state * parser_state, bool is_com_multi, bool is_next_command) Line 7842	C++
 	mysqld.exe!dispatch_command(enum_server_command command, THD * thd, char * packet, unsigned int packet_length, bool is_com_multi, bool is_next_command) Line 1802	C++
 	mysqld.exe!do_command(THD * thd) Line 1359	C++
 	mysqld.exe!threadpool_process_request(THD * thd) Line 346	C++
 	mysqld.exe!tp_callback(TP_connection * c) Line 192	C++
 	mysqld.exe!tp_callback(_TP_CALLBACK_INSTANCE * instance, void * context) Line 378	C++
 	mysqld.exe!work_callback(_TP_CALLBACK_INSTANCE * instance, void * context, _TP_WORK * work) Line 452	C++
 	[External Code]	

Note that all of the following tests are currently failing with the Spiral patch changes to multi range read in the partition manager:
partition, partition_innodb, partition_pruning, partition_range, optimizer

These are the steps for my debug build in my Linux development environment:

 	cmake .. -DCMAKE_BUILD_TYPE=Debug
        make -j4



 Comments   
Comment by Jacob Mathew (Inactive) [ 2017-08-25 ]

Kentoku has developed a fix for this bug.

Comment by Kentoku Shiba (Inactive) [ 2017-08-25 ]

Please review the following changes for fixing this assertion failure.
https://github.com/MariaDB/server/pull/442/commits/fc9b084f2b0d570707c80cc949832141846e41d3

Comment by Kentoku Shiba (Inactive) [ 2017-08-25 ]

Please review.

Comment by Jacob Mathew (Inactive) [ 2017-08-25 ]

I have reviewed and approve the changes to fix the assertion failure. Note that even with this fix, there are a number of partition tests that have different results. I will open a separate bug for that problem.

Since Monty was the developer for the MRR Spiral patches, these changes need to be reviewed by Monty as well.

Comment by Kentoku Shiba (Inactive) [ 2017-08-25 ]

Monty,
Please review the following changes for fixing this assertion failure.
https://github.com/MariaDB/server/pull/442/commits/fc9b084f2b0d570707c80cc949832141846e41d3

Comment by Michael Widenius [ 2018-05-21 ]

Fix was already applied in 10.3 code

Generated at Thu Feb 08 08:05:19 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.