[#1010962] TupleDesc reference leak

View Trackers | Bugs | Download .csv | Monitor

Date:
2010-12-15 17:07
Priority:
3
State:
Open
Submitted by:
Johann Oskarsson (myrkraverk)
Assigned to:
Johann Oskarsson (myrkraverk)
Category:
PL/Java
Group:
1.4.2
Summary:
TupleDesc reference leak

Detailed description
The following causes quite a few TupleDesc reference leak warnings.

create type B as ( b1_val float8, b2_val int);
create type C as ( c1_val float8, c2_val float8);

-- create complex, nested type
create type complexA as (
b B,
c C,
a_val int);

// File ComplexTest.java
package com.myrkraverk;

import java.sql.Array;
import java.sql.ResultSet;
import java.sql.SQLException;

public class ComplexTest
{
public static int complexParam( ResultSet receiver[] )
throws SQLException
{
for ( int i = 0; i < receiver.length; i++ )
{
ResultSet b = (ResultSet)receiver[ i ].getObject( 1 );
double b_val = b.getDouble( 1 );
int b2_val = b.getInt( 2 );

ResultSet c = (ResultSet)receiver[ i ].getObject( 2 );
double c1_val = c.getDouble( 1 );
double c2_val = c.getDouble( 2 );

int a = receiver[ i ].getInt( 3 );
;
}

return 0;
}
}
// End of file: ComplexTest.java

create function complexParam( complexA[] ) returns int
as 'com.myrkraverk.ComplexTest.complexParam'
language java;

select complexParam(array_agg(((0.1,i)::B,(0.1,10/i)::C,i)::complexA)) from
generate_series (1,10) i;

-- This generates lots of warnings like:

WARNING: TupleDesc reference leak: TupleDesc 124e120 (139824,-1) still referenced

Followup

Message
Date: 2012-06-21 10:47
Sender: Johann Oskarsson

Patch by Heikki Linnakangas applied for (at least) partial fix.

src/C/pljava/type/HeapTupleHeader.c 1.17

Attached Files:

Changes:

Field Old Value Date By
CategoryNone2010-12-16 16:42myrkraverk
GroupNone2010-12-16 16:42myrkraverk
Powered By FusionForge