Since SPI_modifytuple's natts argument is the number of attributes to be
authorTom Lane
Tue, 16 Sep 2003 00:50:09 +0000 (00:50 +0000)
committerTom Lane
Tue, 16 Sep 2003 00:50:09 +0000 (00:50 +0000)
changed, it should allow a zero value (implying no changes to make).

src/backend/executor/spi.c

index 44d2e1ab06d53b6efcfeb73700d185c8092310ea..aed70ee4bcabb07a5fc326bced54f0d745fe474e 100644 (file)
@@ -8,7 +8,7 @@
  *
  *
  * IDENTIFICATION
- *   $Header: /cvsroot/pgsql/src/backend/executor/spi.c,v 1.103 2003/08/08 21:41:42 momjian Exp $
+ *   $Header: /cvsroot/pgsql/src/backend/executor/spi.c,v 1.104 2003/09/16 00:50:09 tgl Exp $
  *
  *-------------------------------------------------------------------------
  */
@@ -409,7 +409,7 @@ SPI_modifytuple(Relation rel, HeapTuple tuple, int natts, int *attnum,
    bool        isnull;
    int         i;
 
-   if (rel == NULL || tuple == NULL || natts <= 0 || attnum == NULL || Values == NULL)
+   if (rel == NULL || tuple == NULL || natts < 0 || attnum == NULL || Values == NULL)
    {
        SPI_result = SPI_ERROR_ARGUMENT;
        return NULL;