summaryrefslogtreecommitdiff
path: root/storage
diff options
context:
space:
mode:
authorunknown <Justin.He/justin.he@dev3-240.dev.cn.tlan>2007-03-16 11:02:57 +0800
committerunknown <Justin.He/justin.he@dev3-240.dev.cn.tlan>2007-03-16 11:02:57 +0800
commit7e3da9802b043ece1f216d32f95a8c96f2118321 (patch)
tree3d3bc40e0c80becf46e4fbcbbd60d736b00abe16 /storage
parent1c640642438702960a8770796b8cd5a235e26580 (diff)
parent917cec7195276c0b8043d40e97b2ff8d250d8ca0 (diff)
downloadmariadb-git-7e3da9802b043ece1f216d32f95a8c96f2118321.tar.gz
Merge dev3-240.dev.cn.tlan:/home/justin.he/mysql/mysql-5.1/mysql-5.1
into dev3-240.dev.cn.tlan:/home/justin.he/mysql/mysql-5.1/mysql-5.1-new-ndb-merge storage/ndb/src/ndbapi/NdbBlob.cpp: Auto merged storage/ndb/test/ndbapi/testBlobs.cpp: Auto merged
Diffstat (limited to 'storage')
-rw-r--r--storage/heap/ha_heap.cc7
-rw-r--r--storage/myisam/ha_myisam.cc37
-rw-r--r--storage/myisam/mi_create.c4
-rw-r--r--storage/myisam/mi_extra.c10
-rw-r--r--storage/myisam/mi_open.c28
-rw-r--r--storage/myisam/rt_index.c106
-rw-r--r--storage/myisam/rt_key.c17
-rw-r--r--storage/myisam/rt_split.c7
-rw-r--r--storage/myisammrg/ha_myisammrg.h4
9 files changed, 156 insertions, 64 deletions
diff --git a/storage/heap/ha_heap.cc b/storage/heap/ha_heap.cc
index cf11c9923eb..f2caa7e6d18 100644
--- a/storage/heap/ha_heap.cc
+++ b/storage/heap/ha_heap.cc
@@ -703,9 +703,10 @@ bool ha_heap::check_if_incompatible_data(HA_CREATE_INFO *info,
uint table_changes)
{
/* Check that auto_increment value was not changed */
- if ((table_changes != IS_EQUAL_YES &&
- info->used_fields & HA_CREATE_USED_AUTO) &&
- info->auto_increment_value != 0)
+ if ((info->used_fields & HA_CREATE_USED_AUTO &&
+ info->auto_increment_value != 0) ||
+ table_changes == IS_EQUAL_NO ||
+ table_changes & IS_EQUAL_PACK_LENGTH) // Not implemented yet
return COMPATIBLE_DATA_NO;
return COMPATIBLE_DATA_YES;
}
diff --git a/storage/myisam/ha_myisam.cc b/storage/myisam/ha_myisam.cc
index 06ec5c4b44e..a67d62f7447 100644
--- a/storage/myisam/ha_myisam.cc
+++ b/storage/myisam/ha_myisam.cc
@@ -320,6 +320,12 @@ int table2myisam(TABLE *table_arg, MI_KEYDEF **keydef_out,
RETURN VALUE
0 - Equal definitions.
1 - Different definitions.
+
+ TODO
+ - compare FULLTEXT keys;
+ - compare SPATIAL keys;
+ - compare FIELD_SKIP_ZERO which is converted to FIELD_NORMAL correctly
+ (should be corretly detected in table2myisam).
*/
int check_definition(MI_KEYDEF *t1_keyinfo, MI_COLUMNDEF *t1_recinfo,
@@ -345,6 +351,28 @@ int check_definition(MI_KEYDEF *t1_keyinfo, MI_COLUMNDEF *t1_recinfo,
{
HA_KEYSEG *t1_keysegs= t1_keyinfo[i].seg;
HA_KEYSEG *t2_keysegs= t2_keyinfo[i].seg;
+ if (t1_keyinfo[i].flag & HA_FULLTEXT && t2_keyinfo[i].flag & HA_FULLTEXT)
+ continue;
+ else if (t1_keyinfo[i].flag & HA_FULLTEXT ||
+ t2_keyinfo[i].flag & HA_FULLTEXT)
+ {
+ DBUG_PRINT("error", ("Key %d has different definition", i));
+ DBUG_PRINT("error", ("t1_fulltext= %d, t2_fulltext=%d",
+ test(t1_keyinfo[i].flag & HA_FULLTEXT),
+ test(t2_keyinfo[i].flag & HA_FULLTEXT)));
+ DBUG_RETURN(1);
+ }
+ if (t1_keyinfo[i].flag & HA_SPATIAL && t2_keyinfo[i].flag & HA_SPATIAL)
+ continue;
+ else if (t1_keyinfo[i].flag & HA_SPATIAL ||
+ t2_keyinfo[i].flag & HA_SPATIAL)
+ {
+ DBUG_PRINT("error", ("Key %d has different definition", i));
+ DBUG_PRINT("error", ("t1_spatial= %d, t2_spatial=%d",
+ test(t1_keyinfo[i].flag & HA_SPATIAL),
+ test(t2_keyinfo[i].flag & HA_SPATIAL)));
+ DBUG_RETURN(1);
+ }
if (t1_keyinfo[i].keysegs != t2_keyinfo[i].keysegs ||
t1_keyinfo[i].key_alg != t2_keyinfo[i].key_alg)
{
@@ -381,7 +409,14 @@ int check_definition(MI_KEYDEF *t1_keyinfo, MI_COLUMNDEF *t1_recinfo,
{
MI_COLUMNDEF *t1_rec= &t1_recinfo[i];
MI_COLUMNDEF *t2_rec= &t2_recinfo[i];
- if (t1_rec->type != t2_rec->type ||
+ /*
+ FIELD_SKIP_ZERO can be changed to FIELD_NORMAL in mi_create,
+ see NOTE1 in mi_create.c
+ */
+ if ((t1_rec->type != t2_rec->type &&
+ !(t1_rec->type == (int) FIELD_SKIP_ZERO &&
+ t1_rec->length == 1 &&
+ t2_rec->type == (int) FIELD_NORMAL)) ||
t1_rec->length != t2_rec->length ||
t1_rec->null_bit != t2_rec->null_bit)
{
diff --git a/storage/myisam/mi_create.c b/storage/myisam/mi_create.c
index 2b8cbcc7da5..5dd4a98127e 100644
--- a/storage/myisam/mi_create.c
+++ b/storage/myisam/mi_create.c
@@ -158,6 +158,10 @@ int mi_create(const char *name,uint keys,MI_KEYDEF *keydefs,
rec--;
if (rec->type == (int) FIELD_SKIP_ZERO && rec->length == 1)
{
+ /*
+ NOTE1: here we change a field type FIELD_SKIP_ZERO ->
+ FIELD_NORMAL
+ */
rec->type=(int) FIELD_NORMAL;
packed--;
min_pack_length++;
diff --git a/storage/myisam/mi_extra.c b/storage/myisam/mi_extra.c
index ae584b06173..729174b6f88 100644
--- a/storage/myisam/mi_extra.c
+++ b/storage/myisam/mi_extra.c
@@ -350,11 +350,13 @@ int mi_extra(MI_INFO *info, enum ha_extra_function function, void *extra_arg)
#ifdef HAVE_MMAP
pthread_mutex_lock(&share->intern_lock);
/*
- Memory map the data file if it is not already mapped and if there
- are no other threads using this table. intern_lock prevents other
- threads from starting to use the table while we are mapping it.
+ Memory map the data file if it is not already mapped. It is safe
+ to memory map a file while other threads are using file I/O on it.
+ Assigning a new address to a function pointer is an atomic
+ operation. intern_lock prevents that two or more mappings are done
+ at the same time.
*/
- if (!share->file_map && (share->tot_locks == 1))
+ if (!share->file_map)
{
if (mi_dynmap_file(info, share->state.state.data_file_length))
{
diff --git a/storage/myisam/mi_open.c b/storage/myisam/mi_open.c
index 5db5bc561d1..f4e089b6313 100644
--- a/storage/myisam/mi_open.c
+++ b/storage/myisam/mi_open.c
@@ -506,24 +506,6 @@ MI_INFO *mi_open(const char *name, int mode, uint open_flags)
share->data_file_type = DYNAMIC_RECORD;
my_afree((gptr) disk_cache);
mi_setup_functions(share);
-#ifdef HAVE_MMAP
- if (open_flags & HA_OPEN_MMAP)
- {
- info.s= share;
- if (mi_dynmap_file(&info, share->state.state.data_file_length))
- {
- /* purecov: begin inspected */
- /* Ignore if mmap fails. Use file I/O instead. */
- DBUG_PRINT("warning", ("mmap failed: errno: %d", errno));
- /* purecov: end */
- }
- else
- {
- share->file_read= mi_mmap_pread;
- share->file_write= mi_mmap_pwrite;
- }
- }
-#endif /* HAVE_MMAP */
share->is_log_table= FALSE;
#ifdef THREAD
thr_lock_init(&share->lock);
@@ -554,6 +536,14 @@ MI_INFO *mi_open(const char *name, int mode, uint open_flags)
}
}
#endif
+ /*
+ Memory mapping can only be requested after initializing intern_lock.
+ */
+ if (open_flags & HA_OPEN_MMAP)
+ {
+ info.s= share;
+ mi_extra(&info, HA_EXTRA_MMAP, 0);
+ }
}
else
{
@@ -1235,7 +1225,7 @@ int mi_open_datafile(MI_INFO *info, MYISAM_SHARE *share, File file_to_dup __attr
int mi_open_keyfile(MYISAM_SHARE *share)
{
if ((share->kfile=my_open(share->unique_file_name, share->mode | O_SHARE,
- MYF(MY_WME))) < 0)
+ MYF(MY_WME))) < 0)
return 1;
return 0;
}
diff --git a/storage/myisam/rt_index.c b/storage/myisam/rt_index.c
index edb33ec10b9..cf144839dd1 100644
--- a/storage/myisam/rt_index.c
+++ b/storage/myisam/rt_index.c
@@ -184,6 +184,7 @@ int rtree_find_first(MI_INFO *info, uint keynr, uchar *key, uint key_length,
/*
Save searched key, include data pointer.
The data pointer is required if the search_flag contains MBR_DATA.
+ (minimum bounding rectangle)
*/
memcpy(info->first_mbr_key, key, keyinfo->keylength);
info->last_rkey_length = key_length;
@@ -538,16 +539,19 @@ static int rtree_insert_req(MI_INFO *info, MI_KEYDEF *keyinfo, uchar *key,
uint nod_flag;
uchar *page_buf;
int res;
+ DBUG_ENTER("rtree_insert_req");
if (!(page_buf = (uchar*)my_alloca((uint)keyinfo->block_length +
MI_MAX_KEY_BUFF)))
{
my_errno = HA_ERR_OUT_OF_MEM;
- return -1;
+ DBUG_RETURN(-1); /* purecov: inspected */
}
if (!_mi_fetch_keypage(info, keyinfo, page, DFLT_INIT_HITS, page_buf, 0))
goto err1;
nod_flag = mi_test_if_nod(page_buf);
+ DBUG_PRINT("rtree", ("page: %lu level: %d ins_level: %d nod_flag: %u",
+ (ulong) page, level, ins_level, nod_flag));
if ((ins_level == -1 && nod_flag) || /* key: go down to leaf */
(ins_level > -1 && ins_level > level)) /* branch: go down to ins_level */
@@ -599,11 +603,11 @@ static int rtree_insert_req(MI_INFO *info, MI_KEYDEF *keyinfo, uchar *key,
ok:
my_afree((byte*)page_buf);
- return res;
+ DBUG_RETURN(res);
err1:
my_afree((byte*)page_buf);
- return -1;
+ DBUG_RETURN(-1); /* purecov: inspected */
}
@@ -623,18 +627,19 @@ static int rtree_insert_level(MI_INFO *info, uint keynr, uchar *key,
MI_KEYDEF *keyinfo = info->s->keyinfo + keynr;
int res;
my_off_t new_page;
-
+ DBUG_ENTER("rtree_insert_level");
+
if ((old_root = info->s->state.key_root[keynr]) == HA_OFFSET_ERROR)
{
if ((old_root = _mi_new(info, keyinfo, DFLT_INIT_HITS)) == HA_OFFSET_ERROR)
- return -1;
+ DBUG_RETURN(-1);
info->buff_used = 1;
mi_putint(info->buff, 2, 0);
res = rtree_add_key(info, keyinfo, key, key_length, info->buff, NULL);
if (_mi_write_keypage(info, keyinfo, old_root, DFLT_INIT_HITS, info->buff))
- return 1;
+ DBUG_RETURN(1);
info->s->state.key_root[keynr] = old_root;
- return res;
+ DBUG_RETURN(res);
}
switch ((res = rtree_insert_req(info, keyinfo, key, key_length,
@@ -651,11 +656,12 @@ static int rtree_insert_level(MI_INFO *info, uint keynr, uchar *key,
uchar *new_key;
uint nod_flag = info->s->base.key_reflength;
+ DBUG_PRINT("rtree", ("root was split, grow a new root"));
if (!(new_root_buf = (uchar*)my_alloca((uint)keyinfo->block_length +
MI_MAX_KEY_BUFF)))
{
my_errno = HA_ERR_OUT_OF_MEM;
- return -1;
+ DBUG_RETURN(-1); /* purecov: inspected */
}
mi_putint(new_root_buf, 2, nod_flag);
@@ -681,12 +687,14 @@ static int rtree_insert_level(MI_INFO *info, uint keynr, uchar *key,
DFLT_INIT_HITS, new_root_buf))
goto err1;
info->s->state.key_root[keynr] = new_root;
+ DBUG_PRINT("rtree", ("new root page: %lu level: %d nod_flag: %u",
+ (ulong) new_root, 0, mi_test_if_nod(new_root_buf)));
my_afree((byte*)new_root_buf);
break;
err1:
my_afree((byte*)new_root_buf);
- return -1;
+ DBUG_RETURN(-1); /* purecov: inspected */
}
default:
case -1: /* error */
@@ -694,7 +702,7 @@ err1:
break;
}
}
- return res;
+ DBUG_RETURN(res);
}
@@ -708,8 +716,10 @@ err1:
int rtree_insert(MI_INFO *info, uint keynr, uchar *key, uint key_length)
{
- return (!key_length ||
- (rtree_insert_level(info, keynr, key, key_length, -1) == -1)) ? -1 : 0;
+ DBUG_ENTER("rtree_insert");
+ DBUG_RETURN((!key_length ||
+ (rtree_insert_level(info, keynr, key, key_length, -1) == -1)) ?
+ -1 : 0);
}
@@ -724,6 +734,8 @@ int rtree_insert(MI_INFO *info, uint keynr, uchar *key, uint key_length)
static int rtree_fill_reinsert_list(stPageList *ReinsertList, my_off_t page,
int level)
{
+ DBUG_ENTER("rtree_fill_reinsert_list");
+ DBUG_PRINT("rtree", ("page: %lu level: %d", (ulong) page, level));
if (ReinsertList->n_pages == ReinsertList->m_pages)
{
ReinsertList->m_pages += REINSERT_BUFFER_INC;
@@ -735,10 +747,10 @@ static int rtree_fill_reinsert_list(stPageList *ReinsertList, my_off_t page,
ReinsertList->pages[ReinsertList->n_pages].offs = page;
ReinsertList->pages[ReinsertList->n_pages].level = level;
ReinsertList->n_pages++;
- return 0;
+ DBUG_RETURN(0);
err1:
- return -1;
+ DBUG_RETURN(-1); /* purecov: inspected */
}
@@ -762,15 +774,18 @@ static int rtree_delete_req(MI_INFO *info, MI_KEYDEF *keyinfo, uchar *key,
uint nod_flag;
uchar *page_buf;
int res;
+ DBUG_ENTER("rtree_delete_req");
if (!(page_buf = (uchar*)my_alloca((uint)keyinfo->block_length)))
{
my_errno = HA_ERR_OUT_OF_MEM;
- return -1;
+ DBUG_RETURN(-1); /* purecov: inspected */
}
if (!_mi_fetch_keypage(info, keyinfo, page, DFLT_INIT_HITS, page_buf, 0))
goto err1;
nod_flag = mi_test_if_nod(page_buf);
+ DBUG_PRINT("rtree", ("page: %lu level: %d nod_flag: %u",
+ (ulong) page, level, nod_flag));
k = rt_PAGE_FIRST_KEY(page_buf, nod_flag);
last = rt_PAGE_END(page_buf);
@@ -791,6 +806,7 @@ static int rtree_delete_req(MI_INFO *info, MI_KEYDEF *keyinfo, uchar *key,
if (*page_size + key_length >= rt_PAGE_MIN_SIZE(keyinfo->block_length))
{
/* OK */
+ /* Calculate a new key value (MBR) for the shrinked block. */
if (rtree_set_key_mbr(info, keyinfo, k, key_length,
_mi_kpos(nod_flag, k)))
goto err1;
@@ -800,10 +816,23 @@ static int rtree_delete_req(MI_INFO *info, MI_KEYDEF *keyinfo, uchar *key,
}
else
{
- /* too small: delete key & add it descendant to reinsert list */
+ /*
+ Too small: delete key & add it descendant to reinsert list.
+ Store position and level of the block so that it can be
+ accessed later for inserting the remaining keys.
+ */
+ DBUG_PRINT("rtree", ("too small. move block to reinsert list"));
if (rtree_fill_reinsert_list(ReinsertList, _mi_kpos(nod_flag, k),
level + 1))
goto err1;
+ /*
+ Delete the key that references the block. This makes the
+ block disappear from the index. Hence we need to insert
+ its remaining keys later. Note: if the block is a branch
+ block, we do not only remove this block, but the whole
+ subtree. So we need to re-insert its keys on the same
+ level later to reintegrate the subtrees.
+ */
rtree_delete_key(info, page_buf, k, key_length, nod_flag);
if (_mi_write_keypage(info, keyinfo, page,
DFLT_INIT_HITS, page_buf))
@@ -863,11 +892,11 @@ static int rtree_delete_req(MI_INFO *info, MI_KEYDEF *keyinfo, uchar *key,
ok:
my_afree((byte*)page_buf);
- return res;
+ DBUG_RETURN(res);
err1:
my_afree((byte*)page_buf);
- return -1;
+ DBUG_RETURN(-1); /* purecov: inspected */
}
@@ -885,12 +914,15 @@ int rtree_delete(MI_INFO *info, uint keynr, uchar *key, uint key_length)
stPageList ReinsertList;
my_off_t old_root;
MI_KEYDEF *keyinfo = info->s->keyinfo + keynr;
+ DBUG_ENTER("rtree_delete");
if ((old_root = info->s->state.key_root[keynr]) == HA_OFFSET_ERROR)
{
my_errno= HA_ERR_END_OF_FILE;
- return -1;
+ DBUG_RETURN(-1); /* purecov: inspected */
}
+ DBUG_PRINT("rtree", ("starting deletion at root page: %lu",
+ (ulong) old_root));
ReinsertList.pages = NULL;
ReinsertList.n_pages = 0;
@@ -899,12 +931,12 @@ int rtree_delete(MI_INFO *info, uint keynr, uchar *key, uint key_length)
switch (rtree_delete_req(info, keyinfo, key, key_length, old_root,
&page_size, &ReinsertList, 0))
{
- case 2:
+ case 2: /* empty */
{
info->s->state.key_root[keynr] = HA_OFFSET_ERROR;
- return 0;
+ DBUG_RETURN(0);
}
- case 0:
+ case 0: /* deleted */
{
uint nod_flag;
ulong i;
@@ -923,16 +955,34 @@ int rtree_delete(MI_INFO *info, uint keynr, uchar *key, uint key_length)
DFLT_INIT_HITS, page_buf, 0))
goto err1;
nod_flag = mi_test_if_nod(page_buf);
+ DBUG_PRINT("rtree", ("reinserting keys from "
+ "page: %lu level: %d nod_flag: %u",
+ (ulong) ReinsertList.pages[i].offs,
+ ReinsertList.pages[i].level, nod_flag));
+
k = rt_PAGE_FIRST_KEY(page_buf, nod_flag);
last = rt_PAGE_END(page_buf);
for (; k < last; k = rt_PAGE_NEXT_KEY(k, key_length, nod_flag))
{
- if (rtree_insert_level(info, keynr, k, key_length,
- ReinsertList.pages[i].level) == -1)
+ int res;
+ if ((res= rtree_insert_level(info, keynr, k, key_length,
+ ReinsertList.pages[i].level)) == -1)
{
my_afree((byte*)page_buf);
goto err1;
}
+ if (res)
+ {
+ ulong j;
+ DBUG_PRINT("rtree", ("root has been split, adjust levels"));
+ for (j= i; j < ReinsertList.n_pages; j++)
+ {
+ ReinsertList.pages[j].level++;
+ DBUG_PRINT("rtree", ("keys from page: %lu now level: %d",
+ (ulong) ReinsertList.pages[i].offs,
+ ReinsertList.pages[i].level));
+ }
+ }
}
my_afree((byte*)page_buf);
if (_mi_dispose(info, keyinfo, ReinsertList.pages[i].offs,
@@ -959,20 +1009,20 @@ int rtree_delete(MI_INFO *info, uint keynr, uchar *key, uint key_length)
info->s->state.key_root[keynr] = new_root;
}
info->update= HA_STATE_DELETED;
- return 0;
+ DBUG_RETURN(0);
err1:
- return -1;
+ DBUG_RETURN(-1); /* purecov: inspected */
}
case 1: /* not found */
{
my_errno = HA_ERR_KEY_NOT_FOUND;
- return -1;
+ DBUG_RETURN(-1); /* purecov: inspected */
}
default:
case -1: /* error */
{
- return -1;
+ DBUG_RETURN(-1); /* purecov: inspected */
}
}
}
diff --git a/storage/myisam/rt_key.c b/storage/myisam/rt_key.c
index cb6a82c51f6..fe59af3c605 100644
--- a/storage/myisam/rt_key.c
+++ b/storage/myisam/rt_key.c
@@ -34,6 +34,7 @@ int rtree_add_key(MI_INFO *info, MI_KEYDEF *keyinfo, uchar *key,
{
uint page_size = mi_getint(page_buf);
uint nod_flag = mi_test_if_nod(page_buf);
+ DBUG_ENTER("rtree_add_key");
if (page_size + key_length + info->s->base.rec_reflength <=
keyinfo->block_length)
@@ -42,22 +43,26 @@ int rtree_add_key(MI_INFO *info, MI_KEYDEF *keyinfo, uchar *key,
if (nod_flag)
{
/* save key */
+ DBUG_ASSERT(_mi_kpos(nod_flag, key) < info->state->key_file_length);
memcpy(rt_PAGE_END(page_buf), key - nod_flag, key_length + nod_flag);
page_size += key_length + nod_flag;
}
else
{
/* save key */
+ DBUG_ASSERT(_mi_dpos(info, nod_flag, key + key_length +
+ info->s->base.rec_reflength) <
+ info->state->data_file_length + info->s->base.pack_reclength);
memcpy(rt_PAGE_END(page_buf), key, key_length +
info->s->base.rec_reflength);
page_size += key_length + info->s->base.rec_reflength;
}
mi_putint(page_buf, page_size, nod_flag);
- return 0;
+ DBUG_RETURN(0);
}
- return (rtree_split_page(info, keyinfo, page_buf, key, key_length,
- new_page) ? -1 : 1);
+ DBUG_RETURN((rtree_split_page(info, keyinfo, page_buf, key, key_length,
+ new_page) ? -1 : 1));
}
/*
@@ -89,11 +94,13 @@ int rtree_delete_key(MI_INFO *info, uchar *page_buf, uchar *key,
int rtree_set_key_mbr(MI_INFO *info, MI_KEYDEF *keyinfo, uchar *key,
uint key_length, my_off_t child_page)
{
+ DBUG_ENTER("rtree_set_key_mbr");
+
if (!_mi_fetch_keypage(info, keyinfo, child_page,
DFLT_INIT_HITS, info->buff, 0))
- return -1;
+ DBUG_RETURN(-1); /* purecov: inspected */
- return rtree_page_mbr(info, keyinfo->seg, info->buff, key, key_length);
+ DBUG_RETURN(rtree_page_mbr(info, keyinfo->seg, info->buff, key, key_length));
}
#endif /*HAVE_RTREE_KEYS*/
diff --git a/storage/myisam/rt_split.c b/storage/myisam/rt_split.c
index 9f25ee608d8..0f6dc872958 100644
--- a/storage/myisam/rt_split.c
+++ b/storage/myisam/rt_split.c
@@ -264,13 +264,15 @@ int rtree_split_page(MI_INFO *info, MI_KEYDEF *keyinfo, uchar *page, uchar *key,
uint full_length= key_length + (nod_flag ? nod_flag :
info->s->base.rec_reflength);
int max_keys= (mi_getint(page)-2) / (full_length);
+ DBUG_ENTER("rtree_split_page");
+ DBUG_PRINT("rtree", ("splitting block"));
n_dim = keyinfo->keysegs / 2;
if (!(coord_buf= (double*) my_alloca(n_dim * 2 * sizeof(double) *
(max_keys + 1 + 4) +
sizeof(SplitStruct) * (max_keys + 1))))
- return -1;
+ DBUG_RETURN(-1); /* purecov: inspected */
task= (SplitStruct *)(coord_buf + n_dim * 2 * (max_keys + 1 + 4));
@@ -341,12 +343,13 @@ int rtree_split_page(MI_INFO *info, MI_KEYDEF *keyinfo, uchar *page, uchar *key,
else
err_code= _mi_write_keypage(info, keyinfo, *new_page_offs,
DFLT_INIT_HITS, new_page);
+ DBUG_PRINT("rtree", ("split new block: %lu", (ulong) *new_page_offs));
my_afree((byte*)new_page);
split_err:
my_afree((byte*) coord_buf);
- return err_code;
+ DBUG_RETURN(err_code);
}
#endif /*HAVE_RTREE_KEYS*/
diff --git a/storage/myisammrg/ha_myisammrg.h b/storage/myisammrg/ha_myisammrg.h
index ffa55673ad1..04379f6cf70 100644
--- a/storage/myisammrg/ha_myisammrg.h
+++ b/storage/myisammrg/ha_myisammrg.h
@@ -36,8 +36,8 @@ class ha_myisammrg: public handler
{
return (HA_REC_NOT_IN_SEQ | HA_AUTO_PART_KEY | HA_NO_TRANSACTIONS |
HA_NULL_IN_KEY | HA_CAN_INDEX_BLOBS | HA_FILE_BASED |
- HA_CAN_INSERT_DELAYED | HA_ANY_INDEX_MAY_BE_UNIQUE |
- HA_CAN_BIT_FIELD | HA_NO_COPY_ON_ALTER);
+ HA_ANY_INDEX_MAY_BE_UNIQUE | HA_CAN_BIT_FIELD |
+ HA_NO_COPY_ON_ALTER);
}
ulong index_flags(uint inx, uint part, bool all_parts) const
{