summaryrefslogtreecommitdiff
path: root/sql/sql_class.h
diff options
context:
space:
mode:
authorKonstantin Osipov <kostja@sun.com>2009-11-20 17:18:37 +0300
committerKonstantin Osipov <kostja@sun.com>2009-11-20 17:18:37 +0300
commit34b11fb627df93e395158a27f48baa1c049ddf85 (patch)
tree126efa7bce0c3c70a1d3c3cb0099c6615f951e39 /sql/sql_class.h
parent3937a79886f9c3a1e0c998e66565a71b4a87d984 (diff)
parent5aeeaaf507ac87f6ff56806fe8a356cea7d4a48f (diff)
downloadmariadb-git-34b11fb627df93e395158a27f48baa1c049ddf85.tar.gz
Merge with next-mr
Diffstat (limited to 'sql/sql_class.h')
-rw-r--r--sql/sql_class.h14
1 files changed, 12 insertions, 2 deletions
diff --git a/sql/sql_class.h b/sql/sql_class.h
index 5359cabde6b..c0780bc39f7 100644
--- a/sql/sql_class.h
+++ b/sql/sql_class.h
@@ -1982,9 +1982,15 @@ public:
DBUG_VOID_RETURN;
}
inline bool vio_ok() const { return net.vio != 0; }
+ /** Return FALSE if connection to client is broken. */
+ bool is_connected()
+ {
+ return vio_ok() ? vio_is_connected(net.vio) : FALSE;
+ }
#else
void clear_error();
- inline bool vio_ok() const { return true; }
+ inline bool vio_ok() const { return TRUE; }
+ inline bool is_connected() { return TRUE; }
#endif
/**
Mark the current error as fatal. Warning: this does not
@@ -1993,6 +1999,7 @@ public:
*/
inline void fatal_error()
{
+ DBUG_ASSERT(main_da.is_error());
is_fatal_error= 1;
DBUG_PRINT("error",("Fatal error set"));
}
@@ -2158,7 +2165,10 @@ public:
else
{
x_free(db);
- db= new_db ? my_strndup(new_db, new_db_len, MYF(MY_WME)) : NULL;
+ if (new_db)
+ db= my_strndup(new_db, new_db_len, MYF(MY_WME | ME_FATALERROR));
+ else
+ db= NULL;
}
db_length= db ? new_db_len : 0;
return new_db && !db;