Drizzled Public API Documentation

select_insert.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 
00021 #pragma once
00022 
00023 #include <drizzled/copy_info.h>
00024 #include <drizzled/select_result_interceptor.h>
00025 
00026 namespace drizzled {
00027 
00028 class select_insert :public select_result_interceptor 
00029 {
00030 public:
00031   TableList *table_list;
00032   Table *table;
00033   List<Item> *fields;
00034   uint64_t autoinc_value_of_last_inserted_row; // autogenerated or not
00035   CopyInfo info;
00036   bool insert_into_view;
00037   select_insert(TableList *table_list_par,
00038     Table *table_par, List<Item> *fields_par,
00039     List<Item> *update_fields, List<Item> *update_values,
00040     enum_duplicates duplic, bool ignore);
00041   ~select_insert();
00042   int prepare(List<Item> &list, Select_Lex_Unit *u);
00043   virtual int prepare2(void);
00044   bool send_data(List<Item> &items);
00045   virtual void store_values(List<Item> &values);
00046   virtual bool can_rollback_data() { return 0; }
00047   void send_error(drizzled::error_t errcode,const char *err);
00048   bool send_eof();
00049   void abort();
00050   /* not implemented: select_insert is never re-used in prepared statements */
00051   void cleanup();
00052 };
00053 
00054 } /* namespace drizzled */
00055