Changes between Initial Version and Version 1 of Ticket #4530, comment 3


Ignore:
Timestamp:
Oct 13, 2019, 2:14:17 AM (5 years ago)
Author:
strk

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #4530, comment 3

    initial v1  
    1 I think it's a legit failure. The code at hand is raster/rt_pg/rtpostgis.sql.in around line 7490.
    2 Function _add_raster_constraint_extent(rastschema name, rasttable name, rastcolumn name).
     1I think it's a legit failure. The code at hand is {{{ raster/rt_pg/rtpostgis.sql.in }}} around line 7490.
     2Function {{{ _add_raster_constraint_extent(rastschema name, rasttable name, rastcolumn name) }}}.
    33The offending "null argument to EXECUTE" comes from here:
    44
     5{{{
    56    sql := 'SELECT @extschema@.st_ashexewkb( @extschema@.st_setsrid( @extschema@.st_extent( @extschema@.st_envelope('
    67      || quote_ident($3)
     
    89      || fqtn;
    910    EXECUTE sql INTO attr;
    10 
     11}}}
    1112
    1213I bet {{{ srid }}} is the null value, propagating to the whole {{{ sql }}}. Here's how it is fetched:
    1314
     15{{{
    1416    sql := 'SELECT @extschema@.ST_SRID('
    1517      || quote_ident($3)
     
    2022      || ' IS NOT NULL LIMIT 1;';
    2123                EXECUTE sql INTO srid;
    22 
     24}}}
    2325
    2426Now.. what if the raster table is empty ? I guess SRID remains NULL, making a NULL sql and getting to the error. I'd rather fix than comment out.