With Oracle 19c, the following procedure takes several seconds to compile. Reproducible also with db<>fiddle (18c and 21c).
With Oracle 12.1 it compiles immediately.
CREATE OR REPLACE PROCEDURE test_proc AS
x VARCHAR2(32767);
BEGIN
x := RPAD('X', 32767); -- same with LPAD
-- These compile fast:
x := RPAD('X', '32767'); -- length parameter as VARCHAR2
x := RPAD('X', 128); -- shorter string
END;
Execution of the compiled procedure is always fast. Disabling all PLSQL_WARNINGS does not make a difference.
What could be the reason for this? Some compiler check?