Fix for #2237 and #2490 (analyze and check for RTree keys)

Now checking of the RTree keys works without errors.
Worklog entry about appropriate checkup's routine for the RTree added


myisam/mi_check.c:
  HA_SPATIAL checks added
mysql-test/r/gis-rtree.result:
  Appropriate test resutl
mysql-test/t/gis-rtree.test:
  test case
This commit is contained in:
unknown 2004-02-19 17:22:38 +04:00
commit 3804200122
3 changed files with 82 additions and 2 deletions

View file

@ -409,7 +409,7 @@ int chk_key(MI_CHECK *param, register MI_INFO *info)
if (chk_index(param,info,keyinfo,share->state.key_root[key],info->buff,
&keys, param->key_crc+key,1))
DBUG_RETURN(-1);
if(!(keyinfo->flag & HA_FULLTEXT))
if(!(keyinfo->flag & (HA_FULLTEXT | HA_SPATIAL)))
{
if (keys != info->state->records)
{
@ -558,6 +558,10 @@ static int chk_index(MI_CHECK *param, MI_INFO *info, MI_KEYDEF *keyinfo,
DBUG_ENTER("chk_index");
DBUG_DUMP("buff",(byte*) buff,mi_getint(buff));
/* TODO: implement appropriate check for RTree keys */
if (keyinfo->flag & HA_SPATIAL)
DBUG_RETURN(0);
if (!(temp_buff=(uchar*) my_alloca((uint) keyinfo->block_length)))
{
mi_check_print_error(param,"Not enough memory for keyblock");
@ -1073,7 +1077,7 @@ int chk_data_link(MI_CHECK *param, MI_INFO *info,int extend)
for (key=0 ; key < info->s->base.keys; key++)
{
if (key_checksum[key] != param->key_crc[key] &&
!(info->s->keyinfo[key].flag & HA_FULLTEXT))
!(info->s->keyinfo[key].flag & (HA_FULLTEXT | HA_SPATIAL)))
{
mi_check_print_error(param,"Checksum for key: %2d doesn't match checksum for records",
key+1);