summaryrefslogtreecommitdiff
path: root/sql/sql_do.cc
diff options
context:
space:
mode:
Diffstat (limited to 'sql/sql_do.cc')
-rw-r--r--sql/sql_do.cc16
1 files changed, 11 insertions, 5 deletions
diff --git a/sql/sql_do.cc b/sql/sql_do.cc
index 8406a9eaf45..4ba887b5ab2 100644
--- a/sql/sql_do.cc
+++ b/sql/sql_do.cc
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000-2006 MySQL AB
+/* Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -11,12 +11,17 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
/* Execute DO statement */
-#include "mysql_priv.h"
+#include "sql_priv.h"
+#include "transaction.h"
+#include "unireg.h"
+#include "sql_do.h"
+#include "sql_base.h" // setup_fields
+#include "sql_select.h" // free_underlaid_joins
bool mysql_do(THD *thd, List<Item> &values)
{
@@ -34,9 +39,10 @@ bool mysql_do(THD *thd, List<Item> &values)
/*
Rollback the effect of the statement, since next instruction
will clear the error and the rollback in the end of
- dispatch_command() won't work.
+ mysql_execute_command() won't work.
*/
- ha_autocommit_or_rollback(thd, thd->is_error());
+ if (! thd->in_sub_stmt)
+ trans_rollback_stmt(thd);
thd->clear_error(); // DO always is OK
}
my_ok(thd);