Don't return previous error on successful reprepare
Previous versions of the library would mark the query as a failure even
if the library managed to successfully reprepare the query.
Tested-by: Build Bot
@@ -365,18 +365,16 @@ N1QLREQ::maybe_retry()
// Let's see if we can actually retry. First remove the existing prepared
// entry:
cache().remove_entry(statement);
- lcb_error_t rc = request_plan();
- if (rc != LCB_SUCCESS) {
- lasterr = rc;
- return false;
- } else {
+ if ((lasterr = request_plan()) == LCB_SUCCESS) {
// We'll be parsing more rows later on..
parser->reset();
- }
return true;
}
+ return false;
+}
+
void
N1QLREQ::invoke_row(lcb_RESPN1QL *resp, bool is_last)
{
