589
589
next_insert_id= 0;
592
void Cursor::drop_table(const char *)
592
void Cursor::drop_table()
599
Performs checks upon the table.
601
@param session thread doing CHECK Table operation
604
HA_ADMIN_OK Successful upgrade
606
HA_ADMIN_NEEDS_UPGRADE Table has structures requiring upgrade
608
HA_ADMIN_NEEDS_ALTER Table has structures requiring ALTER Table
610
HA_ADMIN_NOT_IMPLEMENTED
612
int Cursor::ha_check(Session *)
597
int Cursor::ha_check(Session*)
614
599
return HA_ADMIN_OK;
757
740
@sa Cursor::drop_table()
761
Cursor::closeMarkForDelete(const char *name)
743
void Cursor::closeMarkForDelete()
763
745
setTransactionReadWrite();
765
return drop_table(name);
768
749
int Cursor::index_next_same(unsigned char *buf, const unsigned char *key, uint32_t keylen)
771
if (!(error=index_next(buf)))
773
ptrdiff_t ptrdiff= buf - getTable()->getInsertRecord();
774
unsigned char *save_record_0= NULL;
775
KeyInfo *key_info= NULL;
776
KeyPartInfo *key_part;
777
KeyPartInfo *key_part_end= NULL;
780
key_cmp_if_same() compares table->getInsertRecord() against 'key'.
781
In parts it uses table->getInsertRecord() directly, in parts it uses
782
field objects with their local pointers into table->getInsertRecord().
783
If 'buf' is distinct from table->getInsertRecord(), we need to move
784
all record references. This is table->getInsertRecord() itself and
785
the field pointers of the fields used in this key.
789
save_record_0= getTable()->getInsertRecord();
790
getTable()->record[0]= buf;
791
key_info= getTable()->key_info + active_index;
792
key_part= key_info->key_part;
793
key_part_end= key_part + key_info->key_parts;
794
for (; key_part < key_part_end; key_part++)
796
assert(key_part->field);
797
key_part->field->move_field_offset(ptrdiff);
801
if (key_cmp_if_same(getTable(), key, active_index, keylen))
803
getTable()->status=STATUS_NOT_FOUND;
804
error=HA_ERR_END_OF_FILE;
807
/* Move back if necessary. */
810
getTable()->record[0]= save_record_0;
811
for (key_part= key_info->key_part; key_part < key_part_end; key_part++)
812
key_part->field->move_field_offset(-ptrdiff);
751
int error= index_next(buf);
755
ptrdiff_t ptrdiff= buf - getTable()->getInsertRecord();
756
unsigned char *save_record_0= NULL;
757
KeyInfo *key_info= NULL;
758
KeyPartInfo *key_part;
759
KeyPartInfo *key_part_end= NULL;
762
key_cmp_if_same() compares table->getInsertRecord() against 'key'.
763
In parts it uses table->getInsertRecord() directly, in parts it uses
764
field objects with their local pointers into table->getInsertRecord().
765
If 'buf' is distinct from table->getInsertRecord(), we need to move
766
all record references. This is table->getInsertRecord() itself and
767
the field pointers of the fields used in this key.
771
save_record_0= getTable()->getInsertRecord();
772
getTable()->record[0]= buf;
773
key_info= getTable()->key_info + active_index;
774
key_part= key_info->key_part;
775
key_part_end= key_part + key_info->key_parts;
776
for (; key_part < key_part_end; key_part++)
778
assert(key_part->field);
779
key_part->field->move_field_offset(ptrdiff);
783
if (key_cmp_if_same(getTable(), key, active_index, keylen))
785
getTable()->status=STATUS_NOT_FOUND;
786
error= HA_ERR_END_OF_FILE;
789
/* Move back if necessary. */
792
getTable()->record[0]= save_record_0;
793
for (key_part= key_info->key_part; key_part < key_part_end; key_part++)
794
key_part->field->move_field_offset(-ptrdiff);