Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
mariadb
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
mariadb
Commits
15c8f377
Commit
15c8f377
authored
Nov 04, 2003
by
ram@deer.(none)
Browse files
Options
Browse Files
Download
Plain Diff
Merge rkalimullin@bk-internal.mysql.com:/home/bk/mysql-4.1
into deer.(none):/home/ram/work/4.1
parents
6622d6f8
ea5a7a3d
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
83 additions
and
40 deletions
+83
-40
BitKeeper/etc/logging_ok
BitKeeper/etc/logging_ok
+1
-0
myisam/mi_open.c
myisam/mi_open.c
+1
-0
myisam/myisamdef.h
myisam/myisamdef.h
+1
-0
myisam/rt_index.c
myisam/rt_index.c
+80
-40
No files found.
BitKeeper/etc/logging_ok
View file @
15c8f377
...
...
@@ -100,6 +100,7 @@ peter@linux.local
peter@mysql.com
peterg@mysql.com
pgulutzan@linux.local
ram@deer.(none)
ram@gw.mysql.r18.ru
ram@gw.udmsearch.izhnet.ru
ram@mysql.r18.ru
...
...
myisam/mi_open.c
View file @
15c8f377
...
...
@@ -508,6 +508,7 @@ MI_INFO *mi_open(const char *name, int mode, uint open_flags)
&
info
.
buff
,(
share
->
base
.
max_key_block_length
*
2
+
share
->
base
.
max_key_length
),
&
info
.
lastkey
,
share
->
base
.
max_key_length
*
3
+
1
,
&
info
.
first_mbr_key
,
share
->
base
.
max_key_length
,
&
info
.
filename
,
strlen
(
org_name
)
+
1
,
&
info
.
rtree_recursion_state
,
have_rtree
?
1024
:
0
,
NullS
))
...
...
myisam/myisamdef.h
View file @
15c8f377
...
...
@@ -229,6 +229,7 @@ struct st_myisam_info {
char
*
filename
;
/* parameter to open filename */
uchar
*
buff
,
/* Temp area for key */
*
lastkey
,
*
lastkey2
;
/* Last used search key */
uchar
*
first_mbr_key
;
/* Searhed spatial key */
byte
*
rec_buff
;
/* Tempbuff for recordpack */
uchar
*
int_keypos
,
/* Save position for next/previous */
*
int_maxpos
;
/* -""- */
...
...
myisam/rt_index.c
View file @
15c8f377
...
...
@@ -86,7 +86,7 @@ static int rtree_find_req(MI_INFO *info, MI_KEYDEF *keyinfo, uint search_flag,
if
(
nod_flag
)
{
/* this is an internal node in the tree */
if
(
!
(
res
=
rtree_key_cmp
(
keyinfo
->
seg
,
info
->
lastkey2
,
k
,
if
(
!
(
res
=
rtree_key_cmp
(
keyinfo
->
seg
,
info
->
first_mbr_key
,
k
,
info
->
last_rkey_length
,
nod_cmp_flag
)))
{
switch
((
res
=
rtree_find_req
(
info
,
keyinfo
,
search_flag
,
nod_cmp_flag
,
...
...
@@ -107,7 +107,7 @@ static int rtree_find_req(MI_INFO *info, MI_KEYDEF *keyinfo, uint search_flag,
else
{
/* this is a leaf */
if
(
!
rtree_key_cmp
(
keyinfo
->
seg
,
info
->
lastkey2
,
k
,
if
(
!
rtree_key_cmp
(
keyinfo
->
seg
,
info
->
first_mbr_key
,
k
,
info
->
last_rkey_length
,
search_flag
))
{
uchar
*
after_key
=
rt_PAGE_NEXT_KEY
(
k
,
k_len
,
nod_flag
);
...
...
@@ -180,7 +180,8 @@ int rtree_find_first(MI_INFO *info, uint keynr, uchar *key, uint key_length,
}
/* Save searched key */
memcpy
(
info
->
lastkey2
,
key
,
keyinfo
->
keylength
-
info
->
s
->
base
.
rec_reflength
);
memcpy
(
info
->
first_mbr_key
,
key
,
keyinfo
->
keylength
-
info
->
s
->
base
.
rec_reflength
);
info
->
last_rkey_length
=
key_length
;
info
->
rtree_recursion_depth
=
-
1
;
...
...
@@ -195,6 +196,12 @@ int rtree_find_first(MI_INFO *info, uint keynr, uchar *key, uint key_length,
/*
Find next key in r-tree according to search_flag condition
SYNOPSIS
rtree_find_next()
info Handler to MyISAM file
uint keynr Key number to use
search_flag Bitmap of flags how to do the search
RETURN
-1 Error
0 Found
...
...
@@ -217,7 +224,7 @@ int rtree_find_next(MI_INFO *info, uint keynr, uint search_flag)
while
(
key
<
info
->
int_maxpos
)
{
if
(
!
rtree_key_cmp
(
keyinfo
->
seg
,
info
->
lastkey2
,
key
,
if
(
!
rtree_key_cmp
(
keyinfo
->
seg
,
info
->
first_mbr_key
,
key
,
info
->
last_rkey_length
,
search_flag
))
{
uchar
*
after_key
=
key
+
keyinfo
->
keylength
;
...
...
@@ -353,13 +360,16 @@ err1:
return
-
1
;
}
/*
Get first key in r-tree
Result values:
-1 - error
0 - found
1 - not found
Get first key in r-tree
RETURN
-1 Error
0 Found
1 Not found
*/
int
rtree_get_first
(
MI_INFO
*
info
,
uint
keynr
,
uint
key_length
)
{
my_off_t
root
;
...
...
@@ -377,12 +387,16 @@ int rtree_get_first(MI_INFO *info, uint keynr, uint key_length)
return
rtree_get_req
(
info
,
&
keyinfo
[
keynr
],
key_length
,
root
,
0
);
}
/* Get next key in r-tree
Result values:
-1 - error
0 - found
1 - not found
/*
Get next key in r-tree
RETURN
-1 Error
0 Found
1 Not found
*/
int
rtree_get_next
(
MI_INFO
*
info
,
uint
keynr
,
uint
key_length
)
{
my_off_t
root
;
...
...
@@ -421,13 +435,16 @@ int rtree_get_next(MI_INFO *info, uint keynr, uint key_length)
}
}
/*
Go down and insert key into tree
Result values:
-1 - error
0 - child was not split
1 - child was split
Go down and insert key into tree
RETURN
-1 Error
0 Child was not split
1 Child was split
*/
static
int
rtree_insert_req
(
MI_INFO
*
info
,
MI_KEYDEF
*
keyinfo
,
uchar
*
key
,
uint
key_length
,
my_off_t
page
,
my_off_t
*
new_page
,
int
ins_level
,
int
level
)
...
...
@@ -504,13 +521,16 @@ err1:
return
-
1
;
}
/*
Insert key into the tree
Result values:
-1 - error
0 - root was not split
1 - root was split
Insert key into the tree
RETURN
-1 Error
0 Root was not split
1 Root was split
*/
static
int
rtree_insert_level
(
MI_INFO
*
info
,
uint
keynr
,
uchar
*
key
,
uint
key_length
,
int
ins_level
)
{
...
...
@@ -594,20 +614,29 @@ err1:
return
res
;
}
/*
Insert key into the tree - interface function
Result values:
-1 - error
0 - OK
Insert key into the tree - interface function
RETURN
-1 Error
0 OK
*/
int
rtree_insert
(
MI_INFO
*
info
,
uint
keynr
,
uchar
*
key
,
uint
key_length
)
{
return
(
rtree_insert_level
(
info
,
keynr
,
key
,
key_length
,
-
1
)
==
-
1
)
?
-
1
:
0
;
}
/*
Fill reinsert page buffer
Fill reinsert page buffer
RETURN
-1 Error
0 OK
*/
static
int
rtree_fill_reinsert_list
(
stPageList
*
ReinsertList
,
my_off_t
page
,
int
level
)
{
...
...
@@ -628,14 +657,17 @@ err1:
return
-
1
;
}
/*
Go down and delete key from the tree
Result values:
-1 - error
0 - deleted
1 - not found
2 - empty leaf
Go down and delete key from the tree
RETURN
-1 Error
0 Deleted
1 Not found
2 Empty leaf
*/
static
int
rtree_delete_req
(
MI_INFO
*
info
,
MI_KEYDEF
*
keyinfo
,
uchar
*
key
,
uint
key_length
,
my_off_t
page
,
uint
*
page_size
,
stPageList
*
ReinsertList
,
int
level
)
...
...
@@ -754,12 +786,15 @@ err1:
return
-
1
;
}
/*
Delete key - interface function
Result values:
-1 - error
0 - deleted
Delete key - interface function
RETURN
-1 Error
0 Deleted
*/
int
rtree_delete
(
MI_INFO
*
info
,
uint
keynr
,
uchar
*
key
,
uint
key_length
)
{
uint
page_size
;
...
...
@@ -860,9 +895,14 @@ err1:
}
}
/*
Estimate number of suitable keys in the tree
Estimate number of suitable keys in the tree
RETURN
estimated value
*/
ha_rows
rtree_estimate
(
MI_INFO
*
info
,
uint
keynr
,
uchar
*
key
,
uint
key_length
,
uint
flag
)
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment