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

Cyclic package TYPE dependency built with associative array shows ERROR 1436 (HY000): Thread stack overrun

    XMLWordPrintable

Details

    • Bug
    • Status: Closed (View Workflow)
    • Critical
    • Resolution: Fixed
    • 13.1
    • N/A
    • Stored routines
    • None
    • Not for Release Notes
    • Q3/2026 Server Development

    Description

      Test case

      SET sql_mode=ORACLE;
       
      DELIMITER $$
      CREATE PACKAGE fa AS TYPE r IS RECORD(x INT); END;
      $$
      CREATE PACKAGE fb AS TYPE r2 IS RECORD(y INT); TYPE arr IS TABLE OF fa.r INDEX BY INTEGER; END;
      $$
       
      CREATE OR REPLACE PACKAGE fa AS TYPE r IS RECORD(x INT); TYPE arr2 IS TABLE OF fb.r2 INDEX BY INTEGER; END;
      $$
      DELIMITER ;
       
      SHOW CREATE PACKAGE fa;
      

      CLI output

      13.1.0-opt>SET sql_mode=ORACLE;
      Query OK, 0 rows affected (0.000 sec)
       
      13.1.0-opt>
      13.1.0-opt>DELIMITER $$
      13.1.0-opt>CREATE PACKAGE fa AS TYPE r IS RECORD(x INT); END;
          -> $$
      Query OK, 0 rows affected (0.035 sec)
       
      13.1.0-opt>CREATE PACKAGE fb AS TYPE r2 IS RECORD(y INT); TYPE arr IS TABLE OF fa.r INDEX BY INTEGER; END;
          -> $$
      Query OK, 0 rows affected (0.029 sec)
       
      13.1.0-opt>CREATE OR REPLACE PACKAGE fa AS TYPE r IS RECORD(x INT); TYPE arr2 IS TABLE OF fb.r2 INDEX BY INTEGER; END;
          -> $$
      Query OK, 0 rows affected (0.006 sec)
       
      13.1.0-opt>DELIMITER ;
      13.1.0-opt>SHOW CREATE PACKAGE fa;
      ERROR 1436 (HY000): Thread stack overrun:  217120 bytes used of a 299008 byte stack, and 81920 bytes needed. Consider increasing the thread_stack system variable.
      13.1.0-opt>
      

      Attachments

        Issue Links

          Activity

            People

              bar Alexander Barkov
              ramesh Ramesh Sivaraman
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - 4h 32m
                  4h 32m
                  Remaining:
                  Remaining Estimate - 0d
                  0d
                  Logged:
                  Time Spent - 1.5h Time Not Required
                  1.5h

                  Git Integration

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