-- DBMS_XPLAN.DISPLAY_CURSOR: дочерний номер и пустой format.
|
-- Пара к sql/oracle/dbms_xplan_cursor_bounds.sql. Expected совпадает со стендом Oracle 23.5.
|
|
SET client_min_messages = notice;
|
DO $$
|
|
DECLARE
|
v_hit text := 'NO';
|
r record;
|
BEGIN
|
RAISE NOTICE 'Expected: no_priv=YES';
|
FOR r IN
|
SELECT plan_table_output AS line
|
FROM dbms_xplan_display_cursor(NULL, NULL, NULL)
|
LOOP
|
IF r.line IS NOT NULL AND position('NO SELECT PRIVILEGE' IN upper(r.line)) > 0 THEN
|
v_hit := 'YES';
|
END IF;
|
END LOOP;
|
RAISE NOTICE 'Actual: no_priv=%', v_hit;
|
END $$;
|
DO $$
|
|
DECLARE
|
v_hit text := 'NO';
|
r record;
|
BEGIN
|
RAISE NOTICE 'Expected: no_priv=YES';
|
FOR r IN
|
SELECT plan_table_output AS line
|
FROM dbms_xplan_display_cursor(NULL, 0, 'BASIC')
|
LOOP
|
IF r.line IS NOT NULL AND position('NO SELECT PRIVILEGE' IN upper(r.line)) > 0 THEN
|
v_hit := 'YES';
|
END IF;
|
END LOOP;
|
RAISE NOTICE 'Actual: no_priv=%', v_hit;
|
END $$;
|