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

main.cte_update_delete doesnt' cleanup, refers to wrong MDEVs.

    XMLWordPrintable

Details

    • Not for Release Notes

    Description

      main.cte_update_delete doesn't drop a view it creates, which causes mtr to complain.

      Also, in the test file one sees two references to the same MDEV which looks like an error:

       
      --echo #
      --echo # MDEV-38272 Sig11 in LEX::resolve_references_to_cte at sql/sql_cte.cc
      --echo #
       
      create table t1(a int);
      insert into t1 values (1), (5), (10), (15), (20), (25);
      create view v1 as select * from t1 where a < 10;
      --error ER_PARSE_ERROR
      with cte as (select * from t1) delete from t1,cte where t1.a=cte.a;
      with cte as (select * from t1) delete from t1 using t1,cte where t1.a=cte.a;
       
      --echo #
      --echo # MDEV-38272 Recursive CTE usage leaks memory when not used in a top level select
      --echo #
      

      Indeed, both were introduced by this commit which referred to two MDEVs:

      commit 549628d9ccb822252b55210d922cef3d13eecd71
      Author: Rex Johnston <rex.johnston@mariadb.com>
      Date:   Tue Dec 9 02:40:52 2025 +1200
       
          MDEV-38272 Sig11 in LEX::resolve_references_to_cte at sql/sql_cte.cc
          
          Lex::save_list contents remain from a previous query that has invalid
          syntax and isn't reset when processing a new query.
          We initialize this structure along with it's peer in LEX::start.
          
          MDEV-38295 Recursive CTE usage leaks memory when not used in a top level select
          
      

      Attachments

        Issue Links

          Activity

            People

              psergei Sergei Petrunia
              psergei Sergei Petrunia
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0d
                  0d
                  Logged:
                  Time Spent - 3h 5m
                  3h 5m

                  Git Integration

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