570
533
the corresponding 'ha_*' method above.
573
virtual int open(const char *name, int mode, uint32_t test_if_locked)=0;
574
virtual int index_init(uint32_t idx, bool)
536
virtual int open(const char *, int , uint32_t ) { assert(0); return -1; }
537
virtual int doOpen(const identifier::Table &identifier, int mode, uint32_t test_if_locked);
538
virtual int doStartIndexScan(uint32_t idx, bool)
575
539
{ active_index= idx; return 0; }
576
virtual int index_end() { active_index= MAX_KEY; return 0; }
540
virtual int doEndIndexScan() { active_index= MAX_KEY; return 0; }
578
rnd_init() can be called two times without rnd_end() in between
542
doStartTableScan() can be called two times without doEndTableScan() in between
579
543
(it only makes sense if scan=1).
580
544
then the second call should prepare for the new table scan (e.g
581
545
if rnd_init allocates the cursor, second call should position it
582
546
to the start of the table, no need to deallocate and allocate it again
584
virtual int rnd_init(bool scan)= 0;
585
virtual int rnd_end() { return 0; }
586
virtual int write_row(unsigned char *)
588
return HA_ERR_WRONG_COMMAND;
591
virtual int update_row(const unsigned char *, unsigned char *)
593
return HA_ERR_WRONG_COMMAND;
596
virtual int delete_row(const unsigned char *)
548
virtual int doStartTableScan(bool scan) __attribute__ ((warn_unused_result)) = 0;
549
virtual int doEndTableScan() { return 0; }
550
virtual int doInsertRecord(unsigned char *)
552
return HA_ERR_WRONG_COMMAND;
555
virtual int doUpdateRecord(const unsigned char *, unsigned char *)
557
return HA_ERR_WRONG_COMMAND;
560
virtual int doDeleteRecord(const unsigned char *)
598
562
return HA_ERR_WRONG_COMMAND;
700
665
uint64_t setup_tables_done_option);
701
666
void free_underlaid_joins(Session *session, Select_Lex *select);
703
bool mysql_handle_derived(LEX *lex, bool (*processor)(Session *session,
668
bool handle_derived(LEX *lex, bool (*processor)(Session *session,
705
670
TableList *table));
706
bool mysql_derived_prepare(Session *session, LEX *lex, TableList *t);
707
bool mysql_derived_filling(Session *session, LEX *lex, TableList *t);
671
bool derived_prepare(Session *session, LEX *lex, TableList *t);
672
bool derived_filling(Session *session, LEX *lex, TableList *t);
708
673
int prepare_create_field(CreateField *sql_field,
709
674
uint32_t *blob_columns,
710
675
int *timestamps, int *timestamps_with_niladic);
712
bool mysql_create_table(Session *session,
713
TableIdentifier &identifier,
714
HA_CREATE_INFO *create_info,
715
message::Table &table_proto,
716
AlterInfo *alter_info,
717
bool tmp_table, uint32_t select_field_count,
718
bool is_if_not_exists);
720
bool mysql_create_table_no_lock(Session *session,
721
TableIdentifier &identifier,
722
HA_CREATE_INFO *create_info,
723
message::Table &table_proto,
724
AlterInfo *alter_info,
725
bool tmp_table, uint32_t select_field_count,
726
bool is_if_not_exists);
728
bool mysql_create_like_table(Session* session,
729
TableIdentifier &destination_identifier,
730
TableList* table, TableList* src_table,
731
message::Table &create_table_proto,
732
bool is_if_not_exists,
735
bool mysql_rename_table(plugin::StorageEngine *base,
736
TableIdentifier &old_identifier,
737
TableIdentifier &new_identifier,
740
bool mysql_prepare_update(Session *session, TableList *table_list,
741
Item **conds, uint32_t order_num, order_st *order);
742
int mysql_update(Session *session,TableList *tables,List<Item> &fields,
677
bool create_table(Session *session,
678
const identifier::Table &identifier,
679
HA_CREATE_INFO *create_info,
680
message::Table &table_proto,
681
AlterInfo *alter_info,
682
bool tmp_table, uint32_t select_field_count,
683
bool is_if_not_exists);
685
bool create_table_no_lock(Session *session,
686
const identifier::Table &identifier,
687
HA_CREATE_INFO *create_info,
688
message::Table &table_proto,
689
AlterInfo *alter_info,
690
bool tmp_table, uint32_t select_field_count,
691
bool is_if_not_exists);
693
bool create_like_table(Session* session,
694
identifier::Table::const_reference destination_identifier,
695
identifier::Table::const_reference source_identifier,
696
message::Table &create_table_proto,
697
bool is_if_not_exists,
700
bool rename_table(Session &session,
701
plugin::StorageEngine *base,
702
const identifier::Table &old_identifier,
703
const identifier::Table &new_identifier);
705
bool prepare_update(Session *session, TableList *table_list,
706
Item **conds, uint32_t order_num, Order *order);
707
int update_query(Session *session,TableList *tables,List<Item> &fields,
743
708
List<Item> &values,COND *conds,
744
uint32_t order_num, order_st *order, ha_rows limit,
709
uint32_t order_num, Order *order, ha_rows limit,
745
710
enum enum_duplicates handle_duplicates, bool ignore);
746
bool mysql_prepare_insert(Session *session, TableList *table_list, Table *table,
711
bool prepare_insert(Session *session, TableList *table_list, Table *table,
747
712
List<Item> &fields, List_item *values,
748
713
List<Item> &update_fields,
749
714
List<Item> &update_values, enum_duplicates duplic,
750
715
COND **where, bool select_insert,
751
716
bool check_fields, bool abort_on_warning);
752
bool mysql_insert(Session *session,TableList *table,List<Item> &fields,
717
bool insert_query(Session *session,TableList *table,List<Item> &fields,
753
718
List<List_item> &values, List<Item> &update_fields,
754
719
List<Item> &update_values, enum_duplicates flag,
756
721
int check_that_all_fields_are_given_values(Session *session, Table *entry,
757
722
TableList *table_list);
758
int mysql_prepare_delete(Session *session, TableList *table_list, Item **conds);
759
bool mysql_delete(Session *session, TableList *table_list, COND *conds,
723
int prepare_delete(Session *session, TableList *table_list, Item **conds);
724
bool delete_query(Session *session, TableList *table_list, COND *conds,
760
725
SQL_LIST *order, ha_rows rows, uint64_t options,
761
726
bool reset_auto_increment);
762
bool mysql_truncate(Session& session, TableList *table_list);
727
bool truncate(Session& session, TableList *table_list);
763
728
TableShare *get_table_share(Session *session, TableList *table_list, char *key,
764
729
uint32_t key_length, uint32_t db_flags, int *error);
765
730
TableShare *get_cached_table_share(const char *db, const char *table_name);
766
731
bool reopen_name_locked_table(Session* session, TableList* table_list, bool link_in);
767
Table *table_cache_insert_placeholder(Session *session, const char *key,
768
uint32_t key_length);
769
bool lock_table_name_if_not_cached(Session *session, const char *db,
770
const char *table_name, Table **table);
771
bool reopen_table(Table *table);
772
732
bool reopen_tables(Session *session,bool get_locks,bool in_refresh);
773
void close_data_files_and_morph_locks(Session *session, const char *db,
774
const char *table_name);
775
733
void close_handle_and_leave_table_as_lock(Table *table);
776
734
bool wait_for_tables(Session *session);
777
735
bool table_is_used(Table *table, bool wait_for_name_lock);
778
Table *drop_locked_tables(Session *session,const char *db, const char *table_name);
779
void abort_locked_tables(Session *session,const char *db, const char *table_name);
736
Table *drop_locked_tables(Session *session, const drizzled::identifier::Table &identifier);
737
void abort_locked_tables(Session *session, const drizzled::identifier::Table &identifier);
780
738
extern Field *not_found_field;
781
739
extern Field *view_ref_found;