Assertion failure with 6-dimensional array in PL/python - Mailing list pgsql-bugs

From Heikki Linnakangas
Subject Assertion failure with 6-dimensional array in PL/python
Date
Msg-id 61647b8e-961c-0362-d5d3-c8a18f4a7ec6@iki.fi
Whole thread Raw
List pgsql-bugs
create extension plpythonu;

-- from 'plpython_types' regression test
CREATE FUNCTION test_type_conversion_array_int4(x int4[]) RETURNS int4[] 
AS $$
plpy.info(x, type(x))
return x
$$ LANGUAGE plpythonu;

postgres=# SELECT * FROM test_type_conversion_array_int4(ARRAY [[[[[[ 1 
]]]]]]);
server closed the connection unexpectedly
    This probably means the server terminated abnormally
    before or while processing the request.
The connection to the server was lost. Attempting reset: Failed.
!?>

TRAP: FailedAssertion("!(ndim < 6)", File: "plpy_typeio.c", Line: 686)

The assertion looks like this:

    if (ARR_NDIM(array) == 0)
        return PyList_New(0);

    /* Array dimensions and left bounds */
    ndim = ARR_NDIM(array);
    dims = ARR_DIMS(array);
    Assert(ndim < MAXDIM);     <-----

I believe that's wrong, it should be "ndim <= MAXDIM". Looks like I 
introduced this in commit 94aceed317, in v10.

I'll go fix that...

- Heikki



pgsql-bugs by date:

Previous
From: Daniele Varrazzo
Date:
Subject: PostgreSQL 9.6 fails to install on Ubuntu
Next
From: Alvaro Herrera
Date:
Subject: Re: ERROR: insufficient columns in the PRIMARY KEY constraint definition