diff options
author | unknown <hf@deer.(none)> | 2005-08-27 18:10:46 +0500 |
---|---|---|
committer | unknown <hf@deer.(none)> | 2005-08-27 18:10:46 +0500 |
commit | c11cb6a3a5570ca929f5231744d6aece9b69092c (patch) | |
tree | 5d8aceda33c9ef43fd4a8ee58923fcad4b7db91a | |
parent | d5be483c623f67bc681a112bc9f9d72b65cfc547 (diff) | |
parent | 56b8fc52cfe81b22031ece94475d9a6f3fa663c2 (diff) | |
download | mariadb-git-c11cb6a3a5570ca929f5231744d6aece9b69092c.tar.gz |
Merge deer.(none):/home/hf/work/mysql-4.1.clean
into deer.(none):/home/hf/work/mysql-5.0.clean
myisam/mi_check.c:
Auto merged
mysql-test/r/gis-rtree.result:
Auto merged
mysql-test/t/gis-rtree.test:
Auto merged
-rw-r--r-- | myisam/mi_check.c | 22 | ||||
-rw-r--r-- | mysql-test/r/gis-rtree.result | 13 | ||||
-rw-r--r-- | mysql-test/t/gis-rtree.test | 15 |
3 files changed, 41 insertions, 9 deletions
diff --git a/myisam/mi_check.c b/myisam/mi_check.c index 1db829808a9..ffb7cdd503f 100644 --- a/myisam/mi_check.c +++ b/myisam/mi_check.c @@ -1036,7 +1036,7 @@ int chk_data_link(MI_CHECK *param, MI_INFO *info,int extend) { if (mi_is_key_active(info->s->state.key_map, key)) { - if(!(keyinfo->flag & HA_FULLTEXT)) + if(!(keyinfo->flag & HA_FULLTEXT)) { uint key_length=_mi_make_key(info,key,info->lastkey,record, start_recpos); @@ -1045,14 +1045,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 concurrent threads when running myisamchk */ - if (_mi_search(info,keyinfo,info->lastkey,key_length, - SEARCH_SAME, info->s->state.key_root[key])) - { - 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; - } + int search_result= (keyinfo->flag & HA_SPATIAL) ? + rtree_find_first(info, key, info->lastkey, key_length, + SEARCH_SAME) : + _mi_search(info,keyinfo,info->lastkey,key_length, + SEARCH_SAME, info->s->state.key_root[key]); + if (search_result) + { + 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 key_checksum[key]+=mi_byte_checksum((byte*) info->lastkey, diff --git a/mysql-test/r/gis-rtree.result b/mysql-test/r/gis-rtree.result index 22447e829a9..0f95778ea75 100644 --- a/mysql-test/r/gis-rtree.result +++ b/mysql-test/r/gis-rtree.result @@ -803,3 +803,16 @@ CREATE TABLE t2 (geom GEOMETRY NOT NULL, SPATIAL KEY gk(geom)); INSERT INTO t2 SELECT GeomFromText(st) FROM t1; ERROR 22003: Cannot get geometry object from data you send to the GEOMETRY field 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; diff --git a/mysql-test/t/gis-rtree.test b/mysql-test/t/gis-rtree.test index 52fe6add3b8..02e45861706 100644 --- a/mysql-test/t/gis-rtree.test +++ b/mysql-test/t/gis-rtree.test @@ -172,4 +172,19 @@ CREATE TABLE t2 (geom GEOMETRY NOT NULL, SPATIAL KEY gk(geom)); INSERT INTO t2 SELECT GeomFromText(st) FROM t1; 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 |