Earl Miles wrote:
> After the exceptions change there's a minor failure in the resetdb.cpp
> that fails to check for an exception if it is unable to create the
> sample database (which seems like a very common early error). Simply
> adding a try/catch around that bit fixes it.
Sorry, Earl, this patch misses the entire point of that change. On some
platforms, nested exception handlers don't work. If an exception is
thrown from within a catch block, the program segfaults, even if it is
within a second catch block.
You're right, though, that a problem would occur if the second
select_db() call threw an exception. To fix this, I've added
disable_exceptions() and restore_exceptions() methods to the Connection
class. Note that these functions still work if throw_exceptions is
false initially, since the restore call just returns to the previous
value; it is not "enable_exceptions()".
> Here's the diff, sent as an
> attachment to prevent my mailer from word-wrapping it and destroying the
> diff.
Thanks for the effort, but it still got mangled. Line endings were DOS
(may be my mailer's fault, though I don't know why it would mess with an
attachment) and tabs were converted to spaces. I was still able to
apply it, but to prevent hassle in the future, I'd appreciate it if you
could see if either of these problems are something you can fix on your end.
Also, in one place you put a curly brace on the following line instead
of using K&R brace style, as the rest of the program uses. Please try
to maintain whatever style you see nearby when changing the code, no
matter how ugly it appears to you. :) I'm aware that the code style is
not consistent; I'm in the process of converting it piece by piece, as I
touch each file.