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: | |
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
[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