List:MySQL++« Previous MessageNext Message »
From:Warren Young Date:August 31 2006 7:42pm
Subject:Re: a new query inside a result loop and exception
View as plain text  
Shigeya Suzuki wrote:
> 
> Now, when the inner query (actually, executing a stored procedure to add
> a record to two tables) fail and raise an exception, while trying to
> unwind stack frame, program stuck at following read().. following is the
> stack trace of the moment.

It's crashing down in the MySQL C library.  I can't really help you
there.  If you cannot avoid the problem, but must fix it, you'll need to
take this up on the main MySQL mailing list, where this is on topic.

> 1) Why this is happening?

Most likely it's because the MySQL network protocol is not made to allow
overlapping queries on a single connection, and there's some fault
caused when you try to get around this limitation by using two
connections.  Because of this limitation, most people write their code
so they don't need overlapping queries, so the problem you're running
into rarely manifests itself.

> 2) Is there any way to exec a stored procedure, while reading result
> using fetch_row() other than using two connections like this?

Is it absolutely required that the two queries be executed concurrently?
 Could you instead build up a list in memory from the first query and
then iterate over that list to build the inner loop queries?

> I'm currently using MySQL 5.0.24 on MacOS X, but by some reason, I built
> binary by myself.

If you decide to take this problem up with the MySQL C library people on
the main MySQL list, they'll ask you to try the native binary.  I would
also try using the Fink package.

> I will try on NetBSD too, but I doubt OS is the source of problem..

I wouldn't be so quick to discount that possibility.  OS X has a number
of differences from the other BSDs.
Thread
a new query inside a result loop and exceptionShigeya Suzuki31 Aug
  • Re: a new query inside a result loop and exceptionWarren Young31 Aug
    • Re: a new query inside a result loop and exceptionShigeya Suzuki1 Sep