You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

60 lines
2.6 KiB

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