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

sql_mode=oracle: caller function can't catch the user defined exception from callee

    XMLWordPrintable

Details

    • Bug
    • Status: Open (View Workflow)
    • Major
    • Resolution: Unresolved
    • 10.5(EOL), 10.6, 10.11, 11.4, 11.8
    • 10.11, 11.4, 11.8
    • None
    • None

    Description

      drop function if exists  func1;
      delimiter //
      CREATE FUNCTION func1 ( 
          i_var int
      ) RETURN DATE IS
          r_c2 DATE := '2025-01-01';
          myexception1 EXCEPTION;
          myexception2 EXCEPTION;
      BEGIN
          RAISE myexception1;
          RETURN r_c2;
      EXCEPTION
          WHEN myexception1 THEN
              RAISE myexception1;
      END;
      //
      delimiter ;
       
      drop function if exists  func2;
      delimiter //
      CREATE FUNCTION func2 ( 
          i_var int
      ) RETURN DATE IS
          r_c2 DATE := '2025-01-01';
          myexception1 EXCEPTION;
          myexception2 EXCEPTION;
      BEGIN
          r_c2 := func1(i_var);
      EXCEPTION
          WHEN myexception1 THEN
              return r_c2;
      END;
      //
      delimiter ;
       
      delimiter //
      declare
          v_val DATE;
      begin
          v_val := func2(4);
          select v_val from dual;
      end;
      //
      delimiter ;
      

      MariaDB [test]> declare
          ->     v_val DATE;
          -> begin
          ->     v_val := func2(4);
          ->     select v_val from dual;
          -> end;
          -> //
      ERROR 1644 (45000): Unhandled user-defined exception condition
      

      Attachments

        Activity

          People

            bar Alexander Barkov
            kongzhi.kz zhi kong
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:

              Git Integration

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