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

A function call inside a package specification crashes the server

    XMLWordPrintable

Details

    • Bug
    • Status: Open (View Workflow)
    • Major
    • Resolution: Unresolved
    • 11.8, 13.2
    • 11.8
    • Stored routines
    • None

    Description

      SET sql_mode=ORACLE;
      DELIMITER $$
      CREATE PACKAGE pkg AS
        PROCEDURE p1(a BIGINT DEFAULT NOSUCH_FUNC());
      END;
      $$
      DELIMITER ;
      

      #0  0x00007ffff7082e7c in __pthread_kill_implementation ()
         from /lib64/libc.so.6
      #1  0x00007ffff7028f0e in raise () from /lib64/libc.so.6
      #2  0x00007ffff70106d0 in abort () from /lib64/libc.so.6
      #3  0x00007ffff7010639 in __assert_fail_base.cold () from /lib64/libc.so.6
      #4  0x0000555555da20ec in is_package_public_routine_quick (thd=0x77ff9c000dc8, 
          db=..., pkgname=..., name=..., type=SP_TYPE_FUNCTION)
          at /home/bar/maria-git/11.8/sql/sp.cc:2537
      #5  0x0000555555da2627 in Sp_handler::sp_resolve_package_routine_implicit (
          this=0x555557cc4b88 <sp_handler_function>, thd=0x77ff9c000dc8, 
          caller=0x77ff9c042d70, name=0x77ff9c043c30, 
          pkg_routine_handler=0x7ffff40a2018, pkgname=0x7ffff40a2040)
          at /home/bar/maria-git/11.8/sql/sp.cc:2650
      #6  0x0000555555da293b in Sp_handler::sp_resolve_package_routine (
          this=0x555557cc4b88 <sp_handler_function>, thd=0x77ff9c000dc8, 
          caller=0x77ff9c042d70, name=0x77ff9c043c30, 
          pkg_routine_handler=0x7ffff40a2018, pkgname=0x7ffff40a2040)
          at /home/bar/maria-git/11.8/sql/sp.cc:2705
      #7  0x0000555555c24c63 in Create_sp_func::create_with_db (
          this=0x555557cc17f8 <Create_sp_func::s_singleton>, thd=0x77ff9c000dc8, 
          db=..., name=..., use_explicit_name=false, item_list=0x0)
          at /home/bar/maria-git/11.8/sql/item_create.cc:3013
      #8  0x0000555555c23d26 in Create_qfunc::create_func (
          this=0x555557cc17f8 <Create_sp_func::s_singleton>, thd=0x77ff9c000dc8, 
          name=0x7ffff40a34f0, item_list=0x0)
          at /home/bar/maria-git/11.8/sql/item_create.cc:2863
      #9  0x0000555555b2f36e in ORAparse (thd=0x77ff9c000dc8)
          at /home/bar/maria-git/11.8/sql/sql_yacc.yy:10940
      #10 0x0000555555736baf in parse_sql (thd=0x77ff9c000dc8, 
          parser_state=0x7ffff40a3f60, creation_ctx=0x0, do_pfs_digest=true)
          at /home/bar/maria-git/11.8/sql/sql_parse.cc:10334
      #11 0x0000555555730af5 in mysql_parse (thd=0x77ff9c000dc8, 
          rawbuf=0x77ff9c034b70 "CREATE PACKAGE pkg AS\n  PROCEDURE p1(a BIGINT DEFAULT NOSUCH_FUNC());\nEND", length=73, parser_state=0x7ffff40a3f60)
          at /home/bar/maria-git/11.8/sql/sql_parse.cc:7890
      

      Default parameter values for stored routines (MDEV-10862) first appeared in MariaDB 11.8, by commit dfdbec16362 dated 2024-11-21.

      Attachments

        Issue Links

          Activity

            People

              Khaled.amr Khaled Amr
              bar Alexander Barkov
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:

                Time Tracking

                  Estimated:
                  Original Estimate - 0d
                  0d
                  Remaining:
                  Remaining Estimate - 1d
                  1d
                  Logged:
                  Time Spent - Not Specified
                  Not Specified

                  Git Integration

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