1 /* Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved.
2 
3    This program is free software; you can redistribute it and/or modify
4    it under the terms of the GNU General Public License as published by
5    the Free Software Foundation; version 2 of the License.
6 
7    This program is distributed in the hope that it will be useful,
8    but WITHOUT ANY WARRANTY; without even the implied warranty of
9    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
10    GNU General Public License for more details.
11 
12    You should have received a copy of the GNU General Public License
13    along with this program; if not, write to the Free Software
14    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1335  USA */
15 
16 #ifndef SQL_INSERT_INCLUDED
17 #define SQL_INSERT_INCLUDED
18 
19 #include "sql_class.h"                          /* enum_duplicates */
20 #include "sql_list.h"
21 
22 /* Instead of including sql_lex.h we add this typedef here */
23 typedef List<Item> List_item;
24 typedef struct st_copy_info COPY_INFO;
25 
26 bool mysql_prepare_insert(THD *thd, TABLE_LIST *table_list, TABLE *table,
27                           List<Item> &fields, List_item *values,
28                           List<Item> &update_fields,
29                           List<Item> &update_values, enum_duplicates duplic,
30                           COND **where, bool select_insert);
31 bool mysql_insert(THD *thd,TABLE_LIST *table,List<Item> &fields,
32                   List<List_item> &values, List<Item> &update_fields,
33                   List<Item> &update_values, enum_duplicates flag,
34                   bool ignore);
35 void upgrade_lock_type_for_insert(THD *thd, thr_lock_type *lock_type,
36                                   enum_duplicates duplic,
37                                   bool is_multi_insert);
38 int check_that_all_fields_are_given_values(THD *thd, TABLE *entry,
39                                            TABLE_LIST *table_list);
40 int vers_insert_history_row(TABLE *table);
41 int write_record(THD *thd, TABLE *table, COPY_INFO *info);
42 void kill_delayed_threads(void);
43 
44 #ifdef EMBEDDED_LIBRARY
kill_delayed_threads(void)45 inline void kill_delayed_threads(void) {}
46 #endif
47 
48 #endif /* SQL_INSERT_INCLUDED */
49