summaryrefslogtreecommitdiff
path: root/sql
diff options
context:
space:
mode:
authorMichael Widenius <monty@askmonty.org>2010-11-04 17:08:28 +0200
committerMichael Widenius <monty@askmonty.org>2010-11-04 17:08:28 +0200
commit7647c2744c95f23fa7a1f4aec98359f5a9a55e01 (patch)
tree09d739e03d7203b9aab844694882c52417875513 /sql
parent3797ca41b39c862cf4733eadea8c91ed138ca1a4 (diff)
parenta1bd9532352aed69f03b632658b4ba20512b9cd1 (diff)
downloadmariadb-git-7647c2744c95f23fa7a1f4aec98359f5a9a55e01.tar.gz
Automatic merge with MariaDB 5.1
Diffstat (limited to 'sql')
-rw-r--r--sql/handler.cc6
-rw-r--r--sql/protocol.cc2
-rw-r--r--sql/sql_class.h7
-rw-r--r--sql/sql_error.cc2
4 files changed, 16 insertions, 1 deletions
diff --git a/sql/handler.cc b/sql/handler.cc
index 29aabda1343..48add3a1e53 100644
--- a/sql/handler.cc
+++ b/sql/handler.cc
@@ -1094,6 +1094,12 @@ int ha_commit_trans(THD *thd, bool all)
my_xid xid= thd->transaction.xid_state.xid.get_my_xid();
DBUG_ENTER("ha_commit_trans");
+ /* Just a random warning to test warnings pushed during autocommit. */
+ DBUG_EXECUTE_IF("warn_during_ha_commit_trans",
+ push_warning(thd, MYSQL_ERROR::WARN_LEVEL_WARN,
+ ER_WARNING_NOT_COMPLETE_ROLLBACK,
+ ER(ER_WARNING_NOT_COMPLETE_ROLLBACK)););
+
/*
We must not commit the normal transaction if a statement
transaction is pending. Otherwise statement transaction
diff --git a/sql/protocol.cc b/sql/protocol.cc
index 786d6ef8544..8a9d712077d 100644
--- a/sql/protocol.cc
+++ b/sql/protocol.cc
@@ -203,7 +203,7 @@ net_send_ok(THD *thd,
NET *net= &thd->net;
uchar buff[MYSQL_ERRMSG_SIZE+10],*pos;
bool error= FALSE;
- DBUG_ENTER("my_ok");
+ DBUG_ENTER("net_send_ok");
if (! net->vio) // hack for re-parsing queries
{
diff --git a/sql/sql_class.h b/sql/sql_class.h
index 4682938fd6d..bb986d6377f 100644
--- a/sql/sql_class.h
+++ b/sql/sql_class.h
@@ -1224,6 +1224,13 @@ public:
return m_total_warn_count;
}
+ /* Used to count any warnings pushed after calling set_ok_status(). */
+ void increment_warning()
+ {
+ if (m_status != DA_EMPTY)
+ m_total_warn_count++;
+ }
+
Diagnostics_area() { reset_diagnostics_area(); }
private:
diff --git a/sql/sql_error.cc b/sql/sql_error.cc
index 9ea7facbe41..835e60cd6ba 100644
--- a/sql/sql_error.cc
+++ b/sql/sql_error.cc
@@ -159,6 +159,8 @@ MYSQL_ERROR *push_warning(THD *thd, MYSQL_ERROR::enum_warning_level level,
}
thd->warn_count[(uint) level]++;
thd->total_warn_count++;
+ /* Make sure we also count warnings pushed after calling set_ok_status(). */
+ thd->main_da.increment_warning();
DBUG_RETURN(err);
}