Teodor created SPARK-53758:
------------------------------

             Summary: EXIT handler not exiting properly if triggered from 
another EXIT handler
                 Key: SPARK-53758
                 URL: https://issues.apache.org/jira/browse/SPARK-53758
             Project: Spark
          Issue Type: Bug
          Components: Spark Core
    Affects Versions: 4.0.1, 4.1.0
            Reporter: Teodor


An unexpected behavior happens when an EXIT handler inside of an outer scope 
gets triggered by an exception inside an EXIT handler thats inside an inner 
nested scope: instead of leaving the outer scope after finishing all the 
exception handling, execution only leaves the inner scope.

Example:

 
{code:java}
BEGIN
  DECLARE VARIABLE flag INT = -1;
  l1: BEGIN
    DECLARE EXIT HANDLER FOR UNRESOLVED_COLUMN.WITHOUT_SUGGESTION
    BEGIN
      SELECT flag;
      SET flag = 2;
    END;
    l2: BEGIN
      DECLARE EXIT HANDLER FOR DIVIDE_BY_ZERO
      BEGIN
        SELECT flag;
        SET flag = 1;
        select X; -- select non existing variable
        SELECT 2;
      END;
      SELECT 5;
      SELECT 1/0; -- divide by zero
      SELECT 6;
    END l2;
    SELECT 3, flag;
  END l1;
END {code}
 

 



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to