20
20
#ifndef DRIZZLED_CURSOR_H
21
21
#define DRIZZLED_CURSOR_H
23
#include <drizzled/atomics.h>
24
#include <drizzled/definitions.h>
23
#include <drizzled/xid.h>
25
24
#include <drizzled/discrete_interval.h>
26
#include <drizzled/error_t.h>
27
#include <drizzled/ha_statistics.h>
28
#include <drizzled/handler_structs.h>
29
25
#include <drizzled/identifier.h>
26
#include <drizzled/definitions.h>
30
27
#include <drizzled/key_map.h>
31
#include <drizzled/message/table.h>
29
/* Definitions for parameters to do with Cursor-routines */
31
#include <drizzled/thr_lock.h>
32
#include <drizzled/sql_string.h>
32
33
#include <drizzled/sql_list.h>
33
#include <drizzled/thr_lock.h>
34
#include <drizzled/xid.h>
34
#include <drizzled/plugin/storage_engine.h>
35
#include <drizzled/handler_structs.h>
36
#include <drizzled/ha_statistics.h>
37
#include <drizzled/atomics.h>
39
#include <drizzled/message/table.pb.h>
37
42
#include <algorithm>
39
#include <drizzled/visibility.h>
655
654
uint64_t setup_tables_done_option);
656
655
void free_underlaid_joins(Session *session, Select_Lex *select);
658
bool handle_derived(LEX *lex, bool (*processor)(Session *session,
657
bool mysql_handle_derived(LEX *lex, bool (*processor)(Session *session,
660
659
TableList *table));
661
bool derived_prepare(Session *session, LEX *lex, TableList *t);
662
bool derived_filling(Session *session, LEX *lex, TableList *t);
660
bool mysql_derived_prepare(Session *session, LEX *lex, TableList *t);
661
bool mysql_derived_filling(Session *session, LEX *lex, TableList *t);
663
662
int prepare_create_field(CreateField *sql_field,
664
663
uint32_t *blob_columns,
665
664
int *timestamps, int *timestamps_with_niladic);
667
bool create_table(Session *session,
668
const identifier::Table &identifier,
669
HA_CREATE_INFO *create_info,
670
message::Table &table_proto,
671
AlterInfo *alter_info,
672
bool tmp_table, uint32_t select_field_count,
673
bool is_if_not_exists);
675
bool create_table_no_lock(Session *session,
676
const identifier::Table &identifier,
677
HA_CREATE_INFO *create_info,
678
message::Table &table_proto,
679
AlterInfo *alter_info,
680
bool tmp_table, uint32_t select_field_count,
681
bool is_if_not_exists);
683
bool create_like_table(Session* session,
684
identifier::Table::const_reference destination_identifier,
685
identifier::Table::const_reference source_identifier,
686
message::Table &create_table_proto,
687
bool is_if_not_exists,
690
bool rename_table(Session &session,
666
bool mysql_create_table(Session *session,
667
TableIdentifier &identifier,
668
HA_CREATE_INFO *create_info,
669
message::Table &table_proto,
670
AlterInfo *alter_info,
671
bool tmp_table, uint32_t select_field_count,
672
bool is_if_not_exists);
674
bool mysql_create_table_no_lock(Session *session,
675
TableIdentifier &identifier,
676
HA_CREATE_INFO *create_info,
677
message::Table &table_proto,
678
AlterInfo *alter_info,
679
bool tmp_table, uint32_t select_field_count,
680
bool is_if_not_exists);
682
bool mysql_create_like_table(Session* session,
683
TableIdentifier &destination_identifier,
684
TableList* table, TableList* src_table,
685
message::Table &create_table_proto,
686
bool is_if_not_exists,
689
bool mysql_rename_table(Session &session,
691
690
plugin::StorageEngine *base,
692
const identifier::Table &old_identifier,
693
const identifier::Table &new_identifier);
691
TableIdentifier &old_identifier,
692
TableIdentifier &new_identifier);
695
bool prepare_update(Session *session, TableList *table_list,
694
bool mysql_prepare_update(Session *session, TableList *table_list,
696
695
Item **conds, uint32_t order_num, Order *order);
697
int update_query(Session *session,TableList *tables,List<Item> &fields,
696
int mysql_update(Session *session,TableList *tables,List<Item> &fields,
698
697
List<Item> &values,COND *conds,
699
698
uint32_t order_num, Order *order, ha_rows limit,
700
699
enum enum_duplicates handle_duplicates, bool ignore);
701
bool prepare_insert(Session *session, TableList *table_list, Table *table,
700
bool mysql_prepare_insert(Session *session, TableList *table_list, Table *table,
702
701
List<Item> &fields, List_item *values,
703
702
List<Item> &update_fields,
704
703
List<Item> &update_values, enum_duplicates duplic,
705
704
COND **where, bool select_insert,
706
705
bool check_fields, bool abort_on_warning);
707
bool insert_query(Session *session,TableList *table,List<Item> &fields,
706
bool mysql_insert(Session *session,TableList *table,List<Item> &fields,
708
707
List<List_item> &values, List<Item> &update_fields,
709
708
List<Item> &update_values, enum_duplicates flag,
711
710
int check_that_all_fields_are_given_values(Session *session, Table *entry,
712
711
TableList *table_list);
713
int prepare_delete(Session *session, TableList *table_list, Item **conds);
714
bool delete_query(Session *session, TableList *table_list, COND *conds,
712
int mysql_prepare_delete(Session *session, TableList *table_list, Item **conds);
713
bool mysql_delete(Session *session, TableList *table_list, COND *conds,
715
714
SQL_LIST *order, ha_rows rows, uint64_t options,
716
715
bool reset_auto_increment);
717
bool truncate(Session& session, TableList *table_list);
716
bool mysql_truncate(Session& session, TableList *table_list);
718
717
TableShare *get_table_share(Session *session, TableList *table_list, char *key,
719
718
uint32_t key_length, uint32_t db_flags, int *error);
720
719
TableShare *get_cached_table_share(const char *db, const char *table_name);