Re: BUG #13764: function ghstore_consistent() returns a wrong value if var "strategy" contains an unsupported number

From: Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>
To: rucsoftsec(at)163(dot)com
Cc: pgsql-bugs(at)postgresql(dot)org
Subject: Re: BUG #13764: function ghstore_consistent() returns a wrong value if var "strategy" contains an unsupported number
Date: 2015-11-10 15:15:37
Message-ID: 20151110151537.GB614468@alvherre.pgsql
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

rucsoftsec(at)163(dot)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

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message Shulgin, Oleksandr 2015-11-10 15:45:40 Re: BUG #13765: Bug in openning a new window for query script
Previous Message Tom Lane 2015-11-10 15:13:11 Re: BUG #13764: function ghstore_consistent() returns a wrong value if var "strategy" contains an unsupported number