On Apr 07, Mayank Prasad wrote:
> #At file:///home/mayank/mysql-tree/mydefects/5.1_11764633/ based on
> 3640 Mayank Prasad 2011-04-07
> Bug#11764633 : 57491: THD->MAIN_DA.IS_OK() ASSERT IN EMBEDDED
> @ libmysqld/lib_sql.cc
> Added code to set/reset 'error_handler_hook' to server/client
> error handler accordingly.
This is better than the first patch.
But still incorrect, as I wrote in my last comment to the bug#57491.
There can be many threads executing queries in the embedded - all in
parallel. For example, mysqltest is doing that.
And different threads may be in different states, e.g. one thread in the
server code, while the other - in the client code.
Which means that the error_handler_hook needs to be set differently for
them. One global setting is not enough.
As a possible solution, one can use a flag in my_thread_var, set and
reset it when entering and leaving the server code, and test it in