12
12
You should have received a copy of the GNU General Public License
13
13
along with this program; if not, write to the Free Software
14
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
16
#include "heap_priv.h"
17
#include <drizzled/error.h>
18
#include <drizzled/table.h>
19
#include <drizzled/session.h>
20
#include <drizzled/field/timestamp.h>
21
#include <drizzled/field/varstring.h>
22
#include "drizzled/plugin/daemon.h"
24
#include <boost/thread/mutex.hpp>
14
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
16
#define DRIZZLE_SERVER 1
17
#include <drizzled/server_includes.h>
27
18
#include "ha_heap.h"
32
using namespace drizzled;
35
static const string engine_name("MEMORY");
37
boost::mutex THR_LOCK_heap;
39
static const char *ha_heap_exts[] = {
43
class HeapEngine : public plugin::StorageEngine
46
explicit HeapEngine(string name_arg) :
47
plugin::StorageEngine(name_arg,
48
HTON_STATS_RECORDS_IS_EXACT |
53
HTON_SKIP_STORE_LOCK |
60
hp_panic(HA_PANIC_CLOSE);
63
virtual Cursor *create(Table &table)
65
return new ha_heap(*this, table);
68
const char **bas_ext() const {
72
int doCreateTable(Session &session,
74
const TableIdentifier &identifier,
75
message::Table &create_proto);
77
/* For whatever reason, internal tables can be created by Cursor::open()
79
Instead of diving down a rat hole, let's just cry ourselves to sleep
80
at night with this odd hackish workaround.
82
int heap_create_table(Session *session, const char *table_name,
85
message::Table &create_proto,
86
HP_SHARE **internal_share);
88
int doRenameTable(Session&, const TableIdentifier &from, const TableIdentifier &to);
90
int doDropTable(Session&, const TableIdentifier &identifier);
92
int doGetTableDefinition(Session& session,
93
const TableIdentifier &identifier,
94
message::Table &table_message);
96
uint32_t max_supported_keys() const { return MAX_KEY; }
97
uint32_t max_supported_key_part_length() const { return MAX_KEY_LENGTH; }
99
uint32_t index_flags(enum ha_key_alg ) const
101
return ( HA_ONLY_WHOLE_INDEX | HA_KEY_SCAN_NOT_ROR);
104
bool doDoesTableExist(Session& session, const TableIdentifier &identifier);
105
void doGetTableIdentifiers(CachedDirectory &directory,
106
const SchemaIdentifier &schema_identifier,
107
TableIdentifier::vector &set_of_identifiers);
110
void HeapEngine::doGetTableIdentifiers(CachedDirectory&,
111
const SchemaIdentifier&,
112
TableIdentifier::vector&)
116
bool HeapEngine::doDoesTableExist(Session& session, const TableIdentifier &identifier)
118
return session.getMessageCache().doesTableMessageExist(identifier);
121
int HeapEngine::doGetTableDefinition(Session &session,
122
const TableIdentifier &identifier,
123
message::Table &table_proto)
125
if (session.getMessageCache().getTableMessage(identifier, table_proto))
131
We have to ignore ENOENT entries as the MEMORY table is created on open and
132
not when doing a CREATE on the table.
134
int HeapEngine::doDropTable(Session &session, const TableIdentifier &identifier)
136
session.getMessageCache().removeTableMessage(identifier);
138
int error= heap_delete_table(identifier.getPath().c_str());
146
static HeapEngine *heap_storage_engine= NULL;
148
static int heap_init(module::Context &context)
150
heap_storage_engine= new HeapEngine(engine_name);
151
context.add(heap_storage_engine);
21
static handler *heap_create_handler(handlerton *hton,
25
int heap_deinit(void *p __attribute__((unused)))
28
return hp_panic(HA_PANIC_CLOSE);
32
int heap_init(void *p)
34
handlerton *heap_hton;
36
heap_hton= (handlerton *)p;
37
heap_hton->state= SHOW_OPTION_YES;
38
heap_hton->db_type= DB_TYPE_HEAP;
39
heap_hton->create= heap_create_handler;
40
heap_hton->flags= HTON_CAN_RECREATE;
45
static handler *heap_create_handler(handlerton *hton,
49
return new (mem_root) ha_heap(hton, table);
156
53
/*****************************************************************************
158
55
*****************************************************************************/
160
ha_heap::ha_heap(plugin::StorageEngine &engine_arg,
162
:Cursor(engine_arg, table_arg), file(0), records_changed(0), key_stat_version(0),
57
ha_heap::ha_heap(handlerton *hton, TABLE_SHARE *table_arg)
58
:handler(hton, table_arg), file(0), records_changed(0), key_stat_version(0),
63
static const char *ha_heap_exts[] = {
67
const char **ha_heap::bas_ext() const
167
Hash index statistics is updated (copied from HP_KEYDEF::hash_buckets to
168
rec_per_key) after 1/MEMORY_STATS_UPDATE_THRESHOLD fraction of table records
169
have been inserted/updated/deleted. delete_all_rows() and table flush cause
73
Hash index statistics is updated (copied from HP_KEYDEF::hash_buckets to
74
rec_per_key) after 1/HEAP_STATS_UPDATE_THRESHOLD fraction of table records
75
have been inserted/updated/deleted. delete_all_rows() and table flush cause
173
79
hash index statistics must be updated when number of table records changes
174
from 0 to non-zero value and vice versa. Otherwise records_in_range may
80
from 0 to non-zero value and vice versa. Otherwise records_in_range may
175
81
erroneously return 0 and 'range' may miss records.
177
#define MEMORY_STATS_UPDATE_THRESHOLD 10
83
#define HEAP_STATS_UPDATE_THRESHOLD 10
179
int ha_heap::doOpen(const drizzled::TableIdentifier &identifier, int mode, uint32_t test_if_locked)
85
int ha_heap::open(const char *name, int mode, uint test_if_locked)
181
if ((test_if_locked & HA_OPEN_INTERNAL_TABLE) || (!(file= heap_open(identifier.getPath().c_str(), mode)) && errno == ENOENT))
87
if ((test_if_locked & HA_OPEN_INTERNAL_TABLE) || (!(file= heap_open(name, mode)) && my_errno == ENOENT))
89
HA_CREATE_INFO create_info;
183
90
internal_table= test(test_if_locked & HA_OPEN_INTERNAL_TABLE);
91
memset(&create_info, 0, sizeof(create_info));
185
HP_SHARE *internal_share= NULL;
186
message::Table create_proto;
188
if (not heap_storage_engine->heap_create_table(getTable()->in_use,
189
identifier.getPath().c_str(),
93
if (!create(name, table, &create_info))
195
95
file= internal_table ?
196
96
heap_open_from_share(internal_share, mode) :
304
200
records_changed= 0;
305
201
/* At the end of update_key_stats() we can proudly claim they are OK. */
306
key_stat_version= file->getShare()->key_stat_version;
202
key_stat_version= file->s->key_stat_version;
310
int ha_heap::doInsertRecord(unsigned char * buf)
206
int ha_heap::write_row(uchar * buf)
313
if (getTable()->next_number_field && buf == getTable()->getInsertRecord())
209
ha_statistic_increment(&SSV::ha_write_count);
210
if (table->timestamp_field_type & TIMESTAMP_AUTO_SET_ON_INSERT)
211
table->timestamp_field->set_time();
212
if (table->next_number_field && buf == table->record[0])
315
214
if ((res= update_auto_increment()))
318
217
res= heap_write(file,buf);
319
if (!res && (++records_changed*MEMORY_STATS_UPDATE_THRESHOLD >
320
file->getShare()->records))
218
if (!res && (++records_changed*HEAP_STATS_UPDATE_THRESHOLD >
323
222
We can perform this safely since only one writer at the time is
324
223
allowed on the table.
326
file->getShare()->key_stat_version++;
225
file->s->key_stat_version++;
331
int ha_heap::doUpdateRecord(const unsigned char * old_data, unsigned char * new_data)
230
int ha_heap::update_row(const uchar * old_data, uchar * new_data)
233
ha_statistic_increment(&SSV::ha_update_count);
234
if (table->timestamp_field_type & TIMESTAMP_AUTO_SET_ON_UPDATE)
235
table->timestamp_field->set_time();
335
236
res= heap_update(file,old_data,new_data);
336
if (!res && ++records_changed*MEMORY_STATS_UPDATE_THRESHOLD >
337
file->getShare()->records)
237
if (!res && ++records_changed*HEAP_STATS_UPDATE_THRESHOLD >
340
241
We can perform this safely since only one writer at the time is
341
242
allowed on the table.
343
file->getShare()->key_stat_version++;
244
file->s->key_stat_version++;
348
int ha_heap::doDeleteRecord(const unsigned char * buf)
249
int ha_heap::delete_row(const uchar * buf)
252
ha_statistic_increment(&SSV::ha_delete_count);
352
253
res= heap_delete(file,buf);
353
if (!res && getTable()->getShare()->getType() == message::Table::STANDARD &&
354
++records_changed*MEMORY_STATS_UPDATE_THRESHOLD > file->getShare()->records)
254
if (!res && table->s->tmp_table == NO_TMP_TABLE &&
255
++records_changed*HEAP_STATS_UPDATE_THRESHOLD > file->s->records)
357
258
We can perform this safely since only one writer at the time is
358
259
allowed on the table.
360
file->getShare()->key_stat_version++;
261
file->s->key_stat_version++;
365
int ha_heap::index_read_map(unsigned char *buf, const unsigned char *key,
266
int ha_heap::index_read_map(uchar *buf, const uchar *key,
366
267
key_part_map keypart_map,
367
268
enum ha_rkey_function find_flag)
369
270
assert(inited==INDEX);
370
ha_statistic_increment(&system_status_var::ha_read_key_count);
271
ha_statistic_increment(&SSV::ha_read_key_count);
371
272
int error = heap_rkey(file,buf,active_index, key, keypart_map, find_flag);
372
getTable()->status = error ? STATUS_NOT_FOUND : 0;
273
table->status = error ? STATUS_NOT_FOUND : 0;
376
int ha_heap::index_read_last_map(unsigned char *buf, const unsigned char *key,
277
int ha_heap::index_read_last_map(uchar *buf, const uchar *key,
377
278
key_part_map keypart_map)
379
280
assert(inited==INDEX);
380
ha_statistic_increment(&system_status_var::ha_read_key_count);
281
ha_statistic_increment(&SSV::ha_read_key_count);
381
282
int error= heap_rkey(file, buf, active_index, key, keypart_map,
382
283
HA_READ_PREFIX_LAST);
383
getTable()->status= error ? STATUS_NOT_FOUND : 0;
284
table->status= error ? STATUS_NOT_FOUND : 0;
387
int ha_heap::index_read_idx_map(unsigned char *buf, uint32_t index, const unsigned char *key,
288
int ha_heap::index_read_idx_map(uchar *buf, uint index, const uchar *key,
388
289
key_part_map keypart_map,
389
290
enum ha_rkey_function find_flag)
391
ha_statistic_increment(&system_status_var::ha_read_key_count);
292
ha_statistic_increment(&SSV::ha_read_key_count);
392
293
int error = heap_rkey(file, buf, index, key, keypart_map, find_flag);
393
getTable()->status = error ? STATUS_NOT_FOUND : 0;
294
table->status = error ? STATUS_NOT_FOUND : 0;
397
int ha_heap::index_next(unsigned char * buf)
298
int ha_heap::index_next(uchar * buf)
399
300
assert(inited==INDEX);
400
ha_statistic_increment(&system_status_var::ha_read_next_count);
301
ha_statistic_increment(&SSV::ha_read_next_count);
401
302
int error=heap_rnext(file,buf);
402
getTable()->status=error ? STATUS_NOT_FOUND: 0;
303
table->status=error ? STATUS_NOT_FOUND: 0;
406
int ha_heap::index_prev(unsigned char * buf)
307
int ha_heap::index_prev(uchar * buf)
408
309
assert(inited==INDEX);
409
ha_statistic_increment(&system_status_var::ha_read_prev_count);
310
ha_statistic_increment(&SSV::ha_read_prev_count);
410
311
int error=heap_rprev(file,buf);
411
getTable()->status=error ? STATUS_NOT_FOUND: 0;
312
table->status=error ? STATUS_NOT_FOUND: 0;
415
int ha_heap::index_first(unsigned char * buf)
316
int ha_heap::index_first(uchar * buf)
417
318
assert(inited==INDEX);
418
ha_statistic_increment(&system_status_var::ha_read_first_count);
319
ha_statistic_increment(&SSV::ha_read_first_count);
419
320
int error=heap_rfirst(file, buf, active_index);
420
getTable()->status=error ? STATUS_NOT_FOUND: 0;
321
table->status=error ? STATUS_NOT_FOUND: 0;
424
int ha_heap::index_last(unsigned char * buf)
325
int ha_heap::index_last(uchar * buf)
426
327
assert(inited==INDEX);
427
ha_statistic_increment(&system_status_var::ha_read_last_count);
328
ha_statistic_increment(&SSV::ha_read_last_count);
428
329
int error=heap_rlast(file, buf, active_index);
429
getTable()->status=error ? STATUS_NOT_FOUND: 0;
330
table->status=error ? STATUS_NOT_FOUND: 0;
433
int ha_heap::doStartTableScan(bool scan)
334
int ha_heap::rnd_init(bool scan)
435
336
return scan ? heap_scan_init(file) : 0;
438
int ha_heap::rnd_next(unsigned char *buf)
339
int ha_heap::rnd_next(uchar *buf)
440
ha_statistic_increment(&system_status_var::ha_read_rnd_next_count);
341
ha_statistic_increment(&SSV::ha_read_rnd_next_count);
441
342
int error=heap_scan(file, buf);
442
getTable()->status=error ? STATUS_NOT_FOUND: 0;
343
table->status=error ? STATUS_NOT_FOUND: 0;
446
int ha_heap::rnd_pos(unsigned char * buf, unsigned char *pos)
347
int ha_heap::rnd_pos(uchar * buf, uchar *pos)
449
350
HEAP_PTR heap_position;
450
ha_statistic_increment(&system_status_var::ha_read_rnd_count);
351
ha_statistic_increment(&SSV::ha_read_rnd_count);
451
352
memcpy(&heap_position, pos, sizeof(HEAP_PTR));
452
353
error=heap_rrnd(file, buf, heap_position);
453
getTable()->status=error ? STATUS_NOT_FOUND: 0;
354
table->status=error ? STATUS_NOT_FOUND: 0;
457
void ha_heap::position(const unsigned char *)
358
void ha_heap::position(const uchar *record __attribute__((unused)))
459
360
*(HEAP_PTR*) ref= heap_position(file); // Ref is aligned
462
int ha_heap::info(uint32_t flag)
363
int ha_heap::info(uint flag)
464
365
HEAPINFO hp_info;
465
366
(void) heap_info(file,&hp_info,flag);
617
534
return heap_indexes_are_disabled(file);
620
void ha_heap::drop_table(const char *)
622
file->getShare()->delete_on_close= 1;
537
THR_LOCK_DATA **ha_heap::store_lock(THD *thd __attribute__((unused)),
539
enum thr_lock_type lock_type)
541
if (lock_type != TL_IGNORE && file->lock.type == TL_UNLOCK)
542
file->lock.type=lock_type;
548
We have to ignore ENOENT entries as the HEAP table is created on open and
549
not when doing a CREATE on the table.
552
int ha_heap::delete_table(const char *name)
554
int error= heap_delete_table(name);
555
return error == ENOENT ? 0 : error;
559
void ha_heap::drop_table(const char *name __attribute__((unused)))
561
file->s->delete_on_close= 1;
627
int HeapEngine::doRenameTable(Session &session, const TableIdentifier &from, const TableIdentifier &to)
566
int ha_heap::rename_table(const char * from, const char * to)
629
session.getMessageCache().renameTableMessage(from, to);
630
return heap_rename(from.getPath().c_str(), to.getPath().c_str());
568
return heap_rename(from,to);
634
ha_rows ha_heap::records_in_range(uint32_t inx, key_range *min_key,
572
ha_rows ha_heap::records_in_range(uint inx, key_range *min_key,
635
573
key_range *max_key)
637
KeyInfo *key= &getTable()->key_info[inx];
575
KEY *key=table->key_info+inx;
576
if (key->algorithm == HA_KEY_ALG_BTREE)
577
return hp_rb_records_in_range(file, inx, min_key, max_key);
639
579
if (!min_key || !max_key ||
640
580
min_key->length != max_key->length ||
647
587
return stats.records;
649
589
/* Assert that info() did run. We need current statistics here. */
650
assert(key_stat_version == file->getShare()->key_stat_version);
590
assert(key_stat_version == file->s->key_stat_version);
651
591
return key->rec_per_key[key->key_parts-1];
654
int HeapEngine::doCreateTable(Session &session,
656
const TableIdentifier &identifier,
657
message::Table& create_proto)
660
HP_SHARE *internal_share;
661
const char *table_name= identifier.getPath().c_str();
663
error= heap_create_table(&session, table_name, &table_arg,
670
session.getMessageCache().storeTableMessage(identifier, create_proto);
677
int HeapEngine::heap_create_table(Session *session, const char *table_name,
680
message::Table &create_proto,
681
HP_SHARE **internal_share)
683
uint32_t key, parts, mem_per_row_keys= 0;
684
uint32_t keys= table_arg->getShare()->sizeKeys();
685
uint32_t auto_key= 0, auto_key_type= 0;
686
uint32_t max_key_fieldnr = 0, key_part_size = 0, next_field_pos = 0;
687
uint32_t column_count= table_arg->getShare()->sizeFields();
688
std::vector<HP_KEYDEF> keydef;
595
int ha_heap::create(const char *name, Table *table_arg,
596
HA_CREATE_INFO *create_info)
598
uint key, parts, mem_per_row_keys= 0, keys= table_arg->s->keys;
599
uint auto_key= 0, auto_key_type= 0;
600
uint max_key_fieldnr = 0, key_part_size = 0, next_field_pos = 0;
601
uint column_idx, column_count= table_arg->s->fields;
602
HP_COLUMNDEF *columndef;
605
char buff[FN_REFLEN];
607
TABLE_SHARE *share= table_arg->s;
690
608
bool found_real_auto_increment= 0;
693
* We cannot create tables with more rows than UINT32_MAX. This is a
694
* limitation of the HEAP engine. Here, since TableShare::getMaxRows()
695
* can return a number more than that, we trap it here instead of casting
696
* to a truncated integer.
698
uint64_t num_rows= table_arg->getShare()->getMaxRows();
699
if (num_rows > UINT32_MAX)
610
if (!(columndef= (HP_COLUMNDEF*) my_malloc(column_count * sizeof(HP_COLUMNDEF), MYF(MY_WME))))
613
for (column_idx= 0; column_idx < column_count; column_idx++)
615
Field* field= *(table_arg->field + column_idx);
616
HP_COLUMNDEF* column= columndef + column_idx;
617
column->type= (uint16_t)field->type();
618
column->length= field->pack_length();
619
column->offset= field->offset(field->table->record[0]);
623
column->null_bit= field->null_bit;
624
column->null_pos= (uint) (field->null_ptr - (uchar*) table_arg->record[0]);
632
if (field->type() == DRIZZLE_TYPE_VARCHAR)
634
column->length_bytes= (uint8_t)(((Field_varstring*)field)->length_bytes);
638
column->length_bytes= 0;
702
642
for (key= parts= 0; key < keys; key++)
703
643
parts+= table_arg->key_info[key].key_parts;
706
std::vector<HA_KEYSEG> seg_buffer;
707
seg_buffer.resize(parts);
708
HA_KEYSEG *seg= &seg_buffer[0];
645
if (!(keydef= (HP_KEYDEF*) my_malloc(keys * sizeof(HP_KEYDEF) +
646
parts * sizeof(HA_KEYSEG),
649
my_free((void *) columndef, MYF(0));
653
seg= my_reinterpret_cast(HA_KEYSEG*) (keydef + keys);
710
654
for (key= 0; key < keys; key++)
712
KeyInfo *pos= &table_arg->key_info[key];
713
KeyPartInfo *key_part= pos->key_part;
714
KeyPartInfo *key_part_end= key_part + pos->key_parts;
656
KEY *pos= table_arg->key_info+key;
657
KEY_PART_INFO *key_part= pos->key_part;
658
KEY_PART_INFO *key_part_end= key_part + pos->key_parts;
716
660
keydef[key].keysegs= (uint) pos->key_parts;
717
661
keydef[key].flag= (pos->flags & (HA_NOSAME | HA_NULL_ARE_EQUAL));
718
662
keydef[key].seg= seg;
720
mem_per_row_keys+= sizeof(char*) * 2; // = sizeof(HASH_INFO)
664
switch (pos->algorithm) {
665
case HA_KEY_ALG_UNDEF:
666
case HA_KEY_ALG_HASH:
667
keydef[key].algorithm= HA_KEY_ALG_HASH;
668
mem_per_row_keys+= sizeof(char*) * 2; // = sizeof(HASH_INFO)
670
case HA_KEY_ALG_BTREE:
671
keydef[key].algorithm= HA_KEY_ALG_BTREE;
672
mem_per_row_keys+=sizeof(TREE_ELEMENT)+pos->key_length+sizeof(char*);
675
assert(0); // cannot happen
722
678
for (; key_part != key_part_end; key_part++, seg++)
724
680
Field *field= key_part->field;
682
if (pos->algorithm == HA_KEY_ALG_BTREE)
683
seg->type= field->key_type();
727
686
if ((seg->type = field->key_type()) != (int) HA_KEYTYPE_TEXT &&
728
687
seg->type != HA_KEYTYPE_VARTEXT1 &&
770
729
auto_key= key+ 1;
771
730
auto_key_type= field->key_type();
773
if ((uint)field->position() + 1 > max_key_fieldnr)
732
if ((uint)field->field_index + 1 > max_key_fieldnr)
775
734
/* Do not use seg->fieldnr as it's not reliable in case of temp tables */
776
max_key_fieldnr= field->position() + 1;
735
max_key_fieldnr= field->field_index + 1;
781
if (key_part_size < table_arg->getShare()->null_bytes + ((table_arg->getShare()->last_null_bit_pos+7) >> 3))
740
if (key_part_size < share->null_bytes + ((share->last_null_bit_pos+7) >> 3))
783
742
/* Make sure to include null fields regardless of the presense of keys */
784
key_part_size = table_arg->getShare()->null_bytes + ((table_arg->getShare()->last_null_bit_pos+7) >> 3);
743
key_part_size = share->null_bytes + ((share->last_null_bit_pos+7) >> 3);
789
748
if (table_arg->found_next_number_field)
791
keydef[table_arg->getShare()->next_number_index].flag|= HA_AUTO_KEY;
792
found_real_auto_increment= table_arg->getShare()->next_number_key_offset == 0;
750
keydef[share->next_number_index].flag|= HA_AUTO_KEY;
751
found_real_auto_increment= share->next_number_key_offset == 0;
794
753
HP_CREATE_INFO hp_create_info;
795
754
hp_create_info.auto_key= auto_key;
796
755
hp_create_info.auto_key_type= auto_key_type;
797
hp_create_info.auto_increment= (create_proto.options().has_auto_increment_value() ?
798
create_proto.options().auto_increment_value() - 1 : 0);
799
hp_create_info.max_table_size=session->variables.max_heap_table_size;
756
hp_create_info.auto_increment= (create_info->auto_increment_value ?
757
create_info->auto_increment_value - 1 : 0);
758
hp_create_info.max_table_size=current_thd->variables.max_heap_table_size;
800
759
hp_create_info.with_auto_increment= found_real_auto_increment;
801
760
hp_create_info.internal_table= internal_table;
802
hp_create_info.max_chunk_size= table_arg->getShare()->block_size;
804
error= heap_create(table_name,
808
table_arg->getShare()->getRecordLength(), mem_per_row_keys,
809
static_cast<uint32_t>(num_rows), /* We check for overflow above, so cast is fine here. */
811
&hp_create_info, internal_share);
761
hp_create_info.max_chunk_size= share->block_size;
762
hp_create_info.is_dynamic= (share->row_type == ROW_TYPE_DYNAMIC);
763
error= heap_create(fn_format(buff,name,"","",
764
MY_REPLACE_EXT|MY_UNPACK_FILENAME),
766
column_count, columndef,
767
max_key_fieldnr, key_part_size,
768
share->reclength, mem_per_row_keys,
769
(uint32_t) share->max_rows, (uint32_t) share->min_rows,
770
&hp_create_info, &internal_share);
772
my_free((uchar*) keydef, MYF(0));
773
my_free((void *) columndef, MYF(0));
817
void ha_heap::get_auto_increment(uint64_t, uint64_t, uint64_t,
779
void ha_heap::update_create_info(HA_CREATE_INFO *create_info)
781
table->file->info(HA_STATUS_AUTO);
782
if (!(create_info->used_fields & HA_CREATE_USED_AUTO))
783
create_info->auto_increment_value= stats.auto_increment_value;
784
if (!(create_info->used_fields & HA_CREATE_USED_BLOCK_SIZE))
786
if (file->s->recordspace.is_variable_size)
787
create_info->block_size= file->s->recordspace.chunk_length;
789
create_info->block_size= 0;
793
void ha_heap::get_auto_increment(uint64_t offset __attribute__((unused)),
794
uint64_t increment __attribute__((unused)),
795
uint64_t nb_desired_values __attribute__((unused)),
818
796
uint64_t *first_value,
819
797
uint64_t *nb_reserved_values)