Thursday, July 15, 2010

PLS-00801: internal error [*** ASSERT at file pdw4.c - Bug in Oracle 10g

Learn t something accidentally working in project. Its about a bug (Bug 5212759) in Oracle 10g fixed in 11G R1.

scott@10GR2> select * from v$version;

BANNER
----------------------------------------------------------------
Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Prod
PL/SQL Release 10.2.0.1.0 - Production
CORE    10.2.0.1.0      Production
TNS for 32-bit Windows: Version 10.2.0.1.0 - Production
NLSRTL Version 10.2.0.1.0 - Production

scott@10GR2> create type foo is object( x number);
  2  /

Type created.

scott@10GR2> create type too is table of foo;
  2  /

Type created.

scott@10GR2> declare
  2     t1 too := new too();
  3     t2 too ;
  4  begin
  5     select foo(level)
  6     bulk collect into t1
  7     from dual
  8     connect by level <= 5;
  9
 10     t2 := t1 multiset union t2;
 11  end;
 12  /
        t2 := t1 multiset union t2;
        *
ERROR at line 10:
ORA-06550: line 10, column 2:
PLS-00801: internal error [*** ASSERT at file pdw4.c, line 2076; Type 0x0AE3E5F4 has no MAP method.; _anon__2F37FA0C__AB[10, 2]]

scott@11GR1> select * from v$version;

BANNER
--------------------------------------------------------------------------
Oracle Database 11g Enterprise Edition Release 11.1.0.6.0 - Production
PL/SQL Release 11.1.0.6.0 - Production
CORE    11.1.0.6.0      Production
TNS for 32-bit Windows: Version 11.1.0.6.0 - Production
NLSRTL Version 11.1.0.6.0 - Production

scott@11GR1> create type foo is object( x number);
  2  /

Type created.

scott@11GR1> create type too is table of foo;
  2  /

Type created.

scott@11GR1> declare
  2     t1 too := new too();
  3     t2 too ;
  4  begin
  5     select foo(level)
  6     bulk collect into t1
  7     from dual
  8     connect by level <= 5;
  9
 10     t2 := t1 multiset union t2;
 11  end;
 12  /

PL/SQL procedure successfully completed.

As a workaround in Oracle 10g is to add a dummy MAP method to the object type foo.

scott@10GR2> drop type too;

Type dropped.

scott@10GR2> drop type foo;

Type dropped.

scott@10GR2> create type foo is object( x number,
  2     map member function mem return number);
  3  /

Type created.

scott@10GR2> create type too is table of foo;
  2  /

Type created.

scott@10GR2> declare
  2     type t_arr is table of number;
  3     data1 t_arr;
  4     data2 t_arr;
  5  begin
  6     select level lvl
  7     bulk collect into
  8     data1
  9     from dual
 10     connect by level<=5;
 11
 12     data2 := data1 multiset union data2;
 13  end;
 14  /

PL/SQL procedure successfully completed.

2 comments:

  1. good ,it's solve my problem.
    Thank you very much.

    ReplyDelete
  2. good ,it's solve my problem.
    Thank you very much

    ReplyDelete