Jim Wallace wrote:
> I assume this is because when the BadQuery
> exception is constructed calls error() which calls mysql_error() but
> that clears out the errornum() (mysql_errno()).
Test this assumption before doing any work based on it. Some of the
reasons I'm skeptical:
- I don't see mention any such behavior in the MySQL C API docs
- I think I'd remember if MySQL++ cleared the error number itself
- Not all BadQuery exceptions carry the return value of
Connection::error() as the message, so if you're catching one of those,
the error number would already be meaningless
> If not, adding an unsigned int to the BadQuery exception class
If you're going to do this, add it to every exception where it makes sense.