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
396438a8
Commit
396438a8
authored
Mar 20, 2003
by
ram@mysql.r18.ru
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
R-tree bug fixes.
parent
0ccb7c37
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
38 additions
and
6 deletions
+38
-6
myisam/rt_index.c
myisam/rt_index.c
+8
-1
myisam/sp_key.c
myisam/sp_key.c
+29
-4
sql/field.cc
sql/field.cc
+1
-1
No files found.
myisam/rt_index.c
View file @
396438a8
...
@@ -188,6 +188,12 @@ int rtree_find_next(MI_INFO *info, uint keynr, uint search_flag)
...
@@ -188,6 +188,12 @@ int rtree_find_next(MI_INFO *info, uint keynr, uint search_flag)
uint
nod_cmp_flag
;
uint
nod_cmp_flag
;
MI_KEYDEF
*
keyinfo
=
info
->
s
->
keyinfo
+
keynr
;
MI_KEYDEF
*
keyinfo
=
info
->
s
->
keyinfo
+
keynr
;
if
(
info
->
update
&
HA_STATE_DELETED
)
{
return
rtree_find_first
(
info
,
keynr
,
info
->
lastkey
,
info
->
lastkey_length
,
search_flag
);
}
if
(
!
info
->
buff_used
)
if
(
!
info
->
buff_used
)
{
{
uchar
*
key
=
info
->
int_keypos
;
uchar
*
key
=
info
->
int_keypos
;
...
@@ -814,6 +820,7 @@ int rtree_delete(MI_INFO *info, uint keynr, uchar *key, uint key_length)
...
@@ -814,6 +820,7 @@ int rtree_delete(MI_INFO *info, uint keynr, uchar *key, uint key_length)
goto
err1
;
goto
err1
;
info
->
s
->
state
.
key_root
[
keynr
]
=
new_root
;
info
->
s
->
state
.
key_root
[
keynr
]
=
new_root
;
}
}
info
->
update
=
HA_STATE_DELETED
;
return
0
;
return
0
;
err1:
err1:
...
@@ -911,7 +918,7 @@ ha_rows rtree_estimate(MI_INFO *info, uint keynr, uchar *key,
...
@@ -911,7 +918,7 @@ ha_rows rtree_estimate(MI_INFO *info, uint keynr, uchar *key,
if
(
nod_flag
)
if
(
nod_flag
)
{
{
if
(
i
)
if
(
i
)
res
=
(
int
)
(
area
/
i
*
info
->
state
->
records
);
res
=
(
ha_rows
)
(
area
/
i
*
info
->
state
->
records
);
else
else
res
=
HA_POS_ERROR
;
res
=
HA_POS_ERROR
;
}
}
...
...
myisam/sp_key.c
View file @
396438a8
...
@@ -56,6 +56,31 @@ uint sp_make_key(register MI_INFO *info, uint keynr, uchar *key,
...
@@ -56,6 +56,31 @@ uint sp_make_key(register MI_INFO *info, uint keynr, uchar *key,
pos
=
((
byte
*
)
mbr
)
+
keyseg
->
start
;
pos
=
((
byte
*
)
mbr
)
+
keyseg
->
start
;
if
(
keyseg
->
flag
&
HA_SWAP_KEY
)
if
(
keyseg
->
flag
&
HA_SWAP_KEY
)
{
{
#ifdef HAVE_ISNAN
if
(
keyseg
->
type
==
HA_KEYTYPE_FLOAT
)
{
float
nr
;
float4get
(
nr
,
pos
);
if
(
isnan
(
nr
))
{
/* Replace NAN with zero */
bzero
(
key
,
length
);
key
+=
length
;
continue
;
}
}
else
if
(
keyseg
->
type
==
HA_KEYTYPE_DOUBLE
)
{
double
nr
;
float8get
(
nr
,
pos
);
if
(
isnan
(
nr
))
{
bzero
(
key
,
length
);
key
+=
length
;
continue
;
}
}
#endif
pos
+=
length
;
pos
+=
length
;
while
(
length
--
)
while
(
length
--
)
{
{
...
@@ -99,19 +124,19 @@ static int sp_add_point_to_mbr(uchar *(*wkb), uchar *end, uint n_dims,
...
@@ -99,19 +124,19 @@ static int sp_add_point_to_mbr(uchar *(*wkb), uchar *end, uint n_dims,
double
*
mbr
)
double
*
mbr
)
{
{
double
ord
;
double
ord
;
double
*
mbr_end
=
mbr
+
n_dims
*
2
;
double
*
mbr_end
=
mbr
+
n_dims
*
2
;
while
(
mbr
<
mbr_end
)
while
(
mbr
<
mbr_end
)
{
{
if
((
*
wkb
)
>
end
-
8
)
if
((
*
wkb
)
>
end
-
8
)
return
-
1
;
return
-
1
;
float8get
(
ord
,
(
*
wkb
));
float8get
(
ord
,
(
*
wkb
));
(
*
wkb
)
+=
8
;
(
*
wkb
)
+=
8
;
if
(
ord
<
*
mbr
)
if
(
ord
<
*
mbr
)
*
mbr
=
ord
;
float8store
((
char
*
)
mbr
,
ord
)
;
mbr
++
;
mbr
++
;
if
(
ord
>
*
mbr
)
if
(
ord
>
*
mbr
)
*
mbr
=
ord
;
float8store
((
char
*
)
mbr
,
ord
)
;
mbr
++
;
mbr
++
;
}
}
return
0
;
return
0
;
...
...
sql/field.cc
View file @
396438a8
...
@@ -4285,7 +4285,7 @@ Field_blob::Field_blob(char *ptr_arg, uchar *null_ptr_arg, uchar null_bit_arg,
...
@@ -4285,7 +4285,7 @@ Field_blob::Field_blob(char *ptr_arg, uchar *null_ptr_arg, uchar null_bit_arg,
:
Field_str
(
ptr_arg
,
(
1L
<<
min
(
blob_pack_length
,
3
)
*
8
)
-
1L
,
:
Field_str
(
ptr_arg
,
(
1L
<<
min
(
blob_pack_length
,
3
)
*
8
)
-
1L
,
null_ptr_arg
,
null_bit_arg
,
unireg_check_arg
,
field_name_arg
,
null_ptr_arg
,
null_bit_arg
,
unireg_check_arg
,
field_name_arg
,
table_arg
,
cs
),
table_arg
,
cs
),
packlength
(
blob_pack_length
),
geom_flag
(
true
)
geom_flag
(
true
),
packlength
(
blob_pack_length
)
{
{
flags
|=
BLOB_FLAG
;
flags
|=
BLOB_FLAG
;
if
(
table
)
if
(
table
)
...
...
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