Re: MySQL stored-procedure support for Postfix 3.2

2017-02-18 Thread jl
On 2016-12-27 09:45, John Fawcett wrote: On 12/26/2016 10:35 PM, Wietse Venema wrote: John Fawcett: so long as the loop continues in the presence of a zero return code from mysql_next_result() and mysql_store_result is called for each one we will stay in sync. With the break above we will be ok

Re: MySQL stored-procedure support for Postfix 3.2

2016-12-27 Thread John Fawcett
On 12/26/2016 10:35 PM, Wietse Venema wrote: > John Fawcett: >> so long as the loop continues in the presence of a zero return >> code from mysql_next_result() and mysql_store_result is called for >> each one we will stay in sync. With the break above we will be ok, >> since the loop stops only whe

Re: MySQL stored-procedure support for Postfix 3.2

2016-12-26 Thread Wietse Venema
John Fawcett: > so long as the loop continues in the presence of a zero return > code from mysql_next_result() and mysql_store_result is called for > each one we will stay in sync. With the break above we will be ok, > since the loop stops only when there are no more results -1 normal > condition f

Re: MySQL stored-procedure support for Postfix 3.2

2016-12-26 Thread John Fawcett
On 12/26/2016 01:45 AM, Wietse Venema wrote: > 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. A break is needed in the case of >0 return code from mysql_next_result. while ((next_res_st

Re: MySQL stored-procedure support for Postfix 3.2

2016-12-25 Thread Wietse Venema
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-nonpr

Re: MySQL stored-procedure support for Postfix 3.2

2016-12-25 Thread John Fawcett
On 12/25/2016 08:45 PM, Wietse Venema wrote: > John Fawcett: >>> 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 o

Re: MySQL stored-procedure support for Postfix 3.2

2016-12-25 Thread Wietse Venema
John Fawcett: > > 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 Not

Re: MySQL stored-procedure support for Postfix 3.2

2016-12-25 Thread John Fawcett
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 >

Re: MySQL stored-procedure support for Postfix 3.2

2016-12-25 Thread Wietse Venema
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 pos

Re: MySQL stored-procedure support for Postfix 3.2

2016-12-25 Thread John Fawcett
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

Re: MySQL stored-procedure support for Postfix 3.2

2016-12-25 Thread John Fawcett
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 sti

MySQL stored-procedure support for Postfix 3.2

2016-12-24 Thread Wietse Venema
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 procedu