|
Thanks Elena.
I found out the problem will be resolve if i remove partitioning from `tb1` table.
This is tables structure :
CREATE TABLE `tb1` (
`ID` int(11) NOT NULL,
`Ftb1` varchar(1000) COLLATE utf8_persian_ci DEFAULT NULL,
`Ftb2` int(11) DEFAULT NULL,
`Ftb3` int(11) DEFAULT '-1',
`CDate` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
`RID` int(11) DEFAULT NULL,
`UID` int(11) DEFAULT NULL,
`Ftb4` int(11) NOT NULL DEFAULT '0',
`Ftb5` varchar(2000) COLLATE utf8_persian_ci DEFAULT NULL,
`Ftb6` int(4) NOT NULL DEFAULT '0',
`Ftb7` int(11) DEFAULT '0',
`Ftb8` int(11) DEFAULT '0',
`Ftb9` varchar(140) COLLATE utf8_persian_ci DEFAULT NULL,
`Ftb10` int(4) NOT NULL DEFAULT '1',
`Ftb11` varchar(20) COLLATE utf8_persian_ci DEFAULT NULL,
`Ftb12` text COLLATE utf8_persian_ci,
`Ftb13` varchar(50) COLLATE utf8_persian_ci DEFAULT NULL,
`Ftb14` int(1) NOT NULL DEFAULT '0' COMMENT '0=one signer, 1=multi signers'
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_persian_ci
PARTITION BY RANGE COLUMNS(CDate)
(
PARTITION tb1_p1 VALUES LESS THAN ('2000-03-21') ENGINE=InnoDB,
PARTITION tb1_p2 VALUES LESS THAN ('2006-03-20') ENGINE=InnoDB,
PARTITION tb1_p3 VALUES LESS THAN ('2008-03-21') ENGINE=InnoDB,
PARTITION tb1_p4 VALUES LESS THAN ('2010-03-20') ENGINE=InnoDB,
PARTITION tb1_p5 VALUES LESS THAN ('2012-03-21') ENGINE=InnoDB,
PARTITION tb1_p6 VALUES LESS THAN ('2014-03-20') ENGINE=InnoDB,
PARTITION tb1_p7 VALUES LESS THAN ('2015-03-21') ENGINE=InnoDB,
PARTITION tb1_p8 VALUES LESS THAN ('2016-03-20') ENGINE=InnoDB,
PARTITION tb1_p9 VALUES LESS THAN ('2017-03-21') ENGINE=InnoDB,
PARTITION tb1_p10 VALUES LESS THAN ('2018-03-21') ENGINE=InnoDB,
PARTITION tb1_p11 VALUES LESS THAN ('2019-03-21') ENGINE=InnoDB,
PARTITION tb1_p12 VALUES LESS THAN ('2020-03-20') ENGINE=InnoDB,
PARTITION tb1_p1000 VALUES LESS THAN ('2100-03-21') ENGINE=InnoDB
);
– Indexes for table `tb1`
–
ALTER TABLE `tb1`
ADD PRIMARY KEY (`ID`,`CDate`),
ADD KEY `Ftb2` (`Ftb2`),
ADD KEY `RID` (`RID`),
ADD KEY `UID` (`UID`),
ADD KEY `Ftb12` (`Ftb12`(255)),
ADD KEY `Ftb1` (`Ftb1`(255)),
ADD KEY `Ftb5` (`Ftb5`(255)),
ADD KEY `Ftb10` (`Ftb10`),
ADD KEY `Ftb6` (`Ftb6`),
ADD KEY `Ftb4` (`Ftb4`),
ADD KEY `CDate` (`CDate`),
ADD KEY `Ftb3` (`Ftb3`),
ADD KEY `ID` (`ID`,`Ftb10`,`Ftb4`,`Ftb6`);
---------------------------------------------
CREATE TABLE `tb3` (
`ID` int(11) NOT NULL,
`DID` int(11) DEFAULT NULL,
`LID` int(11) DEFAULT NULL,
`Finished` tinyint(1) NOT NULL DEFAULT 0,
`Subject` varchar(256) COLLATE utf8_persian_ci DEFAULT NULL,
`Note` tinytext COLLATE utf8_persian_ci DEFAULT NULL,
`FullTextField` text COLLATE utf8_persian_ci NOT NULL,
`Field_1` date DEFAULT NULL ,
`Field_2` date DEFAULT NULL ,
`Field_4` float DEFAULT NULL ,
`Field_5` smallint(5) DEFAULT NULL ,
`Field_6` varchar(20) COLLATE utf8_persian_ci DEFAULT NULL ,
`Field_7` varchar(100) COLLATE utf8_persian_ci DEFAULT NULL ,
`Field_9` varchar(500) COLLATE utf8_persian_ci DEFAULT NULL ,
`Field_10` varchar(500) COLLATE utf8_persian_ci DEFAULT NULL ,
`Field_13` varchar(500) COLLATE utf8_persian_ci DEFAULT NULL ,
`Field_15` varchar(255) COLLATE utf8_persian_ci DEFAULT NULL ,
`Field_16` varchar(255) COLLATE utf8_persian_ci DEFAULT NULL ,
`Field_17` varchar(255) COLLATE utf8_persian_ci DEFAULT NULL ,
`Field_18` varchar(255) COLLATE utf8_persian_ci DEFAULT NULL ,
`Field_20` tinyint(1) DEFAULT NULL ,
`Field_21` tinyint(1) DEFAULT NULL ,
`CounterField` varchar(50) COLLATE utf8_persian_ci DEFAULT NULL,
`Field_26` date DEFAULT NULL ,
`Field_27` varchar(255) COLLATE utf8_persian_ci DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_persian_ci ROW_FORMAT=COMPACT;
– Indexes for table `tb3`
–
ALTER TABLE `tb3`
ADD PRIMARY KEY (`ID`),
ADD KEY `LID` (`LID`),
ADD KEY `Field_1` (`Field_1`),
ADD KEY `Field_2` (`Field_2`),
ADD KEY `Field_4` (`Field_4`),
ADD KEY `Field_5` (`Field_5`),
ADD KEY `DID` (`DID`),
ADD KEY `Field_6` (`Field_6`);
ALTER TABLE `tb3` ADD FULLTEXT KEY `FullTextField` (`FullTextField`);
|
|
Thanks for the information, I was able to reproduce it.
It appears to be the same problem as MDEV-16241. Since it has some extra information and is close to the resolution already, I suggest to keep tracking the problem there, if it's okay with you. I will add your use case to MDEV-16241.
--source include/have_partition.inc
|
--source include/have_innodb.inc
|
|
CREATE TABLE `tb1` (
|
`ID` int(11) NOT NULL,
|
`CDate` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
|
`RID` int(11) DEFAULT NULL,
|
`UID` int(11) DEFAULT NULL,
|
PRIMARY KEY (`ID`,`CDate`),
|
KEY `RID` (`RID`),
|
KEY `UID` (`UID`),
|
KEY `ID` (`ID`)
|
) ENGINE=InnoDB
|
PARTITION BY RANGE COLUMNS(`CDate`)
|
(PARTITION `tb1_p1` VALUES LESS THAN ('2000-03-21') ENGINE = InnoDB,
|
PARTITION `tb1_p12` VALUES LESS THAN ('2020-03-20') ENGINE = InnoDB,
|
PARTITION `tb1_p1000` VALUES LESS THAN ('2100-03-21') ENGINE = InnoDB);
|
INSERT INTO `tb1` VALUES (1,'2033-05-03 01:23:33',9,NULL),(2,'2026-07-05 20:39:29',NULL,NULL);
|
|
CREATE TABLE `tb3` (
|
`ID` int(11) NOT NULL,
|
`DID` int(11) DEFAULT NULL,
|
`LID` int(11) DEFAULT NULL
|
) ENGINE=MyISAM;
|
|
INSERT INTO `tb3` VALUES (3,NULL,NULL),(4,NULL,1707212800);
|
|
SELECT tb3.ID FROM tb3 INNER JOIN tb1 on(tb1.ID = tb3.ID) WHERE `CDate` >= '2018-08-03' AND `RID` = 1234 AND `UID` = 123;
|
|
# Cleanup
|
DROP TABLE tb1, tb3;
|
|
10.3 debug a33c0e3f34af
|
mysqld: /data/src/10.3/sql/handler.h:3096: int handler::ha_rnd_end(): Assertion `inited==RND' failed.
|
181102 18:47:33 [ERROR] mysqld got signal 6 ;
|
|
#7 0x00007fe505542ee2 in __assert_fail () from /lib/x86_64-linux-gnu/libc.so.6
|
#8 0x000055d77af0f61a in handler::ha_rnd_end (this=0x7fe4a80a7bf8) at /data/src/10.3/sql/handler.h:3096
|
#9 0x000055d77b1591bc in DsMrr_impl::dsmrr_init (this=0x7fe4a80a8040, h_arg=0x7fe4a80a7bf8, seq_funcs=0x7fe4a80a7b30, seq_init_param=0x7fe4a8096f50, n_ranges=1, mode=72, buf=0x7fe4a8096eb8) at /data/src/10.3/sql/multi_range_read.cc:1016
|
#10 0x000055d77b5d212a in ha_innobase::multi_range_read_init (this=0x7fe4a80a7bf8, seq=0x7fe4a80a7b30, seq_init_param=0x7fe4a8096f50, n_ranges=1, mode=72, buf=0x7fe4a8096eb8) at /data/src/10.3/storage/innobase/handler/ha_innodb.cc:20268
|
#11 0x000055d77ba04030 in ha_partition::multi_range_read_init (this=0x7fe4a80a7348, seq=0x7fe4fa885bd0, seq_init_param=0x7fe4a8049720, n_ranges=1, mrr_mode=72, buf=0x7fe4fa885b90) at /data/src/10.3/sql/ha_partition.cc:6440
|
#12 0x000055d77b40d679 in QUICK_RANGE_SELECT::reset (this=0x7fe4a8049720) at /data/src/10.3/sql/opt_range.cc:11432
|
#13 0x000055d77b3f61ff in QUICK_ROR_INTERSECT_SELECT::reset (this=0x7fe4a8048600) at /data/src/10.3/sql/opt_range.cc:1650
|
#14 0x000055d77b01ea86 in join_init_read_record (tab=0x7fe4a8049a48) at /data/src/10.3/sql/sql_select.cc:20220
|
#15 0x000055d77b01c884 in sub_select (join=0x7fe4a80173a0, join_tab=0x7fe4a8049a48, end_of_records=false) at /data/src/10.3/sql/sql_select.cc:19300
|
#16 0x000055d77b01be20 in do_select (join=0x7fe4a80173a0, procedure=0x0) at /data/src/10.3/sql/sql_select.cc:18843
|
#17 0x000055d77aff4c2d in JOIN::exec_inner (this=0x7fe4a80173a0) at /data/src/10.3/sql/sql_select.cc:4035
|
#18 0x000055d77aff409e in JOIN::exec (this=0x7fe4a80173a0) at /data/src/10.3/sql/sql_select.cc:3829
|
#19 0x000055d77aff530e in mysql_select (thd=0x7fe4a8000b00, tables=0x7fe4a8014fe8, wild_num=0, fields=..., conds=0x7fe4a8016e30, og_num=0, order=0x0, group=0x0, having=0x0, proc_param=0x0, select_options=2147748608, result=0x7fe4a8017378, unit=0x7fe4a80049b0, select_lex=0x7fe4a8005120) at /data/src/10.3/sql/sql_select.cc:4234
|
#20 0x000055d77afe71ec in handle_select (thd=0x7fe4a8000b00, lex=0x7fe4a80048e8, result=0x7fe4a8017378, setup_tables_done_option=0) at /data/src/10.3/sql/sql_select.cc:382
|
#21 0x000055d77afb1ddb in execute_sqlcom_select (thd=0x7fe4a8000b00, all_tables=0x7fe4a8014fe8) at /data/src/10.3/sql/sql_parse.cc:6547
|
#22 0x000055d77afa845d in mysql_execute_command (thd=0x7fe4a8000b00) at /data/src/10.3/sql/sql_parse.cc:3769
|
#23 0x000055d77afb5d9d in mysql_parse (thd=0x7fe4a8000b00, rawbuf=0x7fe4a8014d18 "SELECT tb3.ID FROM tb3 INNER JOIN tb1 on(tb1.ID = tb3.ID) WHERE `CDate` >= '2018-08-03' AND `RID` = 1234 AND `UID` = 123", length=120, parser_state=0x7fe4fa8875f0, is_com_multi=false, is_next_command=false) at /data/src/10.3/sql/sql_parse.cc:8091
|
#24 0x000055d77afa2f6b in dispatch_command (command=COM_QUERY, thd=0x7fe4a8000b00, packet=0x7fe4a81670d1 "", packet_length=120, is_com_multi=false, is_next_command=false) at /data/src/10.3/sql/sql_parse.cc:1850
|
#25 0x000055d77afa198f in do_command (thd=0x7fe4a8000b00) at /data/src/10.3/sql/sql_parse.cc:1395
|
#26 0x000055d77b10919c in do_handle_one_connection (connect=0x55d77d7cd560) at /data/src/10.3/sql/sql_connect.cc:1402
|
#27 0x000055d77b108f20 in handle_one_connection (arg=0x55d77d7cd560) at /data/src/10.3/sql/sql_connect.cc:1308
|
#28 0x000055d77b59c0df in pfs_spawn_thread (arg=0x55d77d7d5890) at /data/src/10.3/storage/perfschema/pfs.cc:1862
|
#29 0x00007fe507219494 in start_thread (arg=0x7fe4fa888700) at pthread_create.c:333
|
#30 0x00007fe5055ff93f in clone () from /lib/x86_64-linux-gnu/libc.so.6
|
|
10.3 non-debug ASAN 49d506cd1d7
|
==27126==ERROR: AddressSanitizer: SEGV on unknown address 0x6253232cac48 (pc 0x55fa6a444976 sp 0x7f2e88c4b580 bp 0x0000bebebebe T27)
|
#0 0x55fa6a444975 in ha_innobase::innobase_get_index(unsigned int) /data/src/10.3/storage/innobase/handler/ha_innodb.cc:9392
|
#1 0x55fa6a4466cf in ha_innobase::change_active_index(unsigned int) /data/src/10.3/storage/innobase/handler/ha_innodb.cc:9427
|
#2 0x55fa69ade790 in handler::ha_index_init(unsigned int, bool) /data/src/10.3/sql/handler.h:3027
|
#3 0x55fa69ade790 in DsMrr_impl::dsmrr_init(handler*, st_range_seq_if*, void*, unsigned int, unsigned int, st_handler_buffer*) /data/src/10.3/sql/multi_range_read.cc:1016
|
#4 0x55fa6a41fb93 in ha_innobase::multi_range_read_init(st_range_seq_if*, void*, unsigned int, unsigned int, st_handler_buffer*) /data/src/10.3/storage/innobase/handler/ha_innodb.cc:20316
|
#5 0x55fa6ab6f7ca in ha_partition::multi_range_read_init(st_range_seq_if*, void*, unsigned int, unsigned int, st_handler_buffer*) /data/src/10.3/sql/ha_partition.cc:6440
|
#6 0x55fa6a0ae546 in QUICK_RANGE_SELECT::reset() /data/src/10.3/sql/opt_range.cc:11411
|
#7 0x55fa6a0acf98 in QUICK_ROR_INTERSECT_SELECT::reset() /data/src/10.3/sql/opt_range.cc:1650
|
#8 0x55fa6987967b in join_init_read_record(st_join_table*) /data/src/10.3/sql/sql_select.cc:20207
|
#9 0x55fa6983f5a4 in sub_select(JOIN*, st_join_table*, bool) /data/src/10.3/sql/sql_select.cc:19287
|
#10 0x55fa698badf8 in do_select /data/src/10.3/sql/sql_select.cc:18830
|
#11 0x55fa698badf8 in JOIN::exec_inner() /data/src/10.3/sql/sql_select.cc:4035
|
#12 0x55fa698bbb03 in JOIN::exec() /data/src/10.3/sql/sql_select.cc:3829
|
#13 0x55fa698bbf02 in mysql_select(THD*, TABLE_LIST*, unsigned int, List<Item>&, Item*, unsigned int, st_order*, st_order*, Item*, st_order*, unsigned long long, select_result*, st_select_lex_unit*, st_select_lex*) /data/src/10.3/sql/sql_select.cc:4234
|
#14 0x55fa698be88b in handle_select(THD*, LEX*, select_result*, unsigned long) /data/src/10.3/sql/sql_select.cc:382
|
#15 0x55fa694f46a4 in execute_sqlcom_select /data/src/10.3/sql/sql_parse.cc:6547
|
#16 0x55fa697aa642 in mysql_execute_command(THD*) /data/src/10.3/sql/sql_parse.cc:3769
|
#17 0x55fa697b2cb8 in mysql_parse(THD*, char*, unsigned int, Parser_state*, bool, bool) /data/src/10.3/sql/sql_parse.cc:8089
|
#18 0x55fa697b9cc7 in dispatch_command(enum_server_command, THD*, char*, unsigned int, bool, bool) /data/src/10.3/sql/sql_parse.cc:1850
|
#19 0x55fa697bbe26 in do_command(THD*) /data/src/10.3/sql/sql_parse.cc:1395
|
#20 0x55fa69a61287 in do_handle_one_connection(CONNECT*) /data/src/10.3/sql/sql_connect.cc:1402
|
#21 0x55fa69a6178a in handle_one_connection /data/src/10.3/sql/sql_connect.cc:1308
|
#22 0x55fa6a3f3d26 in pfs_spawn_thread /data/src/10.3/storage/perfschema/pfs.cc:1862
|
#23 0x7f2e943ca493 in start_thread (/lib/x86_64-linux-gnu/libpthread.so.0+0x7493)
|
#24 0x7f2e927b093e in __clone (/lib/x86_64-linux-gnu/libc.so.6+0xe893e)
|
|