John Fawcett: > > Noted. Meanwhile I have separated 1) the code that handles the > > result set with the lookup result, from 2) the code that handles > > all other result sets. > > > > Without interleaving 1) and 2), the code becomes easier to follow. > > It's uploaded as postfix-3.2-20161225-nonprod; please check it out. > > > I confirm it behaves as expected on positive and negative cases. The > code is indeed much easier to follow.
I see room for two improvements: - Don't loop on mysql_next_result() if that function returns an error, to avoid going into an infinite loop. - Do call mysql_next_result() after mysql_store_result() etc. error just to be sure that we stay in sync. This won't log any Postfix warnings when the query_error flag was already raised. Wietse