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
5ddf741a
Commit
5ddf741a
authored
Jun 03, 2004
by
monty@mysql.com
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
portability fix
parent
eef24c7e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
16 deletions
+22
-16
myisam/rt_mbr.c
myisam/rt_mbr.c
+22
-16
No files found.
myisam/rt_mbr.c
View file @
5ddf741a
...
@@ -94,6 +94,7 @@ int rtree_key_cmp(HA_KEYSEG *keyseg, uchar *b, uchar *a, uint key_length,
...
@@ -94,6 +94,7 @@ int rtree_key_cmp(HA_KEYSEG *keyseg, uchar *b, uchar *a, uint key_length,
{
{
for
(;
(
int
)
key_length
>
0
;
keyseg
+=
2
)
for
(;
(
int
)
key_length
>
0
;
keyseg
+=
2
)
{
{
uint32
keyseg_length
;
switch
((
enum
ha_base_keytype
)
keyseg
->
type
)
{
switch
((
enum
ha_base_keytype
)
keyseg
->
type
)
{
case
HA_KEYTYPE_INT8
:
case
HA_KEYTYPE_INT8
:
RT_CMP_KORR
(
int8
,
mi_sint1korr
,
1
,
nextflag
);
RT_CMP_KORR
(
int8
,
mi_sint1korr
,
1
,
nextflag
);
...
@@ -138,7 +139,7 @@ int rtree_key_cmp(HA_KEYSEG *keyseg, uchar *b, uchar *a, uint key_length,
...
@@ -138,7 +139,7 @@ int rtree_key_cmp(HA_KEYSEG *keyseg, uchar *b, uchar *a, uint key_length,
default:
default:
return
1
;
return
1
;
}
}
uint32
keyseg_length
=
keyseg
->
length
*
2
;
keyseg_length
=
keyseg
->
length
*
2
;
key_length
-=
keyseg_length
;
key_length
-=
keyseg_length
;
a
+=
keyseg_length
;
a
+=
keyseg_length
;
b
+=
keyseg_length
;
b
+=
keyseg_length
;
...
@@ -181,6 +182,7 @@ double rtree_rect_volume(HA_KEYSEG *keyseg, uchar *a, uint key_length)
...
@@ -181,6 +182,7 @@ double rtree_rect_volume(HA_KEYSEG *keyseg, uchar *a, uint key_length)
double
res
=
1
;
double
res
=
1
;
for
(;
(
int
)
key_length
>
0
;
keyseg
+=
2
)
for
(;
(
int
)
key_length
>
0
;
keyseg
+=
2
)
{
{
uint32
keyseg_length
;
switch
((
enum
ha_base_keytype
)
keyseg
->
type
)
{
switch
((
enum
ha_base_keytype
)
keyseg
->
type
)
{
case
HA_KEYTYPE_INT8
:
case
HA_KEYTYPE_INT8
:
RT_VOL_KORR
(
int8
,
mi_sint1korr
,
1
,
(
double
));
RT_VOL_KORR
(
int8
,
mi_sint1korr
,
1
,
(
double
));
...
@@ -226,7 +228,7 @@ double rtree_rect_volume(HA_KEYSEG *keyseg, uchar *a, uint key_length)
...
@@ -226,7 +228,7 @@ double rtree_rect_volume(HA_KEYSEG *keyseg, uchar *a, uint key_length)
default:
default:
return
-
1
;
return
-
1
;
}
}
uint32
keyseg_length
=
keyseg
->
length
*
2
;
keyseg_length
=
keyseg
->
length
*
2
;
key_length
-=
keyseg_length
;
key_length
-=
keyseg_length
;
a
+=
keyseg_length
;
a
+=
keyseg_length
;
}
}
...
@@ -251,13 +253,16 @@ double rtree_rect_volume(HA_KEYSEG *keyseg, uchar *a, uint key_length)
...
@@ -251,13 +253,16 @@ double rtree_rect_volume(HA_KEYSEG *keyseg, uchar *a, uint key_length)
*res++ = cast(amax); \
*res++ = cast(amax); \
}
}
/*
/*
Creates an MBR as an array of doubles.
Creates an MBR as an array of doubles.
*/
*/
int
rtree_d_mbr
(
HA_KEYSEG
*
keyseg
,
uchar
*
a
,
uint
key_length
,
double
*
res
)
int
rtree_d_mbr
(
HA_KEYSEG
*
keyseg
,
uchar
*
a
,
uint
key_length
,
double
*
res
)
{
{
for
(;
(
int
)
key_length
>
0
;
keyseg
+=
2
)
for
(;
(
int
)
key_length
>
0
;
keyseg
+=
2
)
{
{
uint32
keyseg_length
;
switch
((
enum
ha_base_keytype
)
keyseg
->
type
)
{
switch
((
enum
ha_base_keytype
)
keyseg
->
type
)
{
case
HA_KEYTYPE_INT8
:
case
HA_KEYTYPE_INT8
:
RT_D_MBR_KORR
(
int8
,
mi_sint1korr
,
1
,
(
double
));
RT_D_MBR_KORR
(
int8
,
mi_sint1korr
,
1
,
(
double
));
...
@@ -303,7 +308,7 @@ int rtree_d_mbr(HA_KEYSEG *keyseg, uchar *a, uint key_length, double *res)
...
@@ -303,7 +308,7 @@ int rtree_d_mbr(HA_KEYSEG *keyseg, uchar *a, uint key_length, double *res)
default:
default:
return
1
;
return
1
;
}
}
uint32
keyseg_length
=
keyseg
->
length
*
2
;
keyseg_length
=
keyseg
->
length
*
2
;
key_length
-=
keyseg_length
;
key_length
-=
keyseg_length
;
a
+=
keyseg_length
;
a
+=
keyseg_length
;
}
}
...
@@ -347,6 +352,7 @@ int rtree_combine_rect(HA_KEYSEG *keyseg, uchar* a, uchar* b, uchar* c,
...
@@ -347,6 +352,7 @@ int rtree_combine_rect(HA_KEYSEG *keyseg, uchar* a, uchar* b, uchar* c,
{
{
for
(
;
(
int
)
key_length
>
0
;
keyseg
+=
2
)
for
(
;
(
int
)
key_length
>
0
;
keyseg
+=
2
)
{
{
uint32
keyseg_length
;
switch
((
enum
ha_base_keytype
)
keyseg
->
type
)
{
switch
((
enum
ha_base_keytype
)
keyseg
->
type
)
{
case
HA_KEYTYPE_INT8
:
case
HA_KEYTYPE_INT8
:
RT_COMB_KORR
(
int8
,
mi_sint1korr
,
mi_int1store
,
1
);
RT_COMB_KORR
(
int8
,
mi_sint1korr
,
mi_int1store
,
1
);
...
@@ -391,7 +397,7 @@ int rtree_combine_rect(HA_KEYSEG *keyseg, uchar* a, uchar* b, uchar* c,
...
@@ -391,7 +397,7 @@ int rtree_combine_rect(HA_KEYSEG *keyseg, uchar* a, uchar* b, uchar* c,
default:
default:
return
1
;
return
1
;
}
}
uint32
keyseg_length
=
keyseg
->
length
*
2
;
keyseg_length
=
keyseg
->
length
*
2
;
key_length
-=
keyseg_length
;
key_length
-=
keyseg_length
;
a
+=
keyseg_length
;
a
+=
keyseg_length
;
b
+=
keyseg_length
;
b
+=
keyseg_length
;
...
@@ -400,6 +406,7 @@ int rtree_combine_rect(HA_KEYSEG *keyseg, uchar* a, uchar* b, uchar* c,
...
@@ -400,6 +406,7 @@ int rtree_combine_rect(HA_KEYSEG *keyseg, uchar* a, uchar* b, uchar* c,
return
0
;
return
0
;
}
}
#define RT_OVL_AREA_KORR(type, korr_func, len) \
#define RT_OVL_AREA_KORR(type, korr_func, len) \
{ \
{ \
type amin, amax, bmin, bmax; \
type amin, amax, bmin, bmax; \
...
@@ -437,6 +444,7 @@ double rtree_overlapping_area(HA_KEYSEG *keyseg, uchar* a, uchar* b,
...
@@ -437,6 +444,7 @@ double rtree_overlapping_area(HA_KEYSEG *keyseg, uchar* a, uchar* b,
double
res
=
1
;
double
res
=
1
;
for
(;
(
int
)
key_length
>
0
;
keyseg
+=
2
)
for
(;
(
int
)
key_length
>
0
;
keyseg
+=
2
)
{
{
uint32
keyseg_length
;
switch
((
enum
ha_base_keytype
)
keyseg
->
type
)
{
switch
((
enum
ha_base_keytype
)
keyseg
->
type
)
{
case
HA_KEYTYPE_INT8
:
case
HA_KEYTYPE_INT8
:
RT_OVL_AREA_KORR
(
int8
,
mi_sint1korr
,
1
);
RT_OVL_AREA_KORR
(
int8
,
mi_sint1korr
,
1
);
...
@@ -481,7 +489,7 @@ double rtree_overlapping_area(HA_KEYSEG *keyseg, uchar* a, uchar* b,
...
@@ -481,7 +489,7 @@ double rtree_overlapping_area(HA_KEYSEG *keyseg, uchar* a, uchar* b,
default:
default:
return
-
1
;
return
-
1
;
}
}
uint32
keyseg_length
=
keyseg
->
length
*
2
;
keyseg_length
=
keyseg
->
length
*
2
;
key_length
-=
keyseg_length
;
key_length
-=
keyseg_length
;
a
+=
keyseg_length
;
a
+=
keyseg_length
;
b
+=
keyseg_length
;
b
+=
keyseg_length
;
...
@@ -522,11 +530,10 @@ double rtree_area_increase(HA_KEYSEG *keyseg, uchar* a, uchar* b,
...
@@ -522,11 +530,10 @@ double rtree_area_increase(HA_KEYSEG *keyseg, uchar* a, uchar* b,
*
ab_area
=
1
.
0
;
*
ab_area
=
1
.
0
;
for
(;
(
int
)
key_length
>
0
;
keyseg
+=
2
)
for
(;
(
int
)
key_length
>
0
;
keyseg
+=
2
)
{
{
/* Handle NULL part */
uint32
keyseg_length
;
if
(
keyseg
->
null_bit
)
{
if
(
keyseg
->
null_bit
)
/* Handle NULL part */
return
-
1
;
return
-
1
;
}
switch
((
enum
ha_base_keytype
)
keyseg
->
type
)
{
switch
((
enum
ha_base_keytype
)
keyseg
->
type
)
{
case
HA_KEYTYPE_INT8
:
case
HA_KEYTYPE_INT8
:
...
@@ -572,7 +579,7 @@ double rtree_area_increase(HA_KEYSEG *keyseg, uchar* a, uchar* b,
...
@@ -572,7 +579,7 @@ double rtree_area_increase(HA_KEYSEG *keyseg, uchar* a, uchar* b,
default:
default:
return
-
1
;
return
-
1
;
}
}
uint32
keyseg_length
=
keyseg
->
length
*
2
;
keyseg_length
=
keyseg
->
length
*
2
;
key_length
-=
keyseg_length
;
key_length
-=
keyseg_length
;
a
+=
keyseg_length
;
a
+=
keyseg_length
;
b
+=
keyseg_length
;
b
+=
keyseg_length
;
...
@@ -613,11 +620,10 @@ double rtree_perimeter_increase(HA_KEYSEG *keyseg, uchar* a, uchar* b,
...
@@ -613,11 +620,10 @@ double rtree_perimeter_increase(HA_KEYSEG *keyseg, uchar* a, uchar* b,
*
ab_perim
=
0
.
0
;
*
ab_perim
=
0
.
0
;
for
(;
(
int
)
key_length
>
0
;
keyseg
+=
2
)
for
(;
(
int
)
key_length
>
0
;
keyseg
+=
2
)
{
{
/* Handle NULL part */
uint32
keyseg_length
;
if
(
keyseg
->
null_bit
)
{
if
(
keyseg
->
null_bit
)
/* Handle NULL part */
return
-
1
;
return
-
1
;
}
switch
((
enum
ha_base_keytype
)
keyseg
->
type
)
{
switch
((
enum
ha_base_keytype
)
keyseg
->
type
)
{
case
HA_KEYTYPE_INT8
:
case
HA_KEYTYPE_INT8
:
...
@@ -663,7 +669,7 @@ double rtree_perimeter_increase(HA_KEYSEG *keyseg, uchar* a, uchar* b,
...
@@ -663,7 +669,7 @@ double rtree_perimeter_increase(HA_KEYSEG *keyseg, uchar* a, uchar* b,
default:
default:
return
-
1
;
return
-
1
;
}
}
uint32
keyseg_length
=
keyseg
->
length
*
2
;
keyseg_length
=
keyseg
->
length
*
2
;
key_length
-=
keyseg_length
;
key_length
-=
keyseg_length
;
a
+=
keyseg_length
;
a
+=
keyseg_length
;
b
+=
keyseg_length
;
b
+=
keyseg_length
;
...
...
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