diff options
author | unknown <bar@gw.udmsearch.izhnet.ru> | 2002-02-20 14:11:21 +0400 |
---|---|---|
committer | unknown <bar@gw.udmsearch.izhnet.ru> | 2002-02-20 14:11:21 +0400 |
commit | 3d5dc65dfd72083ed159220d03bea942094e8662 (patch) | |
tree | 20573ea174df56ec053e23fa07eb87679f3b7a38 /myisam/mi_rnext_same.c | |
parent | b87d6ee9d730fb2df74a3981b552b0da2e09570c (diff) | |
download | mariadb-git-3d5dc65dfd72083ed159220d03bea942094e8662.tar.gz |
This ChangeSet adds RTREE support into myisam library.
RTREEs will be used for GIS extension in MySQL
myisam/.cvsignore:
Added sp_test and rt_test
myisam/Makefile.am:
Added RTREE files
myisam/mi_create.c:
Added RTREE/SPATIAL initialization
myisam/mi_delete.c:
Switched to use virual function, instead of mi_ck_delete() direct call
myisam/mi_key.c:
Added sp_make_key() call in the case of SPATIAL index type
myisam/mi_open.c:
Added some new initialization actions which depend on key_alg being used: RTREE or BTREE
myisam/mi_range.c:
Rtree estimation
myisam/mi_rkey.c:
rtree
myisam/mi_rnext.c:
rtree
myisam/mi_rnext_same.c:
rtree
myisam/mi_static.c:
New search flags for bounding rectungles
myisam/mi_test1.c:
one now should always specify key_alg during keyinfo initializing: BTREE or RTREE
myisam/mi_test2.c:
Added key_alg initializing
myisam/mi_test3.c:
Added key_alg initialization
myisam/mi_update.c:
Switched to virtual functions, instead of mi_ck_delete/mi_ck_write direct call
myisam/mi_write.c:
Virtual function instead of mi_ck_write() direct call
myisam/myisamdef.h:
Rtree additions
Diffstat (limited to 'myisam/mi_rnext_same.c')
-rw-r--r-- | myisam/mi_rnext_same.c | 42 |
1 files changed, 28 insertions, 14 deletions
diff --git a/myisam/mi_rnext_same.c b/myisam/mi_rnext_same.c index 662bdb154b3..88ff24842d4 100644 --- a/myisam/mi_rnext_same.c +++ b/myisam/mi_rnext_same.c @@ -15,6 +15,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include "myisamdef.h" +#include "rt_index.h" /* Read next row with the same key as previous read, but abort if @@ -38,26 +39,39 @@ int mi_rnext_same(MI_INFO *info, byte *buf) if (fast_mi_readinfo(info)) DBUG_RETURN(my_errno); - memcpy(info->lastkey2,info->lastkey,info->last_rkey_length); if (info->s->concurrent_insert) rw_rdlock(&info->s->key_root_lock[inx]); - for (;;) + + switch(keyinfo->key_alg) { - if ((error=_mi_search_next(info,keyinfo,info->lastkey, + case HA_KEY_ALG_RTREE: + if((error=rtree_find_next(info,inx,myisam_read_vec[info->last_key_func]))) + { + /* FIXME: What to do?*/ + } + break; + case HA_KEY_ALG_BTREE: + default: + + memcpy(info->lastkey2,info->lastkey,info->last_rkey_length); + for (;;) + { + if ((error=_mi_search_next(info,keyinfo,info->lastkey, info->lastkey_length,flag, info->s->state.key_root[inx]))) - break; - if (_mi_key_cmp(keyinfo->seg,info->lastkey2,info->lastkey, + break; + if (_mi_key_cmp(keyinfo->seg,info->lastkey2,info->lastkey, info->last_rkey_length, SEARCH_FIND, ¬_used)) - { - error=1; - my_errno=HA_ERR_END_OF_FILE; - info->lastpos= HA_OFFSET_ERROR; - break; - } - /* Skip rows that are inserted by other threads since we got a lock */ - if (info->lastpos < info->state->data_file_length) - break; + { + error=1; + my_errno=HA_ERR_END_OF_FILE; + info->lastpos= HA_OFFSET_ERROR; + break; + } + /* Skip rows that are inserted by other threads since we got a lock */ + if (info->lastpos < info->state->data_file_length) + break; + } } if (info->s->concurrent_insert) rw_unlock(&info->s->key_root_lock[inx]); |