37
36
TinaShare(const TinaShare &);
38
37
TinaShare& operator=(const TinaShare &);
40
explicit TinaShare(const char *name);
39
explicit TinaShare(const std::string &name);
43
42
std::string table_name;
44
char data_file_name[FN_REFLEN];
43
std::string data_file_name;
45
44
uint32_t use_count;
47
46
Here we save the length of the file for readers. This is updated by
80
73
drizzled::String buffer;
82
75
The chain contains "holes" in the file, occured because of
83
deletes/updates. It is used in rnd_end() to get rid of them
76
deletes/updates. It is used in doEndTableScan() to get rid of them
84
77
in the end of the query.
86
tina_set chain_buffer[DEFAULT_CHAIN_LENGTH];
89
unsigned char chain_alloced;
79
std::vector< std::pair<off_t, off_t> > chain;
91
80
uint32_t local_data_file_version; /* Saved version of the data file used */
92
81
bool records_is_known;
93
82
drizzled::memory::Root blobroot;
95
bool get_write_pos(off_t *end_pos, tina_set *closest_hole);
84
bool get_write_pos(off_t *end_pos,
85
std::vector< std::pair<off_t, off_t> >::iterator &closest_hole);
96
86
int open_update_temp_file_if_needed();
97
87
int init_tina_writer();
98
88
int init_data_file();
118
106
/* The next method will never be called */
119
107
virtual bool fast_key_read() { return 1;}
121
TODO: return actual upper bound of number of records in the table.
109
@TODO return actual upper bound of number of records in the table.
122
110
(e.g. save number of records seen on full table scan and/or use file size
125
113
drizzled::ha_rows estimate_rows_upper_bound() { return HA_POS_ERROR; }
127
int open(const char *name, int mode, uint32_t open_options);
115
int doOpen(const drizzled::TableIdentifier &identifier, int mode, uint32_t test_if_locked);
116
int open(const char *, int , uint32_t ) { assert(0); return -1; }
129
int write_row(unsigned char * buf);
130
int update_row(const unsigned char * old_data, unsigned char * new_data);
131
int delete_row(const unsigned char * buf);
132
int rnd_init(bool scan=1);
118
int doInsertRecord(unsigned char * buf);
119
int doUpdateRecord(const unsigned char * old_data, unsigned char * new_data);
120
int doDeleteRecord(const unsigned char * buf);
121
int doStartTableScan(bool scan=1);
133
122
int rnd_next(unsigned char *buf);
134
123
int rnd_pos(unsigned char * buf, unsigned char *pos);
136
TinaShare *get_share(const char *table_name);
124
int doEndTableScan();
125
TinaShare *get_share(const std::string &table_name);
137
126
int free_share();
138
127
int repair(drizzled::Session* session, drizzled::HA_CHECK_OPT* check_opt);
139
128
/* This is required for SQL layer to know that we support autorepair */
140
129
void position(const unsigned char *record);
142
131
int delete_all_rows(void);
145
These functions used to get/update status of the Cursor.
146
Needed to enable concurrent inserts.
149
void update_status();
132
void get_auto_increment(uint64_t, uint64_t,
151
138
/* The following methods were added just for TINA */
152
139
int encode_quote(unsigned char *buf);