Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1ZwAes-0003Oh-Sd for pgsql-bugs@arkaria.postgresql.org; Tue, 10 Nov 2015 15:16:30 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84) (envelope-from ) id 1ZwAes-0007TC-61 for pgsql-bugs@arkaria.postgresql.org; Tue, 10 Nov 2015 15:16:30 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84) (envelope-from ) id 1ZwAeG-0006mG-CG for pgsql-bugs@postgresql.org; Tue, 10 Nov 2015 15:15:52 +0000 Received: from out.smtp-auth.no-ip.com ([8.23.224.60]) by makus.postgresql.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.84) (envelope-from ) id 1ZwAeC-0001os-SQ for pgsql-bugs@postgresql.org; Tue, 10 Nov 2015 15:15:51 +0000 X-No-IP: alvh.no-ip.org@noip-smtp X-Report-Spam-To: abuse@no-ip.com Received: from alvin.alvh.no-ip.org (unknown [201.186.21.16]) (Authenticated sender: alvh.no-ip.org@noip-smtp) by smtp-auth.no-ip.com (Postfix) with ESMTPA id D128540115D; Tue, 10 Nov 2015 07:15:42 -0800 (PST) Received: by alvin.alvh.no-ip.org (Postfix, from userid 1000) id EF0C2F75; Tue, 10 Nov 2015 12:15:37 -0300 (CLT) Date: Tue, 10 Nov 2015 12:15:37 -0300 From: Alvaro Herrera To: rucsoftsec@163.com Cc: pgsql-bugs@postgresql.org Subject: Re: BUG #13764: function ghstore_consistent() returns a wrong value if var "strategy" contains an unsupported number Message-ID: <20151110151537.GB614468@alvherre.pgsql> References: <20151110030730.2573.7699@wrigleys.postgresql.org> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20151110030730.2573.7699@wrigleys.postgresql.org> User-Agent: Mutt/1.5.23 (2014-03-12) X-Pg-Spam-Score: -2.6 (--) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-bugs Precedence: bulk Sender: pgsql-bugs-owner@postgresql.org rucsoftsec@163.com wrote: > function ghstore_consistent() computes the consistency and return a bool > value. It first computes the value of variable "strategy". It second > executes different branches of the code depending of different value of > variable "straregy". When the value of variable"strategy" is an unsupported > strategy number, function ghstore_consistent() will executes the code in > line 584. It means function ghstore_consistent() fails, but the value of > variable "res" is "true" which will be returned in line 586. Therefore, does > it need to assign "false" to variable "res" after line 584? No, because elog(ERROR) never returns and so the "return" in ghstore_consistent() is not reached. It doesn't matter what value "res" contains. -- Álvaro Herrera http://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services -- Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-bugs