Drizzled Public API Documentation

natural_join_column.h
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/memory/sql_alloc.h>
00023 
00024 namespace drizzled {
00025 
00026 /*
00027   Column reference of a NATURAL/USING join. Since column references in
00028   joins can be both from views and stored tables, may point to either a
00029   Field (for tables).
00030 */
00031 
00032 class Natural_join_column: public memory::SqlAlloc
00033 {
00034 public:
00035   Field            *table_field; /* Column reference of table or temp view. */
00036   TableList *table_ref; /* Original base table/view reference. */
00037   /*
00038     True if a common join column of two NATURAL/USING join operands. Notice
00039     that when we have a hierarchy of nested NATURAL/USING joins, a column can
00040     be common at some level of nesting but it may not be common at higher
00041     levels of nesting. Thus this flag may change depending on at which level
00042     we are looking at some column.
00043   */
00044   bool is_common;
00045 public:
00046   Natural_join_column(Field *field_param, TableList *tab);
00047   const char *name();
00048   Item *create_item(Session *session);
00049   Field *field();
00050   const char *table_name();
00051   const char *db_name();
00052 };
00053 
00054 } /* namespace drizzled */
00055