On 12/25/2016 04:46 PM, Wietse Venema wrote:
> John Fawcett:
> [ Charset windows-1252 converted... ]
>> On 12/25/2016 09:30 AM, John Fawcett wrote:
>>> On 12/25/2016 01:17 AM, Wietse Venema wrote:
>>>> John Fawcett:
>>>>> Revised patch to improve error reporting when no result set containing
>>>>> data is returned
>>>> This code is now part of postfix-3.2-20161224-nonprod, slightly
>>>> edited to simplify error handling. I would be interested to hear
>>>> if it still works with queries that don't call a stored procedure.
>>>>
>>>>    Wietse
>>> Wietse
>>>
>>> your release has literally crossed with my testing and preparation of a
>>> revised fix. I will post it now and hope you can use that. I am sorry
>>> for your wasted time. I have done comparisons on this version to
>>> unpatched Postfix. I confirm as you picked up that the old patch gives
>>> incorrect error messages (though the results are consistent) compared to
>>> unpatched Postfix, but in various situations. I had to change the logic.
>>>
>>> John
>>>
>>>
>> I downloaded and tested your version. It is almost functionally
>> equivalent to my new version (for queries and stored procedures).
>>
>> Your version like my new one has the changed errno for queries that have
>> no select
>>
>>     postmap -q j...@erba.tv mysql:/etc/postfix/test_update.cf
>>     postmap: warning: mysql query failed:
>>     postmap: fatal: table mysql:/etc/postfix/test_update.cf: query
>> error: Operation not supported
>>
>> instead of unpatched postfix
>>
>>     postmap -q j...@erba.tv mysql:/etc/postfix/test_update.cf
>>     postmap: warning: mysql query failed:
>>     postmap: fatal: table mysql:/etc/postfix/test_update.cf: query
>> error: Success
> I think that Postfix should not report 'Success' for a failed query.
> EOPNOTSUPP or EINVAL would be more appropriate.
>
>> The only difference I found functionally was in the case of more than
>> two result sets. My new version prints the error message only once
>>
>> postmap -q j...@erba.tv mysql:/etc/postfix/test_call_res2.cf
>> postmap: warning: mysql query failed:
>> postmap: warning: dict_mysql: multiple result sets returning data are
>> not supported
>> postmap: fatal: table mysql:/etc/postfix/test_call_res2.cf: query error:
>> Operation not supported
> This can be fixed with inserting a 'break' after every error, but
> perhaps this code should not be looping over result sets in the
> first place. There are only two iterations, and each iteration does
> very different things.
>
> I'll diff your new patch against the previous version and see what
> changes you made.

if you break out of the loop without reading all the result data you
will get the following mysql error on the next query.

Commands out of sync; you can't run this command now

John

John

Reply via email to