Skip to content

Commit

Permalink
EXECUTE IMMEDIATE would return NULL unit line from UTL_CALL_STACK, ad…
Browse files Browse the repository at this point in the history
…ded NVL to return actually 1
  • Loading branch information
Sergejs Vinniks committed Nov 7, 2018
1 parent 73e9c69 commit 80bbb99
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions src/packages/log$.pkb
Original file line number Diff line number Diff line change
Expand Up @@ -427,11 +427,20 @@ CREATE OR REPLACE PACKAGE BODY log$ IS
v_call_depth PLS_INTEGER;
BEGIN

IF p_adjust_height > v_call_stack_capacity THEN

v_call_stack.EXTEND(p_adjust_height - v_call_stack_capacity);
v_call_values.EXTEND(p_adjust_height - v_call_stack_capacity);

v_call_stack_capacity := p_adjust_height;

END IF;

FOR v_i IN REVERSE 1..p_adjust_height LOOP

v_call_depth := p_dynamic_depth - v_i + 1;
v_actual_call.unit := call_stack_unit(v_call_depth);
v_actual_call.line := utl_call_stack.unit_line(v_call_depth);
v_actual_call.line := NVL(utl_call_stack.unit_line(v_call_depth), 1);

v_tracked_call := v_call_stack(v_i);

Expand All @@ -457,7 +466,7 @@ CREATE OR REPLACE PACKAGE BODY log$ IS

END;

PROCEDURE call (
PROCEDURE call (
p_service_depth IN PLS_INTEGER,
p_reset_top IN BOOLEAN
) IS
Expand All @@ -475,15 +484,6 @@ CREATE OR REPLACE PACKAGE BODY log$ IS
RETURN;
END IF;

IF v_actual_height > v_call_stack_capacity THEN

v_call_stack.EXTEND(v_actual_height - v_call_stack_capacity);
v_call_values.EXTEND(v_actual_height - v_call_stack_capacity);

v_call_stack_capacity := v_actual_height;

END IF;

adjust_call_stack(v_dynamic_depth + 1, v_actual_height);

v_tracked_call := v_call_stack(v_actual_height);
Expand Down

0 comments on commit 80bbb99

Please sign in to comment.