Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lDAcd-0006ja-QE for pgsql-hackers@arkaria.postgresql.org; Fri, 19 Feb 2021 18:35:24 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1lDAcc-0007x8-KX for pgsql-hackers@arkaria.postgresql.org; Fri, 19 Feb 2021 18:35:22 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lDAcb-0007x0-Pk for pgsql-hackers@lists.postgresql.org; Fri, 19 Feb 2021 18:35:22 +0000 Received: from wout1-smtp.messagingengine.com ([64.147.123.24]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lDAcW-0003Ow-Js for pgsql-hackers@lists.postgresql.org; Fri, 19 Feb 2021 18:35:21 +0000 Received: from compute2.internal (compute2.nyi.internal [10.202.2.42]) by mailout.west.internal (Postfix) with ESMTP id 6F4355BE; Fri, 19 Feb 2021 13:35:13 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute2.internal (MEProxy); Fri, 19 Feb 2021 13:35:13 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:subject:to :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm2; bh=U+ldbbUlk8NCbdlE9uluiLJoHSxYWi9YgtGiF2K+5KE=; b=N8tlHCTF VLvv7U2gBLJmxM7Rhmsqiwybvt0958PhyZYTSGIBOmYwgPk4+5HzPDjcB2GzkXdE zCXCdufmpceU7vpk6Ai8n4WHZr4auEW3ll/q1ZXOhtQZY6wa+03tzll6KkGhu/HK sboTEJyRL4TU8eJs99b2eVYMAVUXfkIYXcuoxvLWj137gkX+3QKBacz+r+fc28bf wlCd4sD/jCiaS2UY6AmCETFK88txFj6C6lYmWIA+FHzAJLuvhI1QmPFgbrCNzgGE i21yXVX1pxtMFJ7HJLRHDx7XBFrgaa8xVGFArXQgiUML1jziED2yXCMRU3/aDGq7 a3a3IoW/cHe1dw== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduledrjeeigdduudegucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepfffhvffukfggtggugfgjfgesthekredttderudenucfhrhhomheptehlvhgr rhhoucfjvghrrhgvrhgruceorghlvhhhvghrrhgvsegrlhhvhhdrnhhoqdhiphdrohhrgh eqnecuggftrfgrthhtvghrnhepueffhfejieeuueffgedvudekgeeltdeviedvieeufeei ieevgfetheeufeethedvnecukfhppeduledtrdelhedrudelrddujeejnecuvehluhhsth gvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomheprghlvhhhvghrrhgvsegr lhhvhhdrnhhoqdhiphdrohhrgh X-ME-Proxy: Received: from perhan.alvh.no-ip.org (unknown [190.95.19.177]) by mail.messagingengine.com (Postfix) with ESMTPA id 32FFD24005B; Fri, 19 Feb 2021 13:35:12 -0500 (EST) Received: by perhan.alvh.no-ip.org (Postfix, from userid 1000) id 864462A39D1; Fri, 19 Feb 2021 15:35:09 -0300 (-03) Date: Fri, 19 Feb 2021 15:35:09 -0300 From: Alvaro Herrera To: Zhihong Yu Cc: Craig Ringer , Matthieu Garrigues , PostgreSQL-development Subject: Re: PATCH: Batch/pipelining support for libpq Message-ID: <20210219183509.GA4851@alvherre.pgsql> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Hello, thanks for looking at this patch. On 2021-Feb-16, Zhihong Yu wrote: > + if (querymode == QUERY_SIMPLE) > + { > + commandFailed(st, "startpipeline", "cannot use pipeline mode > with the simple query protocol"); > + st->state = CSTATE_ABORTED; > + return CSTATE_ABORTED; > > I wonder why the st->state is only assigned for this if block. The state is > not set for other cases where CSTATE_ABORTED is returned. Yeah, that's a simple oversight. We don't need to set st->state, because the caller sets it to the value we return. > Should PQ_PIPELINE_OFF be returned for the following case ? > > +PQpipelineStatus(const PGconn *conn) > +{ > + if (!conn) > + return false; Yep. Thanks -- Álvaro Herrera 39°49'30"S 73°17'W