ORA-06531 Reference To Uninitialized Collection When Calling Mosaic (Doc ID 1335825.1)

Last updated on FEBRUARY 08, 2017

Applies to:

Oracle Spatial and Graph - Version 11.2.0.2 to 11.2.0.2 [Release 11.2]
Information in this document applies to any platform.
***Checked for relevance on 26-Nov-2013***

Symptoms

When using mosaic you get error ORA-06531: Reference to uninitialized collection

Here is a test case to show the problem. The example uses blank images but the error happens also with other images.

conn scott/tiger
drop table test_rdt;
drop table mosaic_rdt;
drop table test;
drop table mosaic;
create table test (id number primary key, image mdsys.sdo_georaster);
create table mosaic (id number primary key, image mdsys.sdo_georaster);

create table TEST_RDT of mdsys.sdo_raster
(primary key (rasterId, pyramidLevel, bandBlockNumber,
rowBlockNumber, columnBlockNumber))
lob(rasterblock) store as (nocache nologging);

create table MOSAIC_RDT of mdsys.sdo_raster
(primary key (rasterId, pyramidLevel, bandBlockNumber,
rowBlockNumber, columnBlockNumber))
lob(rasterblock) store as (nocache nologging);

declare
gr sdo_georaster;
gr1 sdo_georaster;
gr2 sdo_georaster;

begin
delete from test;
commit;
gr1 := sdo_geor.createBlank(21001, sdo_number_array(0, 0, 0), sdo_number_array(350, 350, 3), 255, 'TEST_RDT');
gr2 := sdo_geor.createBlank(21001, sdo_number_array(0, 0, 0), sdo_number_array(350, 350, 3), 255, 'TEST_RDT');

gr1.spatialExtent := null;
gr2.spatialExtent := null;

sdo_geor.georeference(gr1, 262148, 1,
sdo_number_array(0.419, 0, 1321160.5575),
sdo_number_array(0, -0.419, 467357.1645));
sdo_geor.georeference(gr2, 262148, 1,
sdo_number_array(0.419, 0, 1321244.3575),
sdo_number_array(0, -0.419, 467273.3645));

gr1.spatialExtent := sdo_geor.generateSpatialExtent(gr1);
gr2.spatialExtent := sdo_geor.generateSpatialExtent(gr2);

insert into test (id, image) values (1, gr1);
insert into test (id, image) values (2, gr2);
commit;
delete from mosaic;
commit;
insert into mosaic (id, image) values (1, sdo_geor.init('MOSAIC_RDT')) RETURNING image INTO gr;
sdo_geor.mosaic('TEST', 'IMAGE', gr, NULL);
update mosaic set image = gr where id = 1;
commit;
end;
/


This is the error stack:

ORA-06531: Reference to uninitialized collection
ORA-06512: at "MDSYS.SDO_GEOR_INT", line 674
ORA-06512: at "MDSYS.SDO_GEOR_INT", line 924
ORA-06512: at "MDSYS.SDO_GEOR_INT", line 1268
ORA-06512: at "MDSYS.SDO_GEOR_INT", line 1539
ORA-06512: at "MDSYS.SDO_GEOR", line 1401



Changes

Upgrade from prior versions to 11.2.0.2.0.
This problem does not reproduce if the database is created as 11.2.0.2.0

Cause

Sign In with your My Oracle Support account

Don't have a My Oracle Support account? Click to get started

My Oracle Support provides customers with access to over a
Million Knowledge Articles and hundreds of Community platforms