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

Crashing SHOW TABLES with derived table in WHERE condition

Details

    • Bug
    • Status: Closed (View Workflow)
    • Blocker
    • Resolution: Fixed
    • 10.3.22, 10.2(EOL), 10.3(EOL), 10.4(EOL), 10.5
    • 10.2.38, 10.3.29, 10.4.19, 10.5.10
    • Server
    • None

    Description

      2020-01-30  6:53:20 9 [Warning] Checking table:   './coachsolutions_mitesh_host/f38_posts'
      200130  6:53:29 [ERROR] mysqld got signal 11 ;
      This could be because you hit a bug. It is also possible that this binary
      or one of the libraries it was linked against is corrupt, improperly built,
      or misconfigured. This error can also be caused by malfunctioning hardware.
       
      To report this bug, see https://mariadb.com/kb/en/reporting-bugs
       
      We will try our best to scrape up some info that will hopefully help
      diagnose the problem, but since we have already crashed, 
      something is definitely wrong and this may fail.
       
      Server version: 10.3.22-MariaDB-1:10.3.22+maria~bionic-log
      key_buffer_size=134217728
      read_buffer_size=131072
      max_used_connections=2
      max_threads=502
      thread_count=8
      It is possible that mysqld could use up to 
      key_buffer_size + (read_buffer_size + sort_buffer_size)*max_threads = 1234708 K  bytes of memory
      Hope that's ok; if not, decrease some variables in the equation.
       
      Thread pointer: 0x7f1984000c08
      Attempting backtrace. You can use the following information to find out
      where mysqld died. If you see no messages after this, something went
      terribly wrong...
      stack_bottom = 0x7f1c1812add8 thread_stack 0x49000
      /usr/sbin/mysqld(my_print_stacktrace+0x2e)[0x55c6247ce2ee]
      /usr/sbin/mysqld(handle_fatal_signal+0x515)[0x55c624266005]
      /lib/x86_64-linux-gnu/libpthread.so.0(+0x12890)[0x7f1c1ac16890]
      /usr/sbin/mysqld(_Z17calculate_key_lenP5TABLEjPKhm+0x0)[0x55c624139a70]
      /usr/sbin/mysqld(+0x5ceed8)[0x55c6240caed8]
      /usr/sbin/mysqld(_Z10sub_selectP4JOINP13st_join_tableb+0x151)[0x55c6240bd571]
      /usr/sbin/mysqld(+0x5b6088)[0x55c6240b2088]
      /usr/sbin/mysqld(_Z10sub_selectP4JOINP13st_join_tableb+0x172)[0x55c6240bd592]
      /usr/sbin/mysqld(_ZN4JOIN10exec_innerEv+0x946)[0x55c6240dd5c6]
      /usr/sbin/mysqld(_ZN4JOIN4execEv+0x33)[0x55c6240dd913]
      /usr/sbin/mysqld(_Z12mysql_selectP3THDP10TABLE_LISTjR4ListI4ItemEPS4_jP8st_orderS9_S7_S9_yP13select_resultP18st_select_lex_unitP13st_select_lex+0xeb)[0x55c6240dbf8b]
      /usr/sbin/mysqld(_Z13handle_selectP3THDP3LEXP13select_resultm+0x14d)[0x55c6240dc8fd]
      /usr/sbin/mysqld(+0x5814f1)[0x55c62407d4f1]
      /usr/sbin/mysqld(_Z21mysql_execute_commandP3THD+0x5fb0)[0x55c62408a210]
      /usr/sbin/mysqld(_Z11mysql_parseP3THDPcjP12Parser_statebb+0x20a)[0x55c62408c54a]
      /usr/sbin/mysqld(_Z16dispatch_command19enum_server_commandP3THDPcjbb+0x1c57)[0x55c62408eec7]
      /usr/sbin/mysqld(_Z10do_commandP3THD+0x178)[0x55c62408fc88]
      /usr/sbin/mysqld(_Z24do_handle_one_connectionP7CONNECT+0x33e)[0x55c62416299e]
      /usr/sbin/mysqld(handle_one_connection+0x3d)[0x55c624162a6d]
      nptl/pthread_create.c:463(start_thread)[0x7f1c1ac0b6db]
      x86_64/clone.S:97(clone)[0x7f1c1a20d88f]
       
      Trying to get some variables.
      Some pointers may be invalid and cause the dump to abort.
      Query (0x7f1984061e70): SHOW TABLES WHERE `Tables_in_coachsolutions_mitesh_host` IN ('f38_users', 'f38_usermeta', 'f38_blogs', 'f38_blogmeta', 'f38_signups', 'f38_site', 'f38_sitemeta', 'f38_registration_log', 'f38_posts', 'f38_comments', 'f38_links', 'f38_options', 'f38_postmeta', 'f38_terms', 'f38_term_taxonomy', 'f38_term_relationships', 'f38_termmeta', 'f38_commentmeta', 'f38_4_posts', 'f38_4_comments', 'f38_4_links', 'f38_4_options', 'f38_4_postmeta', 'f38_4_terms', 'f38_4_term_taxonomy', 'f38_4_term_relationships', 'f38_4_termmeta', 'f38_4_commentmeta', 'f38_13_posts', 'f38_13_comments', 'f38_13_links', 'f38_13_options', 'f38_13_postmeta', 'f38_13_terms', 'f38_13_term_taxonomy', 'f38_13_term_relationships', 'f38_13_termmeta', 'f38_13_commentmeta', 'f38_12_posts', 'f38_12_comments', 'f38_12_links', 'f38_12_options', 'f38_12_postmeta', 'f38_12_terms', 'f38_12_term_taxonomy', 'f38_12_term_relationships', 'f38_12_termmeta', 'f38_12_commentmeta', 'f38_16_posts', 'f38_16_comments', 'f38_16_links', 'f38_16_options', 'f38_16_postmeta', 'f38_16_terms', 'f38_16_term_taxonomy', 'f38_16_term_relationships', 'f38_16_termmeta', 'f38_16_commentmeta', 'f38_15_posts', 'f38_15_comments', 'f38_15_links', 'f38_15_options', 'f38_15_postmeta', 'f38_15_terms', 'f38_15_term_taxonomy', 'f38_15_term_relationships', 'f38_15_termmeta', 'f38_15_commentmeta', 'f38_19_posts', 'f38_19_comments', 'f38_19_links', 'f38_19_options', 'f38_19_postmeta', 'f38_19_terms', 'f38_19_term_taxonomy', 'f38_19_term_relationships', 'f38_19_termmeta', 'f38_19_commentmeta', 'f38_20_posts', 'f38_20_comments', 'f38_20_links', 'f38_20_options', 'f38_20_postmeta', 'f38_20_terms', 'f38_20_term_taxonomy', 'f38_20_term_relationships', 'f38_20_termmeta', 'f38_20_commentmeta', 'f38_21_posts', 'f38_21_comments', 'f38_21_links', 'f38_21_options', 'f38_21_postmeta', 'f38_21_terms', 'f38_21_term_taxonomy', 'f38_21_term_relationships', 'f38_21_termmeta', 'f38_21_commentmeta', 'f38_22_posts', 'f38_22_comments', 'f38_22_links', 'f38_22_options', 'f38_22_postmeta', 'f38_22_terms', 'f38_22_term_taxonomy', 'f38_22_term_relationships', 'f38_22_termmeta', 'f38_22_commentmeta', 'f38_23_posts', 'f38_23_comments', 'f38_23_links', 'f38_23_options', 'f38_23_postmeta', 'f38_23_terms', 'f38_23_term_taxonomy', 'f38_23_term_relationships', 'f38_23_termmeta', 'f38_23_commentmeta', 'f38_45_posts', 'f38_45_comments', 'f38_45_links', 'f38_45_options', 'f38_45_postmeta', 'f38_45_terms', 'f38_45_term_taxonomy', 'f38_45_term_relationships', 'f38_45_termmeta', 'f38_45_commentmeta', 'f38_75_posts', 'f38_75_comments', 'f38_75_links', 'f38_75_options', 'f38_75_postmeta', 'f38_75_terms', 'f38_75_term_taxonomy', 'f38_75_term_relationships', 'f38_75_termmeta', 'f38_75_commentmeta', 'f38_78_posts', 'f38_78_comments', 'f38_78_links', 'f38_78_options', 'f38_78_postmeta', 'f38_78_terms', 'f38_78_term_taxonomy', 'f38_78_term_relationships', 'f38_78_termmeta', 'f38_78_commentmeta', 'f38_28_posts', 'f38_28_comments', 'f38_28_links', 'f38_28_options', 'f38_28_postmeta', 'f38_28_terms', 'f38_28_term_taxonomy', 'f38_28_term_relationships', 'f38_28_termmeta', 'f38_28_commentmeta', 'f38_31_posts', 'f38_31_comments', 'f38_31_links', 'f38_31_options', 'f38_31_postmeta', 'f38_31_terms', 'f38_31_term_taxonomy', 'f38_31_term_relationships', 'f38_31_termmeta', 'f38_31_commentmeta', 'f38_30_posts', 'f38_30_comments', 'f38_30_links', 'f38_30_options', 'f38_30_postmeta', 'f38_30_terms', 'f38_30_term_taxonomy', 'f38_30_term_relationships', 'f38_30_termmeta', 'f38_30_commentmeta', 'f38_32_posts', 'f38_32_comments', 'f38_32_links', 'f38_32_options', 'f38_32_postmeta', 'f38_32_terms', 'f38_32_term_taxonomy', 'f38_32_term_relationships', 'f38_32_termmeta', 'f38_32_commentmeta', 'f38_34_posts', 'f38_34_comments', 'f38_34_links', 'f38_34_options', 'f38_34_postmeta', 'f38_34_terms', 'f38_34_term_taxonomy', 'f38_34_term_relationships', 'f38_34_termmeta', 'f38_34_commentmeta', 'f38_35_posts', 'f38_35_comments', 'f38_35_links', 'f38_35_options', 'f38_35_postmeta', 'f38_35_terms', 'f38_35_term_taxonomy', 'f38_35_term_relationships', 'f38_35_termmeta', 'f38_35_commentmeta', 'f38_36_posts', 'f38_36_comments', 'f38_36_links', 'f38_36_options', 'f38_36_postmeta', 'f38_36_terms', 'f38_36_term_taxonomy', 'f38_36_term_relationships', 'f38_36_termmeta', 'f38_36_commentmeta', 'f38_38_posts', 'f38_38_comments', 'f38_38_links', 'f38_38_options', 'f38_38_postmeta', 'f38_38_terms', 'f38_38_term_taxonomy', 'f38_38_term_relationships', 'f38_38_termmeta', 'f38_38_commentmeta', 'f38_39_posts', 'f38_39_comments', 'f38_39_links', 'f38_39_options', 'f38_39_postmeta', 'f38_39_terms', 'f38_39_term_taxonomy', 'f38_39_term_relationships', 'f38_39_termmeta', 'f38_39_commentmeta', 'f38_46_posts', 'f38_46_comments', 'f38_46_links', 'f38_46_options', 'f38_46_postmeta', 'f38_46_terms', 'f38_46_term_taxonomy', 'f38_46_term_relationships', 'f38_46_termmeta', 'f38_46_commentmeta', 'f38_51_posts', 'f38_51_comments', 'f38_51_links', 'f38_51_options', 'f38_51_postmeta', 'f38_51_terms', 'f38_51_term_taxonomy', 'f38_51_term_relationships', 'f38_51_termmeta', 'f38_51_commentmeta', 'f38_70_posts', 'f38_70_comments', 'f38_70_links', 'f38_70_options', 'f38_70_postmeta', 'f38_70_terms', 'f38_70_term_taxonomy', 'f38_70_term_relationships', 'f38_70_termmeta', 'f38_70_commentmeta', 'f38_48_posts', 'f38_48_comments', 'f38_48_links', 'f38_48_options', 'f38_48_postmeta', 'f38_48_terms', 'f38_48_term_taxonomy', 'f38_48_term_relationships', 'f38_48_termmeta', 'f38_48_commentmeta', 'f38_49_posts', 'f38_49_comments', 'f38_49_links', 'f38_49_options', 'f38_49_postmeta', 'f38_49_terms', 'f38_49_term_taxonomy', 'f38_49_term_relationships', 'f38_49_termmeta', 'f38_49_commentmeta', 'f38_190_posts', 'f38_190_comments', 'f38_190_links', 'f38_190_options', 'f38_190_postmeta', 'f38_190_terms', 'f38_190_term_taxonomy', 'f38_190_term_relationships', 'f38_190_termmeta', 'f38_190_commentmeta', 'f38_52_posts', 'f38_52_comments', 'f38_52_links', 'f38_52_options', 'f38_52_postmeta', 'f38_52_terms', 'f38_52_term_taxonomy', 'f38_52_term_relationships', 'f38_52_termmeta', 'f38_52_commentmeta', 'f38_166_posts', 'f38_166_comments', 'f38_166_links', 'f38_166_options', 'f38_166_postmeta', 'f38_166_terms', 'f38_166_term_taxonomy', 'f38_166_term_relationships', 'f38_166_termmeta', 'f38_166_commentmeta', 'f38_54_posts', 'f38_54_comments', 'f38_54_links', 'f38_54_options', 'f38_54_postmeta', 'f38_54_terms', 'f38_54_term_taxonomy', 'f38_54_term_relationships', 'f38_54_termmeta', 'f38_54_commentmeta', 'f38_55_posts', 'f38_55_comments', 'f38_55_links', 'f38_55_options', 'f38_55_postmeta', 'f38_55_terms', 'f38_55_term_taxonomy', 'f38_55_term_relationships', 'f38_55_termmeta', 'f38_55_commentmeta', 'f38_124_posts', 'f38_124_comments', 'f38_124_links', 'f38_124_options', 'f38_124_postmeta', 'f38_124_terms', 'f38_124_term_taxonomy', 'f38_124_term_relationships', 'f38_124_termmeta', 'f38_124_commentmeta', 'f38_60_posts', 'f38_60_comments', 'f38_60_links', 'f38_60_options', 'f38_60_postmeta', 'f38_60_terms', 'f38_60_term_taxonomy', 'f38_60_term_relationships', 'f38_60_termmeta', 'f38_60_commentmeta', 'f38_61_posts', 'f38_61_comments', 'f38_61_links', 'f38_61_options', 'f38_61_postmeta', 'f38_61_terms', 'f38_61_term_taxonomy', 'f38_61_term_relationships', 'f38_61_termmeta', 'f38_61_commentmeta', 'f38_63_posts', 'f38_63_comments', 'f38_63_links', 'f38_63_options', 'f38_63_postmeta', 'f38_63_terms', 'f38_63_term_taxonomy', 'f38_63_term_relationships', 'f38_63_termmeta', 'f38_63_commentmeta', 'f38_114_posts', 'f38_114_comments', 'f38_114_links', 'f38_114_options', 'f38_114_postmeta', 'f38_114_terms', 'f38_114_term_taxonomy', 'f38_114_term_relationships', 'f38_114_termmeta', 'f38_114_commentmeta', 'f38_65_posts', 'f38_65_comments', 'f38_65_links', 'f38_65_options', 'f38_65_postmeta', 'f38_65_terms', 'f38_65_term_taxonomy', 'f38_65_term_relationships', 'f38_65_termmeta', 'f38_65_commentmeta', 'f38_113_posts', 'f38_113_comments', 'f38_113_links', 'f38_113_options', 'f38_113_postmeta', 'f38_113_terms', 'f38_113_term_taxonomy', 'f38_113_term_relationships', 'f38_113_termmeta', 'f38_113_commentmeta', 'f38_67_posts', 'f38_67_comments', 'f38_67_links', 'f38_67_options', 'f38_67_postmeta', 'f38_67_terms', 'f38_67_term_taxonomy', 'f38_67_term_relationships', 'f38_67_termmeta', 'f38_67_commentmeta', 'f38_69_posts', 'f38_69_comments', 'f38_69_links', 'f38_69_options', 'f38_69_postmeta', 'f38_69_terms', 'f38_69_term_taxonomy', 'f38_69_term_relationships', 'f38_69_termmeta', 'f38_69_commentmeta', 'f38_72_posts', 'f38_72_comments', 'f38_72_links', 'f38_72_options', 'f38_72_postmeta', 'f38_72_terms', 'f38_72_term_taxonomy', 'f38_72_term_relationships', 'f38_72_termmeta', 'f38_72_commentmeta', 'f38_122_posts', 'f38_122_comments', 'f38_122_links', 'f38_122_options', 'f38_122_postmeta', 'f38_122_terms', 'f38_122_term_taxonomy', 'f38_122_term_relationships', 'f38_122_termmeta', 'f38_122_commentmeta', 'f38_82_posts', 'f38_82_comments', 'f38_82_links', 'f38_82_options', 'f38_82_postmeta', 'f38_82_terms', 'f38_82_term_taxonomy', 'f38_82_term_relationships', 'f38_82_termmeta', 'f38_82_commentmeta', 'f38_83_posts', 'f38_83_comments', 'f38_83_links', 'f38_83_options', 'f38_83_postmeta', 'f38_83_terms', 'f38_83_term_taxonomy', 'f38_83_term_relationships', 'f38_83_termmeta', 'f38_83_commentmeta', 'f38_120_posts', 'f38_120_comments', 'f38_120_links', 'f38_120_options', 'f38_120_postmeta', 'f38_120_terms', 'f38_120_term_taxonomy', 'f38_120_term_relationships', 'f38_120_termmeta', 'f38_120_commentmeta', 'f38_85_posts', 'f38_85_comments', 'f38_85_links', 'f38_85_options', 'f38_85_postmeta', 'f38_85_terms', 'f38_85_term_taxonomy', 'f38_85_term_relationships', 'f38_85_termmeta', 'f38_85_commentmeta', 'f38_119_posts', 'f38_119_comments', 'f38_119_links', 'f38_119_options', 'f38_119_postmeta', 'f38_119_terms', 'f38_119_term_taxonomy', 'f38_119_term_relationships', 'f38_119_termmeta', 'f38_119_commentmeta', 'f38_121_posts', 'f38_121_comments', 'f38_121_links', 'f38_121_options', 'f38_121_postmeta', 'f38_121_terms', 'f38_121_term_taxonomy', 'f38_121_term_relationships', 'f38_121_termmeta', 'f38_121_commentmeta', 'f38_116_posts', 'f38_116_comments', 'f38_116_links', 'f38_116_options', 'f38_116_postmeta', 'f38_116_terms', 'f38_116_term_taxonomy', 'f38_116_term_relationships', 'f38_116_termmeta', 'f38_116_commentmeta', 'f38_90_posts', 'f38_90_comments', 'f38_90_links', 'f38_90_options', 'f38_90_postmeta', 'f38_90_terms', 'f38_90_term_taxonomy', 'f38_90_term_relationships', 'f38_90_termmeta', 'f38_90_commentmeta', 'f38_91_posts', 'f38_91_comments', 'f38_91_links', 'f38_91_options', 'f38_91_postmeta', 'f38_91_terms', 'f38_91_term_taxonomy', 'f38_91_term_relationships', 'f38_91_termmeta', 'f38_91_commentmeta', 'f38_94_posts', 'f38_94_comments', 'f38_94_links', 'f38_94_options', 'f38_94_postmeta', 'f38_94_terms', 'f38_94_term_taxonomy', 'f38_94_term_relationships', 'f38_94_termmeta', 'f38_94_commentmeta', 'f38_171_posts', 'f38_171_comments', 'f38_171_links', 'f38_171_options', 'f38_171_postmeta', 'f38_171_terms', 'f38_171_term_taxonomy', 'f38_171_term_relationships', 'f38_171_termmeta', 'f38_171_commentmeta', 'f38_96_posts', 'f38_96_comments', 'f38_96_links', 'f38_96_options', 'f38_96_postmeta', 'f38_96_terms', 'f38_96_term_taxonomy', 'f38_96_term_relationships', 'f38_96_termmeta', 'f38_96_commentmeta', 'f38_98_posts', 'f38_98_comments', 'f38_98_links', 'f38_98_options', 'f38_98_postmeta', 'f38_98_terms', 'f38_98_term_taxonomy', 'f38_98_term_relationships', 'f38_98_termmeta', 'f38_98_commentmeta', 'f38_99_posts', 'f38_99_comments', 'f38_99_links', 'f38_99_options', 'f38_99_postmeta', 'f38_99_terms', 'f38_99_term_taxonomy', 'f38_99_term_relationships', 'f38_99_termmeta', 'f38_99_commentmeta', 'f38_100_posts', 'f38_100_comments', 'f38_100_links', 'f38_100_options', 'f38_100_postmeta', 'f38_100_terms', 'f38_100_term_taxonomy', 'f38_100_term_relationships', 'f38_100_termmeta', 'f38_100_commentmeta', 'f38_103_posts', 'f38_103_comments', 'f38_103_links', 'f38_103_options', 'f38_103_postmeta', 'f38_103_terms', 'f38_103_term_taxonomy', 'f38_103_term_relationships', 'f38_103_termmeta', 'f38_103_commentmeta', 'f38_104_posts', 'f38_104_comments', 'f38_104_links', 'f38_104_options', 'f38_104_postmeta', 'f38_104_terms', 'f38_104_term_taxonomy', 'f38_104_term_relationships', 'f38_104_termmeta', 'f38_104_commentmeta', 'f38_105_posts', 'f38_105_comments', 'f38_105_links', 'f38_105_options', 'f38_105_postmeta', 'f38_105_terms', 'f38_105_term_taxonomy', 'f38_105_term_relationships', 'f38_105_termmeta', 'f38_105_commentmeta', 'f38_106_posts', 'f38_106_comments', 'f38_106_links', 'f38_106_options', 'f38_106_postmeta', 'f38_106_terms', 'f38_106_term_taxonomy', 'f38_106_term_relationships', 'f38_106_termmeta', 'f38_106_commentmeta', 'f38_107_posts', 'f38_107_comments', 'f38_107_links', 'f38_107_options', 'f38_107_postmeta', 'f38_107_terms', 'f38_107_term_taxonomy', 'f38_107_term_relationships', 'f38_107_termmeta', 'f38_107_commentmeta', 'f38_108_posts', 'f38_108_comments', 'f38_108_links', 'f38_108_options', 'f38_108_postmeta', 'f38_108_terms', 'f38_108_term_taxonomy', 'f38_108_term_relationships', 'f38_108_termmeta', 'f38_108_commentmeta', 'f38_123_posts', 'f38_123_comments', 'f38_123_links', 'f38_123_options', 'f38_123_postmeta', 'f38_123_terms', 'f38_123_term_taxonomy', 'f38_123_term_relationships', 'f38_123_termmeta', 'f38_123_commentmeta', 'f38_117_posts', 'f38_117_comments', 'f38_117_links', 'f38_117_options', 'f38_117_postmeta', 'f38_117_terms', 'f38_117_term_taxonomy', 'f38_117_term_relationships', 'f38_117_termmeta', 'f38_117_commentmeta', 'f38_118_posts', 'f38_118_comments', 'f38_118_links', 'f38_118_options', 'f38_118_postmeta', 'f38_118_terms', 'f38_118_term_taxonomy', 'f38_118_term_relationships', 'f38_118_termmeta', 'f38_118_commentmeta', 'f38_125_posts', 'f38_125_comments', 'f38_125_links', 'f38_125_options', 'f38_125_postmeta', 'f38_125_terms', 'f38_125_term_taxonomy', 'f38_125_term_relationships', 'f38_125_termmeta', 'f38_125_commentmeta', 'f38_126_posts', 'f38_126_comments', 'f38_126_links', 'f38_126_options', 'f38_126_postmeta', 'f38_126_terms', 'f38_126_term_taxonomy', 'f38_126_term_relationships', 'f38_126_termmeta', 'f38_126_commentmeta', 'f38_127_posts', 'f38_127_comments', 'f38_127_links', 'f38_127_options', 'f38_127_postmeta', 'f38_127_terms', 'f38_127_term_taxonomy', 'f38_127_term_relationships', 'f38_127_termmeta', 'f38_127_commentmeta', 'f38_128_posts', 'f38_128_comments', 'f38_128_links', 'f38_128_options', 'f38_128_postmeta', 'f38_128_terms', 'f38_128_term_taxonomy', 'f38_128_term_relationships', 'f38_128_termmeta', 'f38_128_commentmeta', 'f38_129_posts', 'f38_129_comments', 'f38_129_links', 'f38_129_options', 'f38_129_postmeta', 'f38_129_terms', 'f38_129_term_taxonomy', 'f38_129_term_relationships', 'f38_129_termmeta', 'f38_129_commentmeta', 'f38_130_posts', 'f38_130_comments', 'f38_130_links', 'f38_130_options', 'f38_130_postmeta', 'f38_130_terms', 'f38_130_term_taxonomy', 'f38_130_term_relationships', 'f38_130_termmeta', 'f38_130_commentmeta', 'f38_131_posts', 'f38_131_comments', 'f38_131_links', 'f38_131_options', 'f38_131_postmeta', 'f38_131_terms', 'f38_131_term_taxonomy', 'f38_131_term_relationships', 'f38_131_termmeta', 'f38_131_commentmeta', 'f38_132_posts', 'f38_132_comments', 'f38_132_links', 'f38_132_options', 'f38_132_postmeta', 'f38_132_terms', 'f38_132_term_taxonomy', 'f38_132_term_relationships', 'f38_132_termmeta', 'f38_132_commentmeta', 'f38_133_posts', 'f38_133_comments', 'f38_133_links', 'f38_133_options', 'f38_133_postmeta', 'f38_133_terms', 'f38_133_term_taxonomy', 'f38_133_term_relationships', 'f38_133_termmeta', 'f38_133_commentmeta', 'f38_134_posts', 'f38_134_comments', 'f38_134_links', 'f38_134_options', 'f38_134_postmeta', 'f38_134_terms', 'f38_134_term_taxonomy', 'f38_134_term_relationships', 'f38_134_termmeta', 'f38_134_commentmeta', 'f38_135_posts', 'f38_135_comments', 'f38_135_links', 'f38_135_options', 'f38_135_postmeta', 'f38_135_terms', 'f38_135_term_taxonomy', 'f38_135_term_relationships', 'f38_135_termmeta', 'f38_135_commentmeta', 'f38_136_posts', 'f38_136_comments', 'f38_136_links', 'f38_136_options', 'f38_136_postmeta', 'f38_136_terms', 'f38_136_term_taxonomy', 'f38_136_term_relationships', 'f38_136_termmeta', 'f38_136_commentmeta', 'f38_137_posts', 'f38_137_comments', 'f38_137_links', 'f38_137_options', 'f38_137_postmeta', 'f38_137_terms', 'f38_137_term_taxonomy', 'f38_137_term_relationships', 'f38_137_termmeta', 'f38_137_commentmeta', 'f38_138_posts', 'f38_138_comments', 'f38_138_links', 'f38_138_options', 'f38_138_postmeta', 'f38_138_terms', 'f38_138_term_taxonomy', 'f38_138_term_relationships', 'f38_138_termmeta', 'f38_138_commentmeta', 'f38_139_posts', 'f38_139_comments', 'f38_139_links', 'f38_139_options', 'f38_139_postmeta', 'f38_139_terms', 'f38_139_term_taxonomy', 'f38_139_term_relationships', 'f38_139_termmeta', 'f38_139_commentmeta', 'f38_140_posts', 'f38_140_comments', 'f38_140_links', 'f38_140_options', 'f38_140_postmeta', 'f38_140_terms', 'f38_140_term_taxonomy', 'f38_140_term_relationships', 'f38_140_termmeta', 'f38_140_commentmeta', 'f38_141_posts', 'f38_141_comments', 'f38_141_links', 'f38_141_options', 'f38_141_postmeta', 'f38_141_terms', 'f38_141_term_taxonomy', 'f38_141_term_relationships', 'f38_141_termmeta', 'f38_141_commentmeta', 'f38_142_posts', 'f38_142_comments', 'f38_142_links', 'f38_142_options', 'f38_142_postmeta', 'f38_142_terms', 'f38_142_term_taxonomy', 'f38_142_term_relationships', 'f38_142_termmeta', 'f38_142_commentmeta', 'f38_143_posts', 'f38_143_comments', 'f38_143_links', 'f38_143_options', 'f38_143_postmeta', 'f38_143_terms', 'f38_143_term_taxonomy', 'f38_143_term_relationships', 'f38_143_termmeta', 'f38_143_commentmeta', 'f38_144_posts', 'f38_144_comments', 'f38_144_links', 'f38_144_options', 'f38_144_postmeta', 'f38_144_terms', 'f38_144_term_taxonomy', 'f38_144_term_relationships', 'f38_144_termmeta', 'f38_144_commentmeta', 'f38_145_posts', 'f38_145_comments', 'f38_145_links', 'f38_145_options', 'f38_145_postmeta', 'f38_145_terms', 'f38_145_term_taxonomy', 'f38_145_term_relationships', 'f38_145_termmeta', 'f38_145_commentmeta', 'f38_146_posts', 'f38_146_comments', 'f38_146_links', 'f38_146_options', 'f38_146_postmeta', 'f38_146_terms', 'f38_146_term_taxonomy', 'f38_146_term_relationships', 'f38_146_termmeta', 'f38_146_commentmeta', 'f38_147_posts', 'f38_147_comments', 'f38_147_links', 'f38_147_options', 'f38_147_postmeta', 'f38_147_terms', 'f38_147_term_taxonomy', 'f38_147_term_relationships', 'f38_147_termmeta', 'f38_147_commentmeta', 'f38_148_posts', 'f38_148_comments', 'f38_148_links', 'f38_148_options', 'f38_148_postmeta', 'f38_148_terms', 'f38_148_term_taxonomy', 'f38_148_term_relationships', 'f38_148_termmeta', 'f38_148_commentmeta', 'f38_149_posts', 'f38_149_comments', 'f38_149_links', 'f38_149_options', 'f38_149_postmeta', 'f38_149_terms', 'f38_149_term_taxonomy', 'f38_149_term_relationships', 'f38_149_termmeta', 'f38_149_commentmeta', 'f38_150_posts', 'f38_150_comments', 'f38_150_links', 'f38_150_options', 'f38_150_postmeta', 'f38_150_terms', 'f38_150_term_taxonomy', 'f38_150_term_relationships', 'f38_150_termmeta', 'f38_150_commentmeta', 'f38_151_posts', 'f38_151_comments', 'f38_151_links', 'f38_151_options', 'f38_151_postmeta', 'f38_151_terms', 'f38_151_term_taxonomy', 'f38_151_term_relationships', 'f38_151_termmeta', 'f38_151_commentmeta', 'f38_182_posts', 'f38_182_comments', 'f38_182_links', 'f38_182_options', 'f38_182_postmeta', 'f38_182_terms', 'f38_182_term_taxonomy', 'f38_182_term_relationships', 'f38_182_termmeta', 'f38_182_commentmeta', 'f38_181_posts', 'f38_181_comments', 'f38_181_links', 'f38_181_options', 'f38_181_postmeta', 'f38_181_terms', 'f38_181_term_taxonomy', 'f38_181_term_relationships', 'f38_181_termmeta', 'f38_181_commentmeta', 'f38_180_posts', 'f38_180_comments', 'f38_180_links', 'f38_180_options', 'f38_180_postmeta', 'f38_180_terms', 'f38_180_term_taxonomy', 'f38_180_term_relationships', 'f38_180_termmeta', 'f38_180_commentmeta', 'f38_178_posts', 'f38_178_comments', 'f38_178_links', 'f38_178_options', 'f38_178_postmeta', 'f38_178_terms', 'f38_178_term_taxonomy', 'f38_178_term_relationships', 'f38_178_termmeta', 'f38_178_commentmeta', 'f38_177_posts', 'f38_177_comments', 'f38_177_links', 'f38_177_options', 'f38_177_postmeta', 'f38_177_terms', 'f38_177_term_taxonomy', 'f38_177_term_relationships', 'f38_177_termmeta', 'f38_177_commentmeta', 'f38_176_posts', 'f38_176_comments', 'f38_176_links', 'f38_176_options', 'f38_176_postmeta', 'f38_176_terms', 'f38_176_term_taxonomy', 'f38_176_term_relationships', 'f38_176_termmeta', 'f38_176_commentmeta', 'f38_175_posts', 'f38_175_comments', 'f38_175_links', 'f38_175_options', 'f38_175_postmeta', 'f38_175_terms', 'f38_175_term_taxonomy', 'f38_175_term_relationships', 'f38_175_termmeta', 'f38_175_commentmeta', 'f38_174_posts', 'f38_174_comments', 'f38_174_links', 'f38_174_options', 'f38_174_postmeta', 'f38_174_terms', 'f38_174_term_taxonomy', 'f38_174_term_relationships', 'f38_174_termmeta', 'f38_174_commentmeta', 'f38_173_posts', 'f38_173_comments', 'f38_173_links', 'f38_173_options', 'f38_173_postmeta', 'f38_173_terms', 'f38_173_term_taxonomy', 'f38_173_term_relationships', 'f38_173_termmeta', 'f38_173_commentmeta', 'f38_172_posts', 'f38_172_comments', 'f38_172_links', 'f38_172_options', 'f38_172_postmeta', 'f38_172_terms', 'f38_172_term_taxonomy', 'f38_172_term_relationships', 'f38_172_termmeta', 'f38_172_commentmeta', 'f38_170_posts', 'f38_170_comments', 'f38_170_links', 'f38_170_options', 'f38_170_postmeta', 'f38_170_terms', 'f38_170_term_taxonomy', 'f38_170_term_relationships', 'f38_170_termmeta', 'f38_170_commentmeta', 'f38_169_posts', 'f38_169_comments', 'f38_169_links', 'f38_169_options', 'f38_169_postmeta', 'f38_169_terms', 'f38_169_term_taxonomy', 'f38_169_term_relationships', 'f38_169_termmeta', 'f38_169_commentmeta', 'f38_168_posts', 'f38_168_comments', 'f38_168_links', 'f38_168_options', 'f38_168_postmeta', 'f38_168_terms', 'f38_168_term_taxonomy', 'f38_168_term_relationships', 'f38_168_termmeta', 'f38_168_commentmeta', 'f38_165_posts', 'f38_165_comments', 'f38_165_links', 'f38_165_options', 'f38_165_postmeta', 'f38_165_terms', 'f38_165_term_taxonomy', 'f38_165_term_relationships', 'f38_165_termmeta', 'f38_165_commentmeta', 'f38_164_posts', 'f38_164_comments', 'f38_164_links', 'f38_164_options', 'f38_164_postmeta', 'f38_164_terms', 'f38_164_term_taxonomy', 'f38_164_term_relationships', 'f38_164_termmeta', 'f38_164_commentmeta', 'f38_163_posts', 'f38_163_comments', 'f38_163_links', 'f38_163_options', 'f38_163_postmeta', 'f38_163_terms', 'f38_163_term_taxonomy', 'f38_163_term_relationships', 'f38_163_termmeta', 'f38_163_commentmeta', 'f38_162_posts', 'f38_162_comments', 'f38_162_links', 'f38_162_options', 'f38_162_postmeta', 'f38_162_terms', 'f38_162_term_taxonomy', 'f38_162_term_relationships', 'f38_162_termmeta', 'f38_162_commentmeta', 'f38_161_posts', 'f38_161_comments', 'f38_161_links', 'f38_161_options', 'f38_161_postmeta', 'f38_161_terms', 'f38_161_term_taxonomy', 'f38_161_term_relationships', 'f38_161_termmeta', 'f38_161_commentmeta', 'f38_160_posts', 'f38_160_comments', 'f38_160_links', 'f38_160_options', 'f38_160_postmeta', 'f38_160_terms', 'f38_160_term_taxonomy', 'f38_160_term_relationships', 'f38_160_termmeta', 'f38_160_commentmeta', 'f38_155_posts', 'f38_155_comments', 'f38_155_links', 'f38_155_options', 'f38_155_postmeta', 'f38_155_terms', 'f38_155_term_taxonomy', 'f38_155_term_relationships', 'f38_155_termmeta', 'f38_155_commentmeta', 'f38_156_posts', 'f38_156_comments', 'f38_156_links', 'f38_156_options', 'f38_156_postmeta', 'f38_156_terms', 'f38_156_term_taxonomy', 'f38_156_term_relationships', 'f38_156_termmeta', 'f38_156_commentmeta', 'f38_157_posts', 'f38_157_comments', 'f38_157_links', 'f38_157_options', 'f38_157_postmeta', 'f38_157_terms', 'f38_157_term_taxonomy', 'f38_157_term_relationships', 'f38_157_termmeta', 'f38_157_commentmeta', 'f38_158_posts', 'f38_158_comments', 'f38_158_links', 'f38_158_options', 'f38_158_postmeta', 'f38_158_terms', 'f38_158_term_taxonomy', 'f38_158_term_relationships', 'f38_158_termmeta', 'f38_158_commentmeta', 'f38_159_posts', 'f38_159_comments', 'f38_159_links', 'f38_159_options', 'f38_159_postmeta', 'f38_159_terms', 'f38_159_term_taxonomy', 'f38_159_term_relationships', 'f38_159_termmeta', 'f38_159_commentmeta', 'f38_153_posts', 'f38_153_comments', 'f38_153_links', 'f38_153_options', 'f38_153_postmeta', 'f38_153_terms', 'f38_153_term_taxonomy', 'f38_153_term_relationships', 'f38_153_termmeta', 'f38_153_commentmeta', 'f38_154_posts', 'f38_154_comments', 'f38_154_links', 'f38_154_options', 'f38_154_postmeta', 'f38_154_terms', 'f38_154_term_taxonomy', 'f38_154_term_relationships', 'f38_154_termmeta', 'f38_154_commentmeta', 'f38_152_posts', 'f38_152_comments', 'f38_152_links', 'f38_152_options', 'f38_152_postmeta', 'f38_152_terms', 'f38_152_term_taxonomy', 'f38_152_term_relationships', 'f38_152_termmeta', 'f38_152_commentmeta', 'f38_183_posts', 'f38_183_comments', 'f38_183_links', 'f38_183_options', 'f38_183_postmeta', 'f38_183_terms', 'f38_183_term_taxonomy', 'f38_183_term_relationships', 'f38_183_termmeta', 'f38_183_commentmeta', 'f38_184_posts', 'f38_184_comments', 'f38_184_links', 'f38_184_options', 'f38_184_postmeta', 'f38_184_terms', 'f38_184_term_taxonomy', 'f38_184_term_relationships', 'f38_184_termmeta', 'f38_184_commentmeta', 'f38_185_posts', 'f38_185_comments', 'f38_185_links', 'f38_185_options', 'f38_185_postmeta', 'f38_185_terms', 'f38_185_term_taxonomy', 'f38_185_term_relationships', 'f38_185_termmeta', 'f38_185_commentmeta', 'f38_186_posts', 'f38_186_comments', 'f38_186_links', 'f38_186_options', 'f38_186_postmeta', 'f38_186_terms', 'f38_186_term_taxonomy', 'f38_186_term_relationships', 'f38_186_termmeta', 'f38_186_commentmeta', 'f38_187_posts', 'f38_187_comments', 'f38_187_links', 'f38_187_options', 'f38_187_postmeta', 'f38_187_terms', 'f38_187_term_taxonomy', 'f38_187_term_relationships', 'f38_187_termmeta', 'f38_187_commentmeta', 'f38_188_posts', 'f38_188_comments', 'f38_188_links', 'f38_188_options', 'f38_188_postmeta', 'f38_188_terms', 'f38_188_term_taxonomy', 'f38_188_term_relationships', 'f38_188_termmeta', 'f38_188_commentmeta', 'f38_189_posts', 'f38_189_comments', 'f38_189_links', 'f38_189_options', 'f38_189_postmeta', 'f38_189_terms', 'f38_189_term_taxonomy', 'f38_189_term_relationships', 'f38_189_termmeta', 'f38_189_commentmeta')
      Connection ID (thread ID): 10
      Status: NOT_KILLED
       
      Optimizer switch: index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=on,derived_merge=on,derived_with_keys=on,firstmatch=on,loosescan=on,materialization=on,in_to_exists=on,semijoin=on,partial_match_rowid_merge=on,partial_match_table_scan=on,subquery_cache=on,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=on,semijoin_with_cache=on,join_cache_incremental=on,join_cache_hashed=on,join_cache_bka=on,optimize_join_buffer_size=off,table_elimination=on,extended_keys=on,exists_to_in=on,orderby_uses_equalities=on,condition_pushdown_for_derived=on,split_materialized=on
       
      The manual page at http://dev.mysql.com/doc/mysql/en/crashing.html contains
      information that should help you find out what is causing the crash.
      Writing a core file...
      Working directory at /var/lib/mysql/site
      Resource Limits:
      Limit                     Soft Limit           Hard Limit           Units     
      Max cpu time              unlimited            unlimited            seconds   
      Max file size             unlimited            unlimited            bytes     
      Max data size             unlimited            unlimited            bytes     
      Max stack size            8388608              unlimited            bytes     
      Max core file size        0                    unlimited            bytes     
      Max resident set          unlimited            unlimited            bytes     
      Max processes             64057                64057                processes 
      Max open files            16364                16364                files     
      Max locked memory         16777216             16777216             bytes     
      Max address space         unlimited            unlimited            bytes     
      Max file locks            unlimited            unlimited            locks     
      Max pending signals       64057                64057                signals   
      Max msgqueue size         819200               819200               bytes     
      Max nice priority         0                    0                    
      Max realtime priority     0                    0                    
      Max realtime timeout      unlimited            unlimited            us        
      Core pattern: |/usr/share/apport/apport %p %s %c %d %P
       
      2020-01-30  6:53:36 0 [Note] InnoDB: Using Linux native AIO
      2020-01-30  6:53:36 0 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
      2020-01-30  6:53:36 0 [Note] InnoDB: Uses event mutexes
      2020-01-30  6:53:36 0 [Note] InnoDB: Compressed tables use zlib 1.2.11
      2020-01-30  6:53:36 0 [Note] InnoDB: Number of pools: 1
      2020-01-30  6:53:36 0 [Note] InnoDB: Using SSE2 crc32 instructions
      2020-01-30  6:53:36 0 [Note] InnoDB: Initializing buffer pool, total size = 8G, instances = 4, chunk size = 128M
      2020-01-30  6:53:36 0 [Note] InnoDB: Completed initialization of buffer pool
      2020-01-30  6:53:36 0 [Note] InnoDB: If the mysqld execution user is authorized, page cleaner thread priority can be changed. See the man page of setpriority().
      2020-01-30  6:53:36 0 [Warning] InnoDB: Failed to set O_DIRECT on file./ibdata1; OPEN: Invalid argument, continuing anyway. O_DIRECT is known to result in 'Invalid argument' on Linux on tmpfs, see MySQL Bug#26662.
      

      Attachments

        Issue Links

          Activity

            Take-away from optimizer call discussion

            -remove two commands in the switch
            -do not fill I_S temp.tables in mysql_handle_derived (and its sibling function)

            psergei Sergei Petrunia added a comment - Take-away from optimizer call discussion -remove two commands in the switch -do not fill I_S temp.tables in mysql_handle_derived (and its sibling function)

            The following SHOW FIELDS command are also crashing in the same way as the SHOW TABLES command above

             show fields from test.t1
               where Field in (select * from (select nm from test.t1 group by nm) dt);
            show fields from test.t1
               where Field in
                    (select * from (select column_name from information_schema.columns
                                      where table_name='t1'
                                        group by column_name) dt);
            

            igor Igor Babaev (Inactive) added a comment - The following SHOW FIELDS command are also crashing in the same way as the SHOW TABLES command above show fields from test.t1 where Field in ( select * from ( select nm from test.t1 group by nm) dt); show fields from test.t1 where Field in ( select * from ( select column_name from information_schema.columns where table_name= 't1' group by column_name) dt);

            10.2 with the following diff applied

            diff --git a/sql/sql_base.cc b/sql/sql_base.cc
            index 3403f9e..16689f8 100644
            --- a/sql/sql_base.cc
            +++ b/sql/sql_base.cc
            @@ -4939,7 +4939,6 @@ bool open_normal_and_derived_tables(THD *thd, TABLE_LIST *tables, uint flags,
               uint counter;
               MDL_savepoint mdl_savepoint= thd->mdl_context.mdl_savepoint();
               DBUG_ENTER("open_normal_and_derived_tables");
            -  DBUG_ASSERT(!thd->fill_derived_tables());
               if (open_tables(thd, &tables, &counter, flags, &prelocking_strategy) ||
                   mysql_handle_derived(thd->lex, dt_phases))
                 goto end;
            diff --git a/sql/sql_lex.cc b/sql/sql_lex.cc
            index c534ba7..149a2bb 100644
            --- a/sql/sql_lex.cc
            +++ b/sql/sql_lex.cc
            @@ -3095,8 +3095,6 @@ bool LEX::only_view_structure()
             {
               switch (sql_command) {
               case SQLCOM_SHOW_CREATE:
            -  case SQLCOM_SHOW_TABLES:
            -  case SQLCOM_SHOW_FIELDS:
               case SQLCOM_REVOKE_ALL:
               case SQLCOM_REVOKE:
               case SQLCOM_GRANT:
            

            passed all tests and did not fail for the above queries.

            igor Igor Babaev (Inactive) added a comment - 10.2 with the following diff applied diff --git a/sql/sql_base.cc b/sql/sql_base.cc index 3403f9e..16689f8 100644 --- a/sql/sql_base.cc +++ b/sql/sql_base.cc @@ -4939,7 +4939,6 @@ bool open_normal_and_derived_tables(THD *thd, TABLE_LIST *tables, uint flags, uint counter; MDL_savepoint mdl_savepoint= thd->mdl_context.mdl_savepoint(); DBUG_ENTER("open_normal_and_derived_tables"); - DBUG_ASSERT(!thd->fill_derived_tables()); if (open_tables(thd, &tables, &counter, flags, &prelocking_strategy) || mysql_handle_derived(thd->lex, dt_phases)) goto end; diff --git a/sql/sql_lex.cc b/sql/sql_lex.cc index c534ba7..149a2bb 100644 --- a/sql/sql_lex.cc +++ b/sql/sql_lex.cc @@ -3095,8 +3095,6 @@ bool LEX::only_view_structure() { switch (sql_command) { case SQLCOM_SHOW_CREATE: - case SQLCOM_SHOW_TABLES: - case SQLCOM_SHOW_FIELDS: case SQLCOM_REVOKE_ALL: case SQLCOM_REVOKE: case SQLCOM_GRANT: passed all tests and did not fail for the above queries.

            10.3 with the following diff applied

            diff --git a/sql/sql_base.cc b/sql/sql_base.cc
            index 74ac1a3..031baee 100644
            --- a/sql/sql_base.cc
            +++ b/sql/sql_base.cc
            @@ -5187,7 +5187,6 @@ bool open_normal_and_derived_tables(THD *thd, TABLE_LIST *tables, uint flags,
               uint counter;
               MDL_savepoint mdl_savepoint= thd->mdl_context.mdl_savepoint();
               DBUG_ENTER("open_normal_and_derived_tables");
            -  DBUG_ASSERT(!thd->fill_derived_tables());
               if (open_tables(thd, &tables, &counter, flags, &prelocking_strategy) ||
                   mysql_handle_derived(thd->lex, dt_phases))
                 goto end;
            diff --git a/sql/sql_lex.cc b/sql/sql_lex.cc
            index 5604658..3866d82 100644
            --- a/sql/sql_lex.cc
            +++ b/sql/sql_lex.cc
            @@ -3358,8 +3358,6 @@ bool LEX::only_view_structure()
               switch (sql_command) {
               case SQLCOM_SHOW_CREATE:
               case SQLCOM_CHECKSUM:
            -  case SQLCOM_SHOW_TABLES:
            -  case SQLCOM_SHOW_FIELDS:
               case SQLCOM_REVOKE_ALL:
               case SQLCOM_REVOKE:
               case SQLCOM_GRANT:
            diff --git a/sql/sql_show.cc b/sql/sql_show.cc
            index 6b020f6..bf72c59 100644
            --- a/sql/sql_show.cc
            +++ b/sql/sql_show.cc
            @@ -8140,7 +8140,9 @@ TABLE *create_schema_table(THD *thd, TABLE_LIST *table_list)
               CHARSET_INFO *cs= system_charset_info;
               MEM_ROOT *mem_root= thd->mem_root;
               bool need_all_fieds= table_list->schema_table_reformed || // SHOW command
            -                       thd->lex->only_view_structure(); // need table structure
            +                       thd->lex->only_view_structure() || // need table structure
            +                       thd->lex->sql_command == SQLCOM_SHOW_FIELDS ||
            +                       thd->lex->sql_command == SQLCOM_SHOW_TABLES;
               DBUG_ENTER("create_schema_table");
             
               for (; fields_info->field_name; fields_info++)
            

            passed all tests and did not fail for the above queries.

            igor Igor Babaev (Inactive) added a comment - 10.3 with the following diff applied diff --git a/sql/sql_base.cc b/sql/sql_base.cc index 74ac1a3..031baee 100644 --- a/sql/sql_base.cc +++ b/sql/sql_base.cc @@ -5187,7 +5187,6 @@ bool open_normal_and_derived_tables(THD *thd, TABLE_LIST *tables, uint flags, uint counter; MDL_savepoint mdl_savepoint= thd->mdl_context.mdl_savepoint(); DBUG_ENTER("open_normal_and_derived_tables"); - DBUG_ASSERT(!thd->fill_derived_tables()); if (open_tables(thd, &tables, &counter, flags, &prelocking_strategy) || mysql_handle_derived(thd->lex, dt_phases)) goto end; diff --git a/sql/sql_lex.cc b/sql/sql_lex.cc index 5604658..3866d82 100644 --- a/sql/sql_lex.cc +++ b/sql/sql_lex.cc @@ -3358,8 +3358,6 @@ bool LEX::only_view_structure() switch (sql_command) { case SQLCOM_SHOW_CREATE: case SQLCOM_CHECKSUM: - case SQLCOM_SHOW_TABLES: - case SQLCOM_SHOW_FIELDS: case SQLCOM_REVOKE_ALL: case SQLCOM_REVOKE: case SQLCOM_GRANT: diff --git a/sql/sql_show.cc b/sql/sql_show.cc index 6b020f6..bf72c59 100644 --- a/sql/sql_show.cc +++ b/sql/sql_show.cc @@ -8140,7 +8140,9 @@ TABLE *create_schema_table(THD *thd, TABLE_LIST *table_list) CHARSET_INFO *cs= system_charset_info; MEM_ROOT *mem_root= thd->mem_root; bool need_all_fieds= table_list->schema_table_reformed || // SHOW command - thd->lex->only_view_structure(); // need table structure + thd->lex->only_view_structure() || // need table structure + thd->lex->sql_command == SQLCOM_SHOW_FIELDS || + thd->lex->sql_command == SQLCOM_SHOW_TABLES; DBUG_ENTER("create_schema_table"); for (; fields_info->field_name; fields_info++) passed all tests and did not fail for the above queries.

            The line with thd->fill_derived_tables()

              for (uint phase= 0; phase < DT_PHASES; phase++)
              {
                uint phase_flag= DT_INIT << phase;
                if (phase_flag > phases)
                  break;
                if (!(phases & phase_flag))
                  continue;
                /* Skip derived tables to which the phase isn't applicable.  */
                if (phase_flag != DT_PREPARE &&
                    !(allowed_phases & phase_flag))
                  continue;
                if (phase_flag >= DT_CREATE && !thd->fill_derived_tables())
                  break;
             
                if ((res= (*processors[phase])(lex->thd, lex, derived)))
                  break;
              }
            

            is to make sure that when we open a view to report its structure for I_S, we don't actually fill it with data. So DT_CREATE and above must not be executed for SHOW FIELDS.

            This is called from

            bool open_tables_only_view_structure(THD *thd, TABLE_LIST *table_list,
                                                 bool can_deadlock)
            {
            ...
              bool rc= (thd->open_temporary_tables(table_list) ||
                       open_normal_and_derived_tables(thd, table_list,
                                                      (MYSQL_OPEN_IGNORE_FLUSH |
                                                       MYSQL_OPEN_FORCE_SHARED_HIGH_PRIO_MDL |
                                                       MYSQL_OPEN_GET_NEW_TABLE |
                                                       (can_deadlock ?
                                                        MYSQL_OPEN_FAIL_ON_MDL_CONFLICT : 0)),
                                                      DT_INIT | DT_PREPARE | DT_CREATE));
            ...
            }
            

            And it begs the question, why on earth does it pass DT_CREATE flag, if it must not be executed?
            This leads to the simple fix:

            diff --git a/sql/sql_base.cc b/sql/sql_base.cc
            --- a/sql/sql_base.cc
            +++ b/sql/sql_base.cc
            @@ -5245,7 +5245,7 @@ bool open_tables_only_view_structure(THD *thd, TABLE_LIST *table_list,
                                                        MYSQL_OPEN_GET_NEW_TABLE |
                                                        (can_deadlock ?
                                                         MYSQL_OPEN_FAIL_ON_MDL_CONFLICT : 0)),
            -                                          DT_INIT | DT_PREPARE | DT_CREATE));
            +                                          DT_INIT | DT_PREPARE));
               /*
                 Restore old value of sql_command back as it is being looked at in
                 process_table() function.
            diff --git a/sql/sql_derived.cc b/sql/sql_derived.cc
            --- a/sql/sql_derived.cc
            +++ b/sql/sql_derived.cc
            @@ -85,7 +85,7 @@ mysql_handle_derived(LEX *lex, uint phases)
                   break;
                 if (!(phases & phase_flag))
                   continue;
            -    if (phase_flag >= DT_CREATE && !thd->fill_derived_tables())
            +    if (phase_flag >= DT_CREATE && thd->stmt_arena->is_stmt_prepare())
                   break;
             
                 for (SELECT_LEX *sl= lex->all_selects_list;
            @@ -193,7 +193,7 @@ mysql_handle_single_derived(LEX *lex, TABLE_LIST *derived, uint phases)
                 if (phase_flag != DT_PREPARE &&
                     !(allowed_phases & phase_flag))
                   continue;
            -    if (phase_flag >= DT_CREATE && !thd->fill_derived_tables())
            +    if (phase_flag >= DT_CREATE && thd->stmt_arena->is_stmt_prepare())
                   break;
             
                 if ((res= (*processors[phase])(lex->thd, lex, derived)))
            

            serg Sergei Golubchik added a comment - The line with thd->fill_derived_tables() for (uint phase= 0; phase < DT_PHASES; phase++) { uint phase_flag= DT_INIT << phase; if (phase_flag > phases) break ; if (!(phases & phase_flag)) continue ; /* Skip derived tables to which the phase isn't applicable. */ if (phase_flag != DT_PREPARE && !(allowed_phases & phase_flag)) continue ; if (phase_flag >= DT_CREATE && !thd->fill_derived_tables()) break ;   if ((res= (*processors[phase])(lex->thd, lex, derived))) break ; } is to make sure that when we open a view to report its structure for I_S, we don't actually fill it with data. So DT_CREATE and above must not be executed for SHOW FIELDS . This is called from bool open_tables_only_view_structure(THD *thd, TABLE_LIST *table_list, bool can_deadlock) { ... bool rc= (thd->open_temporary_tables(table_list) || open_normal_and_derived_tables(thd, table_list, (MYSQL_OPEN_IGNORE_FLUSH | MYSQL_OPEN_FORCE_SHARED_HIGH_PRIO_MDL | MYSQL_OPEN_GET_NEW_TABLE | (can_deadlock ? MYSQL_OPEN_FAIL_ON_MDL_CONFLICT : 0)), DT_INIT | DT_PREPARE | DT_CREATE)); ... } And it begs the question, why on earth does it pass DT_CREATE flag, if it must not be executed ? This leads to the simple fix: diff --git a/sql/sql_base.cc b/sql/sql_base.cc --- a/sql/sql_base.cc +++ b/sql/sql_base.cc @@ -5245,7 +5245,7 @@ bool open_tables_only_view_structure(THD *thd, TABLE_LIST *table_list, MYSQL_OPEN_GET_NEW_TABLE | (can_deadlock ? MYSQL_OPEN_FAIL_ON_MDL_CONFLICT : 0)), - DT_INIT | DT_PREPARE | DT_CREATE)); + DT_INIT | DT_PREPARE)); /* Restore old value of sql_command back as it is being looked at in process_table() function. diff --git a/sql/sql_derived.cc b/sql/sql_derived.cc --- a/sql/sql_derived.cc +++ b/sql/sql_derived.cc @@ -85,7 +85,7 @@ mysql_handle_derived(LEX *lex, uint phases) break; if (!(phases & phase_flag)) continue; - if (phase_flag >= DT_CREATE && !thd->fill_derived_tables()) + if (phase_flag >= DT_CREATE && thd->stmt_arena->is_stmt_prepare()) break; for (SELECT_LEX *sl= lex->all_selects_list; @@ -193,7 +193,7 @@ mysql_handle_single_derived(LEX *lex, TABLE_LIST *derived, uint phases) if (phase_flag != DT_PREPARE && !(allowed_phases & phase_flag)) continue; - if (phase_flag >= DT_CREATE && !thd->fill_derived_tables()) + if (phase_flag >= DT_CREATE && thd->stmt_arena->is_stmt_prepare()) break; if ((res= (*processors[phase])(lex->thd, lex, derived)))

            People

              serg Sergei Golubchik
              ShahMitesh Mitesh Shah
              Votes:
              1 Vote for this issue
              Watchers:
              9 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Git Integration

                  Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.