00001 /* -*- mode: c++; c-basic-offset: 2; indent-tabs-mode: nil; -*- 00002 * vim:expandtab:shiftwidth=2:tabstop=2:smarttab: 00003 * 00004 * Copyright (C) 2008 Sun Microsystems, Inc. 00005 * 00006 * This program is free software; you can redistribute it and/or modify 00007 * it under the terms of the GNU General Public License as published by 00008 * the Free Software Foundation; version 2 of the License. 00009 * 00010 * This program is distributed in the hope that it will be useful, 00011 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00012 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00013 * GNU General Public License for more details. 00014 * 00015 * You should have received a copy of the GNU General Public License 00016 * along with this program; if not, write to the Free Software 00017 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 00018 */ 00019 00020 #pragma once 00021 00022 #include <drizzled/item.h> 00023 00024 namespace drizzled { 00025 00043 class Name_resolution_context : public memory::SqlAlloc 00044 { 00045 public: 00050 Name_resolution_context *outer_context; 00051 00060 TableList *table_list; 00068 TableList *first_name_resolution_table; 00073 TableList *last_name_resolution_table; 00074 00080 Select_Lex *select_lex; 00081 00087 bool resolve_in_select_list; 00088 00093 SecurityContext *security_ctx; 00094 00095 Name_resolution_context() 00096 : 00097 outer_context(0), 00098 table_list(0), 00099 select_lex(0), 00100 security_ctx(0) 00101 { 00102 } 00103 00104 inline void init() 00105 { 00106 resolve_in_select_list= false; 00107 first_name_resolution_table= NULL; 00108 last_name_resolution_table= NULL; 00109 } 00110 00111 inline void resolve_in_table_list_only(TableList *tables) 00112 { 00113 table_list= first_name_resolution_table= tables; 00114 resolve_in_select_list= false; 00115 } 00116 }; 00117 00118 } /* namespace drizzled */ 00119