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

Server crashes at st_select_lex_unit::set_limit

    XMLWordPrintable

Details

    • Bug
    • Status: Closed (View Workflow)
    • Major
    • Resolution: Duplicate
    • 11.1.2, 11.2.1
    • N/A
    • N/A
    • None
    • Ubuntu 20.04 x86-64, docker image mariadb:11.1.2

    Description

      PoC:

      SELECT ( WITH x ( x ) AS ( WITH x AS ( SELECT 1 ) SELECT ( ( EXISTS ( SELECT 1 ) ) ) FROM x ) SELECT * FROM x WHERE x IN ( SELECT x GROUP BY x = 1 ) ) ;
      

      docker log:

      mariadbd(my_print_stacktrace+0x32)[0x55f3350cf7c2]
      mariadbd(handle_fatal_signal+0x488)[0x55f334ba8cf8]
      /lib/x86_64-linux-gnu/libc.so.6(+0x42520)[0x7f03adc0b520]
      mariadbd(_ZN18st_select_lex_unit9set_limitEP13st_select_lex+0x1a)[0x55f33490c94a]
      mariadbd(_ZN30subselect_single_select_engine4execEv+0x67)[0x55f334c88717]
      mariadbd(_ZN14Item_subselect4execEv+0x4c)[0x55f334c8773c]
      mariadbd(_ZN21Item_exists_subselect7val_intEv+0x23)[0x55f334c874a3]
      mariadbd(_ZN20Item_direct_view_ref14val_int_resultEv+0x23)[0x55f334bbde73]
      mariadbd(_ZN14Item_cache_int11cache_valueEv+0x29)[0x55f334bbe149]
      mariadbd(_ZN17Item_in_optimizer8fix_leftEP3THD+0x2b5)[0x55f334beef05]
      mariadbd(_ZN17Item_in_subselect26select_in_like_transformerEP4JOIN+0xcb)[0x55f334c8d7fb]
      mariadbd(_Z33check_and_do_in_subquery_rewritesP4JOIN+0x3d4)[0x55f334aa5af4]
      mariadbd(_ZN4JOIN7prepareEP10TABLE_LISTP4ItemjP8st_orderbS5_S3_S5_P13st_select_lexP18st_select_lex_unit+0xdca)[0x55f3349a25ba]
      mariadbd(+0xb8b908)[0x55f334c8e908]
      mariadbd(_ZN14Item_subselect10fix_fieldsEP3THDPP4Item+0x1ad)[0x55f334c8dfcd]
      mariadbd(_ZN17Item_in_subselect10fix_fieldsEP3THDPP4Item+0x85)[0x55f334c8e2d5]
      mariadbd(_Z11setup_condsP3THDP10TABLE_LISTR4ListIS1_EPP4Item+0x22f)[0x55f3348c9e6f]
      mariadbd(_ZN4JOIN7prepareEP10TABLE_LISTP4ItemjP8st_orderbS5_S3_S5_P13st_select_lexP18st_select_lex_unit+0x620)[0x55f3349a1e10]
      mariadbd(+0xb8b908)[0x55f334c8e908]
      mariadbd(_ZN14Item_subselect10fix_fieldsEP3THDPP4Item+0x1ad)[0x55f334c8dfcd]
      mariadbd(_Z12setup_fieldsP3THD20Bounds_checked_arrayIP4ItemER4ListIS2_E17enum_column_usagePS6_S9_b+0x147)[0x55f3348c80a7]
      mariadbd(_ZN4JOIN7prepareEP10TABLE_LISTP4ItemjP8st_orderbS5_S3_S5_P13st_select_lexP18st_select_lex_unit+0x52d)[0x55f3349a1d1d]
      mariadbd(_Z12mysql_selectP3THDP10TABLE_LISTR4ListI4ItemEPS4_jP8st_orderS9_S7_S9_yP13select_resultP18st_select_lex_unitP13st_select_lex+0x624)[0x55f3349b6474]
      mariadbd(_Z13handle_selectP3THDP3LEXP13select_resulty+0x154)[0x55f3349b6774]
      mariadbd(+0x826f55)[0x55f334929f55]
      mariadbd(_Z21mysql_execute_commandP3THDb+0x419e)[0x55f334938f0e]
      mariadbd(_Z11mysql_parseP3THDPcjP12Parser_state+0x1e7)[0x55f33493a237]
      mariadbd(_Z16dispatch_command19enum_server_commandP3THDPcjb+0x14bd)[0x55f33493ca1d]
      mariadbd(_Z10do_commandP3THDb+0x138)[0x55f33493e818]
      mariadbd(_Z24do_handle_one_connectionP7CONNECTb+0x3bf)[0x55f334a663af]
      mariadbd(handle_one_connection+0x5d)[0x55f334a666fd]
      mariadbd(+0xcd1906)[0x55f334dd4906]
      /lib/x86_64-linux-gnu/libc.so.6(+0x94b43)[0x7f03adc5db43]
      /lib/x86_64-linux-gnu/libc.so.6(clone+0x44)[0x7f03adceebb4]
       
      Trying to get some variables.
      Some pointers may be invalid and cause the dump to abort.
      Query (0x7f03480130d8): SELECT ( WITH x ( x ) AS ( WITH x AS ( SELECT 1 ) SELECT ( ( EXISTS ( SELECT 1 ) ) ) FROM x ) SELECT * FROM x WHERE x IN ( SELECT x GROUP BY x = 1 ) )
       
      Connection ID (thread ID): 4
      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=on,table_elimination=on,extended_keys=on,exists_to_in=on,orderby_uses_equalities=on,condition_pushdown_for_derived=on,split_materialized=on,condition_pushdown_for_subquery=on,rowid_filter=on,condition_pushdown_from_having=on,not_null_range_scan=off,hash_join_cardinality=on
      

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              fuboat Jingzhou Fu
              Votes:
              0 Vote for this issue
              Watchers:
              4 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.