aboutsummaryrefslogtreecommitdiff
path: root/odb/mysql/error.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'odb/mysql/error.cxx')
-rw-r--r--odb/mysql/error.cxx11
1 files changed, 10 insertions, 1 deletions
diff --git a/odb/mysql/error.cxx b/odb/mysql/error.cxx
index 460816a..94a41b2 100644
--- a/odb/mysql/error.cxx
+++ b/odb/mysql/error.cxx
@@ -16,7 +16,7 @@ namespace odb
namespace mysql
{
void
- translate_error (connection&,
+ translate_error (connection& c,
unsigned int e,
const std::string& sqlstate,
const std::string& message)
@@ -31,6 +31,15 @@ namespace odb
{
throw deadlock ();
}
+ case CR_SERVER_LOST:
+ case CR_SERVER_GONE_ERROR:
+ case CR_UNKNOWN_ERROR:
+ {
+ // This connection is no longer usable.
+ //
+ c.mark_failed ();
+ // Fall through.
+ }
default:
{
throw database_exception (e, sqlstate, message);