mirror of
https://github.com/MariaDB/server.git
synced 2025-07-29 05:21:33 +03:00
Merge zippy.cornsilk.net:/home/cmiller/work/mysql/mysql-5.1-recentcommmerge
into zippy.cornsilk.net:/home/cmiller/work/mysql/mysql-5.1 client/mysqlcheck.c: Auto merged configure.in: Auto merged include/config-win.h: Auto merged mysql-test/r/func_in.result: Auto merged mysql-test/r/information_schema.result: Auto merged mysql-test/t/func_in.test: Auto merged mysql-test/t/information_schema.test: Auto merged sql/item_cmpfunc.cc: Auto merged sql/item_func.cc: Auto merged sql/log_event.cc: Auto merged sql/mysql_priv.h: Auto merged sql/mysqld.cc: Auto merged sql/set_var.cc: Auto merged sql/sp_head.cc: Auto merged sql/sql_base.cc: Auto merged sql/sql_cache.cc: Auto merged sql/sql_class.cc: Auto merged sql/sql_class.h: Auto merged sql/sql_delete.cc: Auto merged sql/sql_insert.cc: Auto merged sql/sql_lex.cc: Auto merged sql/sql_parse.cc: Auto merged sql/sql_prepare.cc: Auto merged sql/sql_repl.cc: Auto merged sql/sql_select.cc: Auto merged sql/sql_show.cc: Auto merged sql/sql_table.cc: Auto merged sql/sql_update.cc: Auto merged sql/sql_view.cc: Auto merged sql/sql_yacc.yy: Auto merged sql/table.h: Auto merged storage/myisam/ha_myisam.cc: Auto merged sql/sql_lex.h: SCCS merged
This commit is contained in:
@ -223,9 +223,6 @@ bool mysql_create_view(THD *thd, TABLE_LIST *views,
|
||||
{
|
||||
LEX *lex= thd->lex;
|
||||
bool link_to_local;
|
||||
#ifndef NO_EMBEDDED_ACCESS_CHECKS
|
||||
bool definer_check_is_needed= mode != VIEW_ALTER || lex->definer;
|
||||
#endif
|
||||
/* first table in list is target VIEW name => cut off it */
|
||||
TABLE_LIST *view= lex->unlink_first_table(&link_to_local);
|
||||
TABLE_LIST *tables= lex->query_tables;
|
||||
@ -280,7 +277,7 @@ bool mysql_create_view(THD *thd, TABLE_LIST *views,
|
||||
- same as current user
|
||||
- current user has SUPER_ACL
|
||||
*/
|
||||
if (definer_check_is_needed &&
|
||||
if (lex->definer &&
|
||||
(strcmp(lex->definer->user.str, thd->security_ctx->priv_user) != 0 ||
|
||||
my_strcasecmp(system_charset_info,
|
||||
lex->definer->host.str,
|
||||
@ -672,7 +669,7 @@ static File_option view_parameters[]=
|
||||
FILE_OPTIONS_STRING},
|
||||
{{(char*) STRING_WITH_LEN("view_body_utf8")},
|
||||
my_offsetof(TABLE_LIST, view_body_utf8),
|
||||
FILE_OPTIONS_STRING},
|
||||
FILE_OPTIONS_ESTRING},
|
||||
{{NullS, 0}, 0,
|
||||
FILE_OPTIONS_STRING}
|
||||
};
|
||||
@ -953,6 +950,12 @@ bool mysql_make_view(THD *thd, File_parser *parser, TABLE_LIST *table,
|
||||
DBUG_RETURN(0);
|
||||
}
|
||||
|
||||
if (table->index_hints && table->index_hints->elements)
|
||||
{
|
||||
my_error(ER_WRONG_USAGE, MYF(0), "index hints", "VIEW");
|
||||
DBUG_RETURN(TRUE);
|
||||
}
|
||||
|
||||
/* check loop via view definition */
|
||||
for (TABLE_LIST *precedent= table->referencing_view;
|
||||
precedent;
|
||||
|
Reference in New Issue
Block a user