summaryrefslogtreecommitdiff
path: root/sql/event_data_objects.cc
diff options
context:
space:
mode:
Diffstat (limited to 'sql/event_data_objects.cc')
-rw-r--r--sql/event_data_objects.cc12
1 files changed, 9 insertions, 3 deletions
diff --git a/sql/event_data_objects.cc b/sql/event_data_objects.cc
index c97d2212c89..a9aa313dc0b 100644
--- a/sql/event_data_objects.cc
+++ b/sql/event_data_objects.cc
@@ -15,7 +15,7 @@
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1335 USA */
#define MYSQL_LEX 1
-#include "my_global.h" /* NO_EMBEDDED_ACCESS_CHECKS */
+#include <my_global.h> /* NO_EMBEDDED_ACCESS_CHECKS */
#include "sql_priv.h"
#include "unireg.h"
#include "sql_parse.h" // parse_sql
@@ -209,7 +209,7 @@ Event_basic::Event_basic()
{
DBUG_ENTER("Event_basic::Event_basic");
/* init memory root */
- init_sql_alloc(&mem_root, 256, 512);
+ init_sql_alloc(&mem_root, 256, 512, MYF(0));
dbname.str= name.str= NULL;
dbname.length= name.length= 0;
time_zone= NULL;
@@ -608,7 +608,7 @@ Event_timed::load_from_row(THD *thd, TABLE *table)
table, &creation_ctx))
{
push_warning_printf(thd,
- MYSQL_ERROR::WARN_LEVEL_WARN,
+ Sql_condition::WARN_LEVEL_WARN,
ER_EVENT_INVALID_CREATION_CTX,
ER(ER_EVENT_INVALID_CREATION_CTX),
(const char *) dbname.str,
@@ -1462,13 +1462,19 @@ end:
NOTE: even if we run in read-only mode, we should be able to lock
the mysql.event table for writing. In order to achieve this, we
should call mysql_lock_tables() under the super-user.
+
+ Same goes for transaction access mode.
+ Temporarily reset it to read-write.
*/
saved_master_access= thd->security_ctx->master_access;
thd->security_ctx->master_access |= SUPER_ACL;
+ bool save_tx_read_only= thd->tx_read_only;
+ thd->tx_read_only= false;
ret= Events::drop_event(thd, dbname, name, FALSE);
+ thd->tx_read_only= save_tx_read_only;
thd->security_ctx->master_access= saved_master_access;
}
}