LI3DS / pg-li3ds

PostgreSQL extension for managing 3D sensor data
MIT License
11 stars 2 forks source link

Handle second form of dynamic transforms #66

Closed elemoine closed 7 years ago

mbredif commented 7 years ago

Thanks @elemoine !

elemoine commented 7 years ago

This PR introduced a small bug.

We now have function definitions like this:

create or replace function transform(point float8[3], transfo integer, ttime float8 default 0.0)
returns float8[3] as
$CODE$
    import pg_li3ds
    return pg_li3ds.transform_point_one(point, transfo, ttime)
$CODE$ language plpython2u;

create or replace function transform(point float8[3], transfo integer, ttime text default '')
returns float8[3] as
$CODE$
    import pg_li3ds
    return pg_li3ds.transform_point_one(point, transfo, ttime)
$CODE$ language plpython2u;

The second definition has been added by this PR.

The problem is that this no longer works:

select li3ds.transform(array[0, 0, 0], 1);

because both functions actually match the (array[0, 0, 0], 1) signature. The work-around is to use 0.0 or '' as the third argument to the function.