Bug #103317 Using temptable, query with many columns and group by clause alerts 1022 error
Submitted: 14 Apr 2021 11:50 Modified: 15 Apr 2021 5:22
Reporter: Steven Duan (OCA) Email Updates:
Status: Duplicate Impact on me:
None 
Category:MySQL Server: InnoDB storage engine Severity:S6 (Debug Builds)
Version:8.0.18/8.0.22/8.0.23 OS:Any
Assigned to: CPU Architecture:Any

[14 Apr 2021 11:50] Steven Duan
Description:
In release version:
Under the internal_tmp_mem_storage_engine=TempTable (default) setting, when the query with the group by clause creates an internal temporary table that has a large number of columns, it alerts 1022(23000) error code (Can't write; duplicate key in table).

In debug version, when executing the query, the stack is:
storage/temptable/include/temptable/indexed_column.h:65: temptable::Indexed_column::Indexed_column(const KEY_PART_INFO&): Assertion `mysql_key_part.field->field_index <= std::numeric_limits<decltype(m_mysql_field_index)>::max()' failed.

How to repeat:
CREATE TABLE `t1` (`SID` int NOT NULL, `PID` int NOT NULL, `CDa` date NOT NULL, `PC` int DEFAULT 0, `CM1` int DEFAULT 0, `CM2` int DEFAULT 0, `CM3` int DEFAULT 0, `CM4` int DEFAULT 0, `CM5` int DEFAULT 0, `CM6` int DEFAULT 0, `CM7` int DEFAULT 0, `CM8` int DEFAULT 0, `CM9` int DEFAULT 0, `CM10` int DEFAULT 0, `CM11` int DEFAULT 0, `CM12` int DEFAULT 0, `CM13` int DEFAULT 0, `CM14` int DEFAULT 0, `CM15` int DEFAULT 0, `CM16` int DEFAULT 0, `CM17` int DEFAULT 0, `CM18` int DEFAULT 0, `CM19` int DEFAULT 0, `CM20` int DEFAULT 0, `CM21` int DEFAULT 0, `CM22` int DEFAULT 0, `CM23` int DEFAULT 0, `CM24` int DEFAULT 0, `CM25` int DEFAULT 0, `CM26` int DEFAULT 0, `CM27` int DEFAULT 0, `CM28` int DEFAULT 0, `CM29` int DEFAULT 0, `CM30` int DEFAULT 0, `CM31` int DEFAULT 0, `CM32` int DEFAULT 0, `CM33` int DEFAULT 0, `CM34` int DEFAULT 0, `CM35` int DEFAULT 0, `CM36` int DEFAULT 0, `CM37` int DEFAULT 0, `CM38` int DEFAULT 0, `CM39` int DEFAULT 0, `CM40` int DEFAULT 0, `CM41` int DEFAULT 0, `CM42` int DEFAULT 0, `CM43` int DEFAULT 0, `CM44` int DEFAULT 0, `CM45` int DEFAULT 0, `CM46` int DEFAULT 0, `CM47` int DEFAULT 0, `CM48` int DEFAULT 0, `CM49` int DEFAULT 0, `CM50` int DEFAULT 0, `CM51` int DEFAULT 0, `CM52` int DEFAULT 0, `CM53` int DEFAULT 0, `CM54` int DEFAULT 0, `CM55` int DEFAULT 0, `CM56` int DEFAULT 0, `CM57` int DEFAULT 0, `CM58` int DEFAULT 0, `CM59` int DEFAULT 0, `CM60` int DEFAULT 0, `CM61` int DEFAULT 0, `CM62` int DEFAULT 0, `CM63` int DEFAULT 0, `CM64` int DEFAULT 0, PRIMARY KEY (`SID`,`PID`,`CDa`) ) ENGINE=InnoDB;

CREATE TABLE `t2` (`SID` int NOT NULL, `PID` int NOT NULL, `CDa` date NOT NULL, `PC` int DEFAULT 0, `LC1` int DEFAULT 0, `LC2` int DEFAULT 0, `LC3` int DEFAULT 0, `LC4` int DEFAULT 0, `LC5` int DEFAULT 0, `LC6` int DEFAULT 0, `LC7` int DEFAULT 0, `LC8` int DEFAULT 0, `LC9` int DEFAULT 0, `LC10` int DEFAULT 0, `LC11` int DEFAULT 0, `LC12` int DEFAULT 0, `LC13` int DEFAULT 0, `LC14` int DEFAULT 0, `LC15` int DEFAULT 0, `LC16` int DEFAULT 0, `LC17` int DEFAULT 0, `LC18` int DEFAULT 0, `LC19` int DEFAULT 0, `LC20` int DEFAULT 0, `LC21` int DEFAULT 0, `LC22` int DEFAULT 0, `LC23` int DEFAULT 0, `LC24` int DEFAULT 0, `LC25` int DEFAULT 0, `LC26` int DEFAULT 0, `LC27` int DEFAULT 0, `LC28` int DEFAULT 0, `LC29` int DEFAULT 0, `LC30` int DEFAULT 0, `LC31` int DEFAULT 0, `LC32` int DEFAULT 0, `LC33` int DEFAULT 0, `LC34` int DEFAULT 0, `LC35` int DEFAULT 0, `LC36` int DEFAULT 0, `LC37` int DEFAULT 0, `LC38` int DEFAULT 0, `LC39` int DEFAULT 0, `LC40` int DEFAULT 0, `LC41` int DEFAULT 0, `LC42` int DEFAULT 0, `LC43` int DEFAULT 0, `LC44` int DEFAULT 0, `LC45` int DEFAULT 0, `LC46` int DEFAULT 0, `LC47` int DEFAULT 0, `LC48` int DEFAULT 0, `LC49` int DEFAULT 0, `LC50` int DEFAULT 0, `LC51` int DEFAULT 0, `LC52` int DEFAULT 0, `LC53` int DEFAULT 0, `LC54` int DEFAULT 0, `LC55` int DEFAULT 0, `LC56` int DEFAULT 0, `LC57` int DEFAULT 0, `LC58` int DEFAULT 0, `LC59` int DEFAULT 0, `LC60` int DEFAULT 0, `LC61` int DEFAULT 0, `LC62` int DEFAULT 0, `LC63` int DEFAULT 0, `LC64` int DEFAULT 0, PRIMARY KEY (`SID`,`PID`,`CDa`) ) ENGINE=InnoDB;

insert into t1(`SID`,`PID`,`CDa`)  values (1,1,'2021-04-11');
insert into t1(`SID`,`PID`,`CDa`)  values (2,1,'2021-04-11');
insert into t2(`SID`,`PID`,`CDa`)  values (1,1,'2021-04-11');
insert into t2(`SID`,`PID`,`CDa`)  values (2,1,'2021-04-11');

SELECT a.SID SID, a.CDa CDa, CASE WHEN SUM(LC1) = 0 THEN 0.00 ELSE ROUND(SUM(CM1) / SUM(LC1), 2 ) END AS LR1, ROUND(SUM(CM1), 0) CM1, CASE WHEN SUM(LC2) = 0 THEN 0.00 ELSE ROUND(SUM(CM2) / SUM(LC2), 2 ) END AS LR2, ROUND(SUM(CM2), 0) CM2, CASE WHEN SUM(LC3) = 0 THEN 0.00 ELSE ROUND(SUM(CM3) / SUM(LC3), 2 ) END AS LR3, ROUND(SUM(CM3), 0) CM3, CASE WHEN SUM(LC4) = 0 THEN 0.00 ELSE ROUND(SUM(CM4) / SUM(LC4), 2 ) END AS LR4, ROUND(SUM(CM4), 0) CM4, CASE WHEN SUM(LC5) = 0 THEN 0.00 ELSE ROUND(SUM(CM5) / SUM(LC5), 2 ) END AS LR5, ROUND(SUM(CM5), 0) CM5, CASE WHEN SUM(LC6) = 0 THEN 0.00 ELSE ROUND(SUM(CM6) / SUM(LC6), 2 ) END AS LR6, ROUND(SUM(CM6), 0) CM6, CASE WHEN SUM(LC7) = 0 THEN 0.00 ELSE ROUND(SUM(CM7) / SUM(LC7), 2 ) END AS LR7, ROUND(SUM(CM7), 0) CM7, CASE WHEN SUM(LC8) = 0 THEN 0.00 ELSE ROUND(SUM(CM8) / SUM(LC8), 2 ) END AS LR8, ROUND(SUM(CM8), 0) CM8, CASE WHEN SUM(LC9) = 0 THEN 0.00 ELSE ROUND(SUM(CM9) / SUM(LC9), 2 ) END AS LR9, ROUND(SUM(CM9), 0) CM9, CASE WHEN SUM(LC10) = 0 THEN 0.00 ELSE ROUND(SUM(CM10) / SUM(LC10), 2 ) END AS LR10, ROUND(SUM(CM10), 0) CM10, CASE WHEN SUM(LC11) = 0 THEN 0.00 ELSE ROUND(SUM(CM11) / SUM(LC11), 2 ) END AS LR11, ROUND(SUM(CM11), 0) CM11, CASE WHEN SUM(LC12) = 0 THEN 0.00 ELSE ROUND(SUM(CM12) / SUM(LC12), 2 ) END AS LR12, ROUND(SUM(CM12), 0) CM12, CASE WHEN SUM(LC13) = 0 THEN 0.00 ELSE ROUND(SUM(CM13) / SUM(LC13), 2 ) END AS LR13, ROUND(SUM(CM13), 0) CM13, CASE WHEN SUM(LC14) = 0 THEN 0.00 ELSE ROUND(SUM(CM14) / SUM(LC14), 2 ) END AS LR14, ROUND(SUM(CM14), 0) CM14, CASE WHEN SUM(LC15) = 0 THEN 0.00 ELSE ROUND(SUM(CM15) / SUM(LC15), 2 ) END AS LR15, ROUND(SUM(CM15), 0) CM15, CASE WHEN SUM(LC16) = 0 THEN 0.00 ELSE ROUND(SUM(CM16) / SUM(LC16), 2 ) END AS LR16, ROUND(SUM(CM16), 0) CM16, CASE WHEN SUM(LC17) = 0 THEN 0.00 ELSE ROUND(SUM(CM17) / SUM(LC17), 2 ) END AS LR17, ROUND(SUM(CM17), 0) CM17, CASE WHEN SUM(LC18) = 0 THEN 0.00 ELSE ROUND(SUM(CM18) / SUM(LC18), 2 ) END AS LR18, ROUND(SUM(CM18), 0) CM18, CASE WHEN SUM(LC19) = 0 THEN 0.00 ELSE ROUND(SUM(CM19) / SUM(LC19), 2 ) END AS LR19, ROUND(SUM(CM19), 0) CM19, CASE WHEN SUM(LC10) = 0 THEN 0.00 ELSE ROUND(SUM(CM10) / SUM(LC10), 2 ) END AS LR10, ROUND(SUM(CM10), 0) CM10, CASE WHEN SUM(LC21) = 0 THEN 0.00 ELSE ROUND(SUM(CM21) / SUM(LC21), 2 ) END AS LR21, ROUND(SUM(CM21), 0) CM21, CASE WHEN SUM(LC22) = 0 THEN 0.00 ELSE ROUND(SUM(CM22) / SUM(LC22), 2 ) END AS LR22, ROUND(SUM(CM22), 0) CM22, CASE WHEN SUM(LC23) = 0 THEN 0.00 ELSE ROUND(SUM(CM23) / SUM(LC23), 2 ) END AS LR23, ROUND(SUM(CM23), 0) CM23, CASE WHEN SUM(LC24) = 0 THEN 0.00 ELSE ROUND(SUM(CM24) / SUM(LC24), 2 ) END AS LR24, ROUND(SUM(CM24), 0) CM24, CASE WHEN SUM(LC25) = 0 THEN 0.00 ELSE ROUND(SUM(CM25) / SUM(LC25), 2 ) END AS LR25, ROUND(SUM(CM25), 0) CM25, CASE WHEN SUM(LC26) = 0 THEN 0.00 ELSE ROUND(SUM(CM26) / SUM(LC26), 2 ) END AS LR26, ROUND(SUM(CM26), 0) CM26, CASE WHEN SUM(LC27) = 0 THEN 0.00 ELSE ROUND(SUM(CM27) / SUM(LC27), 2 ) END AS LR27, ROUND(SUM(CM27), 0) CM27, CASE WHEN SUM(LC28) = 0 THEN 0.00 ELSE ROUND(SUM(CM28) / SUM(LC28), 2 ) END AS LR28, ROUND(SUM(CM28), 0) CM28, CASE WHEN SUM(LC29) = 0 THEN 0.00 ELSE ROUND(SUM(CM29) / SUM(LC29), 2 ) END AS LR29, ROUND(SUM(CM29), 0) CM29, CASE WHEN SUM(LC30) = 0 THEN 0.00 ELSE ROUND(SUM(CM30) / SUM(LC30), 2 ) END AS LR30, ROUND(SUM(CM30), 0) CM30, CASE WHEN SUM(LC31) = 0 THEN 0.00 ELSE ROUND(SUM(CM31) / SUM(LC31), 2 ) END AS LR31, ROUND(SUM(CM31), 0) CM31, CASE WHEN SUM(LC32) = 0 THEN 0.00 ELSE ROUND(SUM(CM32) / SUM(LC32), 2 ) END AS LR32, ROUND(SUM(CM32), 0) CM32, CASE WHEN SUM(LC33) = 0 THEN 0.00 ELSE ROUND(SUM(CM33) / SUM(LC33), 2 ) END AS LR33, ROUND(SUM(CM33), 0) CM33, CASE WHEN SUM(LC34) = 0 THEN 0.00 ELSE ROUND(SUM(CM34) / SUM(LC34), 2 ) END AS LR34, ROUND(SUM(CM34), 0) CM34, CASE WHEN SUM(LC35) = 0 THEN 0.00 ELSE ROUND(SUM(CM35) / SUM(LC35), 2 ) END AS LR35, ROUND(SUM(CM35), 0) CM35, CASE WHEN SUM(LC36) = 0 THEN 0.00 ELSE ROUND(SUM(CM36) / SUM(LC36), 2 ) END AS LR36, ROUND(SUM(CM36), 0) CM36, CASE WHEN SUM(LC37) = 0 THEN 0.00 ELSE ROUND(SUM(CM37) / SUM(LC37), 2 ) END AS LR37, ROUND(SUM(CM37), 0) CM37, CASE WHEN SUM(LC38) = 0 THEN 0.00 ELSE ROUND(SUM(CM38) / SUM(LC38), 2 ) END AS LR38, ROUND(SUM(CM38), 0) CM38, CASE WHEN SUM(LC39) = 0 THEN 0.00 ELSE ROUND(SUM(CM39) / SUM(LC39), 2 ) END AS LR39, ROUND(SUM(CM39), 0) CM39, CASE WHEN SUM(LC40) = 0 THEN 0.00 ELSE ROUND(SUM(CM40) / SUM(LC40), 2 ) END AS LR40, ROUND(SUM(CM40), 0) CM40, CASE WHEN SUM(LC41) = 0 THEN 0.00 ELSE ROUND(SUM(CM41) / SUM(LC41), 2 ) END AS LR41, ROUND(SUM(CM41), 0) CM41, CASE WHEN SUM(LC42) = 0 THEN 0.00 ELSE ROUND(SUM(CM42) / SUM(LC42), 2 ) END AS LR42, ROUND(SUM(CM42), 0) CM42, CASE WHEN SUM(LC43) = 0 THEN 0.00 ELSE ROUND(SUM(CM43) / SUM(LC43), 2 ) END AS LR43, ROUND(SUM(CM43), 0) CM43, CASE WHEN SUM(LC44) = 0 THEN 0.00 ELSE ROUND(SUM(CM44) / SUM(LC44), 2 ) END AS LR44, ROUND(SUM(CM44), 0) CM44, CASE WHEN SUM(LC45) = 0 THEN 0.00 ELSE ROUND(SUM(CM45) / SUM(LC45), 2 ) END AS LR45, ROUND(SUM(CM45), 0) CM45, CASE WHEN SUM(LC46) = 0 THEN 0.00 ELSE ROUND(SUM(CM46) / SUM(LC46), 2 ) END AS LR46, ROUND(SUM(CM46), 0) CM46, CASE WHEN SUM(LC47) = 0 THEN 0.00 ELSE ROUND(SUM(CM47) / SUM(LC47), 2 ) END AS LR47, ROUND(SUM(CM47), 0) CM47, CASE WHEN SUM(LC48) = 0 THEN 0.00 ELSE ROUND(SUM(CM48) / SUM(LC48), 2 ) END AS LR48, ROUND(SUM(CM48), 0) CM48, CASE WHEN SUM(LC49) = 0 THEN 0.00 ELSE ROUND(SUM(CM49) / SUM(LC49), 2 ) END AS LR49, ROUND(SUM(CM49), 0) CM49, CASE WHEN SUM(LC50) = 0 THEN 0.00 ELSE ROUND(SUM(CM50) / SUM(LC50), 2 ) END AS LR50, ROUND(SUM(CM50), 0) CM50, CASE WHEN SUM(LC51) = 0 THEN 0.00 ELSE ROUND(SUM(CM51) / SUM(LC51), 2 ) END AS LR51, ROUND(SUM(CM51), 0) CM51, CASE WHEN SUM(LC52) = 0 THEN 0.00 ELSE ROUND(SUM(CM52) / SUM(LC52), 2 ) END AS LR52, ROUND(SUM(CM52), 0) CM52, CASE WHEN SUM(LC53) = 0 THEN 0.00 ELSE ROUND(SUM(CM53) / SUM(LC53), 2 ) END AS LR53, ROUND(SUM(CM53), 0) CM53, CASE WHEN SUM(LC54) = 0 THEN 0.00 ELSE ROUND(SUM(CM54) / SUM(LC54), 2 ) END AS LR54, ROUND(SUM(CM54), 0) CM54, CASE WHEN SUM(LC55) = 0 THEN 0.00 ELSE ROUND(SUM(CM55) / SUM(LC55), 2 ) END AS LR55, ROUND(SUM(CM55), 0) CM55, CASE WHEN SUM(LC56) = 0 THEN 0.00 ELSE ROUND(SUM(CM56) / SUM(LC56), 2 ) END AS LR56, ROUND(SUM(CM56), 0) CM56, CASE WHEN SUM(LC57) = 0 THEN 0.00 ELSE ROUND(SUM(CM57) / SUM(LC57), 2 ) END AS LR57, ROUND(SUM(CM57), 0) CM57, CASE WHEN SUM(LC58) = 0 THEN 0.00 ELSE ROUND(SUM(CM58) / SUM(LC58), 2 ) END AS LR58, ROUND(SUM(CM58), 0) CM58, CASE WHEN SUM(LC59) = 0 THEN 0.00 ELSE ROUND(SUM(CM59) / SUM(LC59), 2 ) END AS LR59, ROUND(SUM(CM59), 0) CM59, CASE WHEN SUM(LC60) = 0 THEN 0.00 ELSE ROUND(SUM(CM60) / SUM(LC60), 2 ) END AS LR60, ROUND(SUM(CM60), 0) CM60, CASE WHEN SUM(LC61) = 0 THEN 0.00 ELSE ROUND(SUM(CM61) / SUM(LC61), 2 ) END AS LR61, ROUND(SUM(CM61), 0) CM61, CASE WHEN SUM(LC62) = 0 THEN 0.00 ELSE ROUND(SUM(CM62) / SUM(LC62), 2 ) END AS LR62, ROUND(SUM(CM62), 0) CM62, CASE WHEN SUM(LC63) = 0 THEN 0.00 ELSE ROUND(SUM(CM63) / SUM(LC63), 2 ) END AS LR63, ROUND(SUM(CM63), 0) CM63, CASE WHEN SUM(LC64) = 0 THEN 0.00 ELSE ROUND(SUM(CM64) / SUM(LC64), 2 ) END AS LR64, ROUND(SUM(CM64), 0) CM64 FROM t1 a INNER JOIN t2 b ON a.SID = b.SID GROUP BY a.SID, a.CDa;
[14 Apr 2021 12:10] MySQL Verification Team
Hello duan hc,

Thank you for the report and test case.

regards,
Umesh
[14 Apr 2021 12:11] MySQL Verification Team
- With release build:

ERROR 1022 (23000): Can't write; duplicate key in table '/tmp/#sql297d_8_2'

- With debug build

(gdb) bt
#0  0x00007f17b81a9aa1 in pthread_kill () from /lib64/libpthread.so.0
#1  0x00000000046c749c in my_write_core(int) ()
#2  0x0000000003315ca0 in handle_fatal_signal ()
#3  <signal handler called>
#4  0x00007f17b61c1387 in raise () from /lib64/libc.so.6
#5  0x00007f17b61c2a78 in abort () from /lib64/libc.so.6
#6  0x00007f17b61ba1a6 in __assert_fail_base () from /lib64/libc.so.6
#7  0x00007f17b61ba252 in __assert_fail () from /lib64/libc.so.6
#8  0x0000000004fb6cc0 in temptable::Indexed_column::Indexed_column(KEY_PART_INFO const&) ()
#9  0x0000000004fb5caa in temptable::Index::Index(temptable::Table const&, KEY const&) ()
#10 0x0000000004fb65ba in temptable::Hash_unique::Hash_unique(temptable::Table const&, KEY const&, temptable::Allocator<temptable::Indexed_cells, temptable::Allocation_scheme<temptable::Exponential_policy, temptable::Prefer_RAM_over_MMAP_policy> > const&) ()
#11 0x0000000004fb1715 in void temptable::Table::append_new_index<temptable::Hash_unique>(KEY const&) ()
#12 0x0000000004fafe29 in temptable::Table::indexes_create() ()
#13 0x0000000004faf5c7 in temptable::Table::Table(TABLE*, temptable::Block*, bool) ()
#14 0x0000000004fabd53 in std::pair<std::string const, temptable::Table>::pair<char const*&, 0ul, TABLE*&, temptable::Block*&, bool&, 0ul, 1ul, 2ul>(std::tuple<char const*&>&, std::tuple<TABLE*&, temptable::Block*&, bool&>&, std::_Index_tuple<0ul>, std::_Index_tuple<0ul, 1ul, 2ul>) ()
#15 0x0000000004fabab5 in std::pair<std::string const, temptable::Table>::pair<char const*&, TABLE*&, temptable::Block*&, bool&>(std::piecewise_construct_t, std::tuple<char const*&>, std::tuple<TABLE*&, temptable::Block*&, bool&>) ()
#16 0x0000000004fab738 in void __gnu_cxx::new_allocator<std::__detail::_Hash_node<std::pair<std::string const, temptable::Table>, true> >::construct<std::pair<std::string const, temptable::Table>, std::piecewise_construct_t const&, std::tuple<char const*&>&, std::tuple<TABLE*&, temptable::Block*&, bool&>&>(std::pair<std::string const, temptable::Table>*, std::piecewise_construct_t const&, std::tuple<char const*&>&, std::tuple<TABLE*&, temptable::Block*&, bool&>&)
    ()
#17 0x0000000004fab156 in void std::allocator_traits<std::allocator<std::__detail::_Hash_node<std::pair<std::string const, temptable::Table>, true> > >::construct<std::pair<std::string const, temptable::Table>, std::piecewise_construct_t const&, std::tuple<char const*&>&, std::tuple<TABLE*&, temptable::Block*&, bool&>&>(std::allocator<std::__detail::_Hash_node<std::pair<std::string const, temptable::Table>, true> >&, std::pair<std::string const, temptable::Table>*, std::piecewise_construct_t const&, std::tuple<char const*&>&, std::tuple<TABLE*&, temptable::Block*&, bool&>&) ()
#18 0x0000000004faa841 in std::__detail::_Hash_node<std::pair<std::string const, temptable::Table>, true>* std::__detail::_Hashtable_alloc<std::allocator<std::__detail::_Hash_node<std::pair<std::string const, temptable::Table>, true> > >::_M_allocate_node<std::piecewise_construct_t const&, std::tuple<char const*&>&, std::tuple<TABLE*&, temptable::Block*&, bool&>&>(std::piecewise_construct_t const&, std::tuple<char const*&>&, std::tuple<TABLE*&, temptable::Block*&, bool&>&) ()
#19 0x0000000004fa9f7c in std::pair<std::__detail::_Node_iterator<std::pair<std::string const, temptable::Table>, false, true>, bool> std::_Hashtable<std::string, std::pair<std::string const, temptable::Table>, std::allocator<std::pair<std::string const, temptable::Table> >, std::__detail::_Select1st, std::equal_to<std::string>, std::hash<std::string>, std::__detail::_Mod_range_hashing, std::__detail::_Default_ranged_hash, std::__detail::_Prime_rehash_policy, std::__detail::_Hashtable_traits<true, false, true> >::_M_emplace<std::piecewise_construct_t const&, std::tuple<char const*&>&, std::tuple<TABLE*&, temptable::Block*&, bool&>&>(std::integral_constant<bool, true>, std::piecewise_construct_t const&, std::tuple<char const*&>&, std::tuple<TABLE*&, temptable::Block*&, bool&>&) ()
#20 0x0000000004fa98e8 in std::pair<std::__detail::_Node_iterator<std::pair<std::string const, temptable::Table>, false, true>, bool> std::_Hashtable<std::string, std::pair<std::string const, temptable::Table>, std::allocator<std::pair<std::string const, temptable::Table> >, std::__detail::_Select1st, std::equal_to<std::string>, std::hash<std::string>, std::__detail::_Mod_range_hashing, std::__detail::_Default_ranged_hash, std::__detail::_Prime_rehash_policy, std::__detail::_Hashtable_traits<true, false, true> >::emplace<std::piecewise_construct_t const&, std::tuple<char const*&>&, std::tuple<TABLE*&, temptable::Block*&, bool&>&>(std::piecewise_construct_t const&, std::tuple<char const*&>&, std::tuple<TABLE*&, temptable::Block*&, bool&>&) ()
#21 0x0000000004fa9286 in std::pair<std::__detail::_Node_iterator<std::pair<std::string const, temptable::Table>, false, true>, bool> std::unordered_map<std::string, temptable::Table, std::hash<std::string>, std::equal_to<std::string>, std::allocator<std::pair<std::string const, temptable::Table> > >::emplace<std::piecewise_construct_t const&, std::tuple<char const*&>&, std::tuple<TABLE*&, temptable::Block*&, bool&>&>(std::piecewise_construct_t const&, std::tuple<char const*&>&, std::tuple<TABLE*&, temptable::Block*&, bool&>&) ()
#22 0x0000000004fa8889 in std::pair<std::__detail::_Node_iterator<std::pair<std::string const, temptable::Table>, false, true>, bool> temptable::Key_value_store<std::shared_timed_mutex, std::unordered_map>::emplace<std::piecewise_construct_t const&, std::tuple<char const*&>, std::tuple<TABLE*&, temptable::Block*&, bool&> >(std::piecewise_construct_t const&, std::tuple<char const*&>&&, std::tuple<TABLE*&, temptable::Block*&, bool&>&&) ()
#23 0x0000000004fa264c in temptable::Handler::create(char const*, TABLE*, HA_CREATE_INFO*, dd::Table*) ()
#24 0x0000000003245d50 in create_tmp_table_with_fallback(TABLE*) ()
#25 0x000000000324634c in instantiate_tmp_table(THD*, TABLE*) ()
#26 0x00000000037fcdfa in TemptableAggregateIterator::Init() ()
#27 0x00000000032570ab in SELECT_LEX_UNIT::ExecuteIteratorQuery(THD*) ()
#28 0x0000000003257439 in SELECT_LEX_UNIT::execute(THD*) ()
#29 0x00000000031b123e in Sql_cmd_dml::execute_inner(THD*) ()
#30 0x00000000031b07ba in Sql_cmd_dml::execute(THD*) ()
#31 0x000000000313ad54 in mysql_execute_command(THD*, bool) ()
#32 0x000000000313cc20 in dispatch_sql_command(THD*, Parser_state*) ()
#33 0x000000000313328e in dispatch_command(THD*, COM_DATA const*, enum_server_command) ()
#34 0x00000000031316de in do_command(THD*) ()
#35 0x0000000003300855 in handle_connection ()
#36 0x0000000004edc0d5 in pfs_spawn_thread ()
#37 0x00007f17b81a4ea5 in start_thread () from /lib64/libpthread.so.0
#38 0x00007f17b62898dd in clone () from /lib64/libc.so.6
[15 Apr 2021 5:22] MySQL Verification Team
After analysis Developer concluded that this is duplicate of Bug #102468, please see Bug #102468. Thank you!

regards,
Umesh