[asterisk-dev] Re: MySQL(Fetch) Not setting fetchid to 0 if no rows found

Tony Mountifield tony at softins.clara.co.uk
Thu Mar 9 01:33:08 MST 2006


In article <20060308125954.C0D7FC37F at lists.digium.com>,
S McGowan <madprofzero at yahoo.com> wrote:
> Greets all, 
> 
> Been a while since I posted to the -dev list, but this is definitely a
> developers question. I googled the issue, searched my archive of the -users and
> -dev list, but found that everything written is contrary to the following issue,
> which is showing up on my 1.2.1 server:
> 
> When running the MYSQL() app, I run my query and then fetch it, as per normal
> operation. My client then has me creating a ${RETURNCODE} variable based on if
> ${FETCHID} is 0 or 1, to see if the row returned anything or not. (I know, it
> could have just been done by checking for null value in the var, but it's how
> they're doing it).
> 
> The problem is that apparently ${FETCHID} is 1 even when no rows were
> fetched....Any thoughts/insights on this?

I've had no problems interpreting the fetchid after attempting a fetch with
MYSQL. Admittedly it was nearly a year since I last tried it, and something
could have got broken since then.

Could you post the dialplan fragment in question, from the MYSQL Connect
to the MYSQL Disconnect, and up to the test of fetchid if it happens after
the disconnect?

Cheers
Tony
-- 
Tony Mountifield
Work: tony at softins.co.uk - http://www.softins.co.uk
Play: tony at mountifield.org - http://tony.mountifield.org



More information about the asterisk-dev mailing list