From 8723e37a26a3cfffe716c975eb33b6b1c3e8822a Mon Sep 17 00:00:00 2001
From: Tom Lane <tgl@sss.pgh.pa.us>
Date: Tue, 16 Sep 2003 00:50:09 +0000
Subject: [PATCH] Since SPI_modifytuple's natts argument is the number of
 attributes to be changed, it should allow a zero value (implying no changes
 to make).

---
 src/backend/executor/spi.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/backend/executor/spi.c b/src/backend/executor/spi.c
index 44d2e1ab06..aed70ee4bc 100644
--- a/src/backend/executor/spi.c
+++ b/src/backend/executor/spi.c
@@ -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;
-- 
2.40.0