1 #ifndef SQL_RESOLVER_INCLUDED
2 #define SQL_RESOLVER_INCLUDED
3 
4 /* Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved.
5 
6    This program is free software; you can redistribute it and/or modify
7    it under the terms of the GNU General Public License, version 2.0,
8    as published by the Free Software Foundation.
9 
10    This program is also distributed with certain software (including
11    but not limited to OpenSSL) that is licensed under separate terms,
12    as designated in a particular file or component or in included license
13    documentation.  The authors of MySQL hereby grant you an additional
14    permission to link the program and your derivative works with the
15    separately licensed software that they have included with MySQL.
16 
17    This program is distributed in the hope that it will be useful,
18    but WITHOUT ANY WARRANTY; without even the implied warranty of
19    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
20    GNU General Public License, version 2.0, for more details.
21 
22    You should have received a copy of the GNU General Public License
23    along with this program; if not, write to the Free Software
24    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301  USA */
25 
26 /**
27   RAII class for column privilege checking
28 */
29 class Column_privilege_tracker
30 {
31 public:
Column_privilege_tracker(THD * thd,ulong privilege)32   Column_privilege_tracker(THD *thd, ulong privilege)
33   : thd(thd), saved_privilege(thd->want_privilege)
34   {
35     thd->want_privilege= privilege;
36   }
~Column_privilege_tracker()37   ~Column_privilege_tracker()
38   {
39     thd->want_privilege= saved_privilege;
40   }
41 private:
42   THD *const thd;
43   const ulong saved_privilege;
44 };
45 
46 
47 /** @file Name resolution functions */
48 
49 bool setup_order(THD *thd, Ref_ptr_array ref_pointer_array, TABLE_LIST *tables,
50                  List<Item> &fields, List <Item> &all_fields, ORDER *order);
51 bool subquery_allows_materialization(Item_in_subselect *predicate,
52                                      THD *thd, SELECT_LEX *select_lex,
53                                      const SELECT_LEX *outer);
54 bool validate_gc_assignment(THD * thd, List<Item> *fields,
55                             List<Item> *values, TABLE *tab);
56 
57 #endif /* SQL_RESOLVER_INCLUDED */
58