diff options
author | unknown <anozdrin@mysql.com> | 2006-03-02 14:17:13 +0300 |
---|---|---|
committer | unknown <anozdrin@mysql.com> | 2006-03-02 14:17:13 +0300 |
commit | fad27ebf573d398e7d725ae95219e2f9a583a828 (patch) | |
tree | 05feea0e3819472c3488c35e75b3ff1f05c626fb /sql/sql_view.cc | |
parent | a44a924a407ae1f1135a14ee750468e6fc88d9b0 (diff) | |
download | mariadb-git-fad27ebf573d398e7d725ae95219e2f9a583a828.tar.gz |
Fix for BUG#16777: Can not create trigger nor view w/o definer
if --skip-grant-tables specified.
The problem is that there is a check that prevents creating a definer
with empty host name.
In --skip-grant-tables mode this check prevents the user from creating a
trigger/view without explicitly specifying its definer. This happens, because
in --skip-grant-tables mode CURRENT_USER is ''@''. According to Sanja this
check was implemented intentionally.
However, according to the MySQL manual it is possible to specify empty host
name (as well as empty user name). Moreover, the behaviour for stored routines
is different in this aspect -- we allow them to be created with implicit
definer.
Based on this, we believe it is OK to change the behaviour for views to be
similar with the behaviour for stored routines.
mysql-test/r/skip_grants.result:
Added a test case for BUG#16777.
mysql-test/t/skip_grants.test:
Added a test case for BUG#16777.
sql/mysql_priv.h:
Do not check that strlen(host) > 0 in get_default_definer().
sql/sql_parse.cc:
Do not check that strlen(host) > 0 in get_default_definer().
sql/sql_view.cc:
Do not check that strlen(host) > 0 in get_default_definer().
Diffstat (limited to 'sql/sql_view.cc')
-rw-r--r-- | sql/sql_view.cc | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/sql/sql_view.cc b/sql/sql_view.cc index 2178b5d00a8..4f2a9a07705 100644 --- a/sql/sql_view.cc +++ b/sql/sql_view.cc @@ -835,8 +835,7 @@ bool mysql_make_view(THD *thd, File_parser *parser, TABLE_LIST *table) push_warning_printf(thd, MYSQL_ERROR::WARN_LEVEL_WARN, ER_VIEW_FRM_NO_USER, ER(ER_VIEW_FRM_NO_USER), table->db, table->table_name); - if (get_default_definer(thd, &table->definer)) - goto err; + get_default_definer(thd, &table->definer); } /* |