~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): Martin Pitt
  • Date: 2007-04-02 16:10:53 UTC
  • mfrom: (1.1.9 upstream)
  • Revision ID: james.westby@ubuntu.com-20070402161053-zkil9hjq9k5p1uzv
Tags: 5.0.37-0ubuntu1
* New upstream bugfix release.
  - Fixes replication failure with auto-increment and on duplicate key
    update, a regression introduced into 5.0.24. (LP: #95821)
* debian/control: Set Ubuntu maintainer.
* debian/rules: Change comments from 'Debian etch' to 'Ubuntu 7.04'.

Show diffs side-by-side

added added

removed removed

Lines of Context:
2
2
 
3
3
   This program is free software; you can redistribute it and/or modify
4
4
   it under the terms of the GNU General Public License as published by
5
 
   the Free Software Foundation; either version 2 of the License, or
6
 
   (at your option) any later version.
 
5
   the Free Software Foundation; version 2 of the License.
7
6
 
8
7
   This program is distributed in the hope that it will be useful,
9
8
   but WITHOUT ANY WARRANTY; without even the implied warranty of
589
588
  DBUG_RETURN(0);
590
589
 
591
590
err:
592
 
  thd->proc_info= "end";
 
591
  thd_proc_info(thd, "end");
593
592
  lex->link_first_table_back(view, link_to_local);
594
593
  unit->cleanup();
595
594
  DBUG_RETURN(res || thd->net.report_error);
1136
1135
      /*
1137
1136
        Prepare a security context to check underlying objects of the view
1138
1137
      */
1139
 
      Security_context *save_security_ctx= thd->security_ctx;
1140
1138
      if (!(table->view_sctx= (Security_context *)
1141
1139
            thd->stmt_arena->alloc(sizeof(Security_context))))
1142
1140
        goto err;
1143
1141
      /* Assign the context to the tables referenced in the view */
1144
 
      for (tbl= view_tables; tbl; tbl= tbl->next_global)
1145
 
        tbl->security_ctx= table->view_sctx;
 
1142
      if (view_tables)
 
1143
      {
 
1144
        DBUG_ASSERT(view_tables_tail);
 
1145
        for (tbl= view_tables; tbl != view_tables_tail->next_global;
 
1146
             tbl= tbl->next_global)
 
1147
          tbl->security_ctx= table->view_sctx;
 
1148
      }
1146
1149
      /* assign security context to SELECT name resolution contexts of view */
1147
1150
      for(SELECT_LEX *sl= lex->all_selects_list;
1148
1151
          sl;
1260
1263
        but it will not be included to SELECT_LEX tree, because it
1261
1264
        will not be executed
1262
1265
      */
 
1266
      table->select_lex->order_list.push_back(&lex->select_lex.order_list);
1263
1267
      goto ok;
1264
1268
    }
1265
1269