mirror of
https://github.com/MariaDB/server.git
synced 2025-07-30 16:24:05 +03:00
Fix for bug #9465 (check table extended fails with SPATIAL)
myisam/mi_check.c: different search function is used for SPATIAL keys mysql-test/r/gis-rtree.result: test result fixed mysql-test/t/gis-rtree.test: test case
This commit is contained in:
@ -1035,7 +1035,7 @@ int chk_data_link(MI_CHECK *param, MI_INFO *info,int extend)
|
|||||||
{
|
{
|
||||||
if ((((ulonglong) 1 << key) & info->s->state.key_map))
|
if ((((ulonglong) 1 << key) & info->s->state.key_map))
|
||||||
{
|
{
|
||||||
if(!(keyinfo->flag & HA_FULLTEXT))
|
if(!(keyinfo->flag & HA_FULLTEXT))
|
||||||
{
|
{
|
||||||
uint key_length=_mi_make_key(info,key,info->lastkey,record,
|
uint key_length=_mi_make_key(info,key,info->lastkey,record,
|
||||||
start_recpos);
|
start_recpos);
|
||||||
@ -1044,14 +1044,18 @@ int chk_data_link(MI_CHECK *param, MI_INFO *info,int extend)
|
|||||||
/* We don't need to lock the key tree here as we don't allow
|
/* We don't need to lock the key tree here as we don't allow
|
||||||
concurrent threads when running myisamchk
|
concurrent threads when running myisamchk
|
||||||
*/
|
*/
|
||||||
if (_mi_search(info,keyinfo,info->lastkey,key_length,
|
int search_result= (keyinfo->flag & HA_SPATIAL) ?
|
||||||
SEARCH_SAME, info->s->state.key_root[key]))
|
rtree_find_first(info, key, info->lastkey, key_length,
|
||||||
{
|
SEARCH_SAME) :
|
||||||
mi_check_print_error(param,"Record at: %10s Can't find key for index: %2d",
|
_mi_search(info,keyinfo,info->lastkey,key_length,
|
||||||
llstr(start_recpos,llbuff),key+1);
|
SEARCH_SAME, info->s->state.key_root[key]);
|
||||||
if (error++ > MAXERR || !(param->testflag & T_VERBOSE))
|
if (search_result)
|
||||||
goto err2;
|
{
|
||||||
}
|
mi_check_print_error(param,"Record at: %10s Can't find key for index: %2d",
|
||||||
|
llstr(start_recpos,llbuff),key+1);
|
||||||
|
if (error++ > MAXERR || !(param->testflag & T_VERBOSE))
|
||||||
|
goto err2;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
key_checksum[key]+=mi_byte_checksum((byte*) info->lastkey,
|
key_checksum[key]+=mi_byte_checksum((byte*) info->lastkey,
|
||||||
|
@ -804,3 +804,16 @@ CREATE TABLE t2 (geom GEOMETRY NOT NULL, SPATIAL KEY gk(geom));
|
|||||||
INSERT INTO t2 SELECT GeomFromText(st) FROM t1;
|
INSERT INTO t2 SELECT GeomFromText(st) FROM t1;
|
||||||
ERROR HY000: Unknown error
|
ERROR HY000: Unknown error
|
||||||
drop table t1, t2;
|
drop table t1, t2;
|
||||||
|
CREATE TABLE t1 (`geometry` geometry NOT NULL default '',SPATIAL KEY `gndx` (`geometry`(32))) ENGINE=MyISAM DEFAULT CHARSET=latin1;
|
||||||
|
INSERT INTO t1 (geometry) VALUES
|
||||||
|
(PolygonFromText('POLYGON((-18.6086111000 -66.9327777000, -18.6055555000
|
||||||
|
-66.8158332999, -18.7186111000 -66.8102777000, -18.7211111000 -66.9269443999,
|
||||||
|
-18.6086111000 -66.9327777000))'));
|
||||||
|
INSERT INTO t1 (geometry) VALUES
|
||||||
|
(PolygonFromText('POLYGON((-65.7402776999 -96.6686111000, -65.7372222000
|
||||||
|
-96.5516666000, -65.8502777000 -96.5461111000, -65.8527777000 -96.6627777000,
|
||||||
|
-65.7402776999 -96.6686111000))'));
|
||||||
|
check table t1 extended;
|
||||||
|
Table Op Msg_type Msg_text
|
||||||
|
test.t1 check status OK
|
||||||
|
drop table t1;
|
||||||
|
@ -173,4 +173,19 @@ CREATE TABLE t2 (geom GEOMETRY NOT NULL, SPATIAL KEY gk(geom));
|
|||||||
INSERT INTO t2 SELECT GeomFromText(st) FROM t1;
|
INSERT INTO t2 SELECT GeomFromText(st) FROM t1;
|
||||||
drop table t1, t2;
|
drop table t1, t2;
|
||||||
|
|
||||||
|
CREATE TABLE t1 (`geometry` geometry NOT NULL default '',SPATIAL KEY `gndx` (`geometry`(32))) ENGINE=MyISAM DEFAULT CHARSET=latin1;
|
||||||
|
|
||||||
|
INSERT INTO t1 (geometry) VALUES
|
||||||
|
(PolygonFromText('POLYGON((-18.6086111000 -66.9327777000, -18.6055555000
|
||||||
|
-66.8158332999, -18.7186111000 -66.8102777000, -18.7211111000 -66.9269443999,
|
||||||
|
-18.6086111000 -66.9327777000))'));
|
||||||
|
|
||||||
|
INSERT INTO t1 (geometry) VALUES
|
||||||
|
(PolygonFromText('POLYGON((-65.7402776999 -96.6686111000, -65.7372222000
|
||||||
|
-96.5516666000, -65.8502777000 -96.5461111000, -65.8527777000 -96.6627777000,
|
||||||
|
-65.7402776999 -96.6686111000))'));
|
||||||
|
check table t1 extended;
|
||||||
|
|
||||||
|
drop table t1;
|
||||||
|
|
||||||
# End of 4.1 tests
|
# End of 4.1 tests
|
||||||
|
Reference in New Issue
Block a user