summaryrefslogtreecommitdiff
path: root/sql/sql_view.cc
diff options
context:
space:
mode:
authoranozdrin@mysql.com <>2006-03-01 14:13:07 +0300
committeranozdrin@mysql.com <>2006-03-01 14:13:07 +0300
commite03e5222013a0bbfc17adb37f5201b9f0dbc5327 (patch)
treebaf54f335b2a6ccc3c2d1da9406e0832ddb6c26b /sql/sql_view.cc
parentdb1ecaa1a29e958815befb2c6dbfd9a78229e6d1 (diff)
downloadmariadb-git-e03e5222013a0bbfc17adb37f5201b9f0dbc5327.tar.gz
Fix for BUG#16266: Definer is not fully qualified error during replication.
The idea of the fix is to extend support of non-SUID triggers for backward compatibility. Formerly non-SUID triggers were appeared when "new" server is being started against "old" database. Now, they are also created when "new" slave receives updates from "old" master.
Diffstat (limited to 'sql/sql_view.cc')
-rw-r--r--sql/sql_view.cc20
1 files changed, 20 insertions, 0 deletions
diff --git a/sql/sql_view.cc b/sql/sql_view.cc
index 4f62a80cfd4..2178b5d00a8 100644
--- a/sql/sql_view.cc
+++ b/sql/sql_view.cc
@@ -208,6 +208,26 @@ bool mysql_create_view(THD *thd,
if (mode != VIEW_CREATE_NEW)
sp_cache_invalidate();
+ if (!lex->definer)
+ {
+ /*
+ DEFINER-clause is missing; we have to create default definer in
+ persistent arena to be PS/SP friendly.
+ */
+
+ Query_arena original_arena;
+ Query_arena *ps_arena = thd->activate_stmt_arena_if_needed(&original_arena);
+
+ if (!(lex->definer= create_default_definer(thd)))
+ res= TRUE;
+
+ if (ps_arena)
+ thd->restore_active_arena(ps_arena, &original_arena);
+
+ if (res)
+ goto err;
+ }
+
#ifndef NO_EMBEDDED_ACCESS_CHECKS
/*
check definer of view: