Re: [HACKERS] Bug in TupleQueueReaderNext() ?

2015-12-18 Thread Robert Haas
On Wed, Dec 16, 2015 at 1:09 AM, Rushabh Lathia
 wrote:
> TupleQueueReaderNext() always pass true for the nowait into
> shm_mq_receive() call. I think here it need to pass the nowait
> which is passed by the caller of TupleQueueReaderNext.
>
> This is usefull if the caller want TupleQueueReaderNext() to wait
> until it gets the tuple from the particular queue.

Boy, that's an embarassing mistake.  *blushes*

Thanks for the report and fix.  Committed.

-- 
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company


-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers


[HACKERS] Bug in TupleQueueReaderNext() ?

2015-12-15 Thread Rushabh Lathia
Hi All,

TupleQueueReaderNext() always pass true for the nowait into
shm_mq_receive() call. I think here it need to pass the nowait
which is passed by the caller of TupleQueueReaderNext.

This is usefull if the caller want TupleQueueReaderNext() to wait
until it gets the tuple from the particular queue.

PFA to fix the same.

Regards,
Rushabh Lathia
www.EnterpriseDB.com
diff --git a/src/backend/executor/tqueue.c b/src/backend/executor/tqueue.c
index d625b0d..276956e 100644
--- a/src/backend/executor/tqueue.c
+++ b/src/backend/executor/tqueue.c
@@ -535,7 +535,7 @@ TupleQueueReaderNext(TupleQueueReader *reader, bool nowait, bool *done)
 		void	   *data;
 
 		/* Attempt to read a message. */
-		result = shm_mq_receive(reader->queue, , , true);
+		result = shm_mq_receive(reader->queue, , , nowait);
 
 		/* If queue is detached, set *done and return NULL. */
 		if (result == SHM_MQ_DETACHED)

-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers