~ubuntu-branches/ubuntu/hardy/mysql-dfsg-5.0/hardy-updates

« back to all changes in this revision

Viewing changes to libmysqld/sql_view.cc

  • Committer: Bazaar Package Importer
  • Author(s): sean finney
  • Date: 2007-05-13 12:32:45 UTC
  • mfrom: (1.1.11 upstream)
  • Revision ID: james.westby@ubuntu.com-20070513123245-8c3l187dk34cz2ar
Tags: 5.0.41-2
the previous "translation changes" inadvertently introduced unrelated
changes in the package control file.

Show diffs side-by-side

added added

removed removed

Lines of Context:
224
224
{
225
225
  LEX *lex= thd->lex;
226
226
  bool link_to_local;
 
227
#ifndef NO_EMBEDDED_ACCESS_CHECKS
 
228
  bool definer_check_is_needed= mode != VIEW_ALTER || lex->definer;
 
229
#endif
227
230
  /* first table in list is target VIEW name => cut off it */
228
231
  TABLE_LIST *view= lex->unlink_first_table(&link_to_local);
229
232
  TABLE_LIST *tables= lex->query_tables;
256
259
    /*
257
260
      DEFINER-clause is missing; we have to create default definer in
258
261
      persistent arena to be PS/SP friendly.
 
262
      If this is an ALTER VIEW then the current user should be set as
 
263
      the definer.
259
264
    */
260
 
 
261
265
    Query_arena original_arena;
262
266
    Query_arena *ps_arena = thd->activate_stmt_arena_if_needed(&original_arena);
263
267
 
277
281
      - same as current user
278
282
      - current user has SUPER_ACL
279
283
  */
280
 
  if (strcmp(lex->definer->user.str,
281
 
             thd->security_ctx->priv_user) != 0 ||
282
 
      my_strcasecmp(system_charset_info,
283
 
                    lex->definer->host.str,
284
 
                    thd->security_ctx->priv_host) != 0)
 
284
  if (definer_check_is_needed &&
 
285
      (strcmp(lex->definer->user.str, thd->security_ctx->priv_user) != 0 ||
 
286
       my_strcasecmp(system_charset_info,
 
287
                     lex->definer->host.str,
 
288
                     thd->security_ctx->priv_host) != 0))
285
289
  {
286
290
    if (!(thd->security_ctx->master_access & SUPER_ACL))
287
291
    {
588
592
  DBUG_RETURN(0);
589
593
 
590
594
err:
591
 
  thd->proc_info= "end";
 
595
  thd_proc_info(thd, "end");
592
596
  lex->link_first_table_back(view, link_to_local);
593
597
  unit->cleanup();
594
598
  DBUG_RETURN(res || thd->net.report_error);