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
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
MariaDB
Commits
a7db25a0
Commit
a7db25a0
authored
Oct 04, 2002
by
unknown
Browse files
Options
Browse Files
Download
Plain Diff
Merge sanja.is.com.ua:/home/bell/mysql/mysql-4.1
into sanja.is.com.ua:/home/bell/mysql/work-explain_union-4.1
parents
d98af8f2
b50cd03b
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
26 additions
and
15 deletions
+26
-15
mysys/my_handler.c
mysys/my_handler.c
+26
-15
No files found.
mysys/my_handler.c
View file @
a7db25a0
...
...
@@ -78,10 +78,9 @@ int ha_key_cmp(register HA_KEYSEG *keyseg, register uchar *a,
uint32
u_1
,
u_2
;
float
f_1
,
f_2
;
double
d_1
,
d_2
;
uint
next_key_length
;
*
diff_pos
=
0
;
for
(
;
(
int
)
key_length
>
0
;
key
_length
=
next_key_length
,
key
seg
++
)
for
(
;
(
int
)
key_length
>
0
;
keyseg
++
)
{
uchar
*
end
;
uint
piks
=!
(
keyseg
->
flag
&
HA_NO_SORT
);
...
...
@@ -101,12 +100,10 @@ int ha_key_cmp(register HA_KEYSEG *keyseg, register uchar *a,
{
if
(
nextflag
==
(
SEARCH_FIND
|
SEARCH_UPDATE
))
nextflag
=
SEARCH_SAME
;
/* Allow duplicate keys */
next_key_length
=
key_length
;
continue
;
/* To next key part */
}
}
end
=
a
+
min
(
keyseg
->
length
,
key_length
);
next_key_length
=
key_length
-
keyseg
->
length
;
switch
((
enum
ha_base_keytype
)
keyseg
->
type
)
{
case
HA_KEYTYPE_TEXT
:
/* Ascii; Key is converted */
...
...
@@ -115,12 +112,12 @@ int ha_key_cmp(register HA_KEYSEG *keyseg, register uchar *a,
int
a_length
,
b_length
,
pack_length
;
get_key_length
(
a_length
,
a
);
get_key_pack_length
(
b_length
,
pack_length
,
b
);
next_key_length
=
key_length
-
b_length
-
pack_length
;
key_length
-=
b_length
+
pack_length
;
if
(
piks
&&
(
flag
=
mi_compare_text
(
keyseg
->
charset
,
a
,
a_length
,
b
,
b_length
,
(
my_bool
)
((
nextflag
&
SEARCH_PREFIX
)
&&
next_
key_length
<=
0
))))
key_length
<=
0
))))
return
((
keyseg
->
flag
&
HA_REVERSE_SORT
)
?
-
flag
:
flag
);
a
+=
a_length
;
b
+=
b_length
;
...
...
@@ -129,6 +126,7 @@ int ha_key_cmp(register HA_KEYSEG *keyseg, register uchar *a,
else
{
uint
length
=
(
uint
)
(
end
-
a
),
a_length
=
length
,
b_length
=
length
;
key_length
-=
keyseg
->
length
;
if
(
!
(
nextflag
&
SEARCH_PREFIX
))
{
while
(
a_length
&&
a
[
a_length
-
1
]
==
' '
)
...
...
@@ -139,7 +137,7 @@ int ha_key_cmp(register HA_KEYSEG *keyseg, register uchar *a,
if
(
piks
&&
(
flag
=
mi_compare_text
(
keyseg
->
charset
,
a
,
a_length
,
b
,
b_length
,
(
my_bool
)
((
nextflag
&
SEARCH_PREFIX
)
&&
next_
key_length
<=
0
))))
key_length
<=
0
))))
return
((
keyseg
->
flag
&
HA_REVERSE_SORT
)
?
-
flag
:
flag
);
a
=
end
;
b
+=
length
;
...
...
@@ -151,12 +149,12 @@ int ha_key_cmp(register HA_KEYSEG *keyseg, register uchar *a,
int
a_length
,
b_length
,
pack_length
;
get_key_length
(
a_length
,
a
);
get_key_pack_length
(
b_length
,
pack_length
,
b
);
next_key_length
=
key_length
-
b_length
-
pack_length
;
key_length
-=
b_length
+
pack_length
;
if
(
piks
&&
(
flag
=
compare_bin
(
a
,
a_length
,
b
,
b_length
,
(
my_bool
)
((
nextflag
&
SEARCH_PREFIX
)
&&
next_
key_length
<=
0
))))
key_length
<=
0
))))
return
((
keyseg
->
flag
&
HA_REVERSE_SORT
)
?
-
flag
:
flag
);
a
+=
a_length
;
b
+=
b_length
;
...
...
@@ -165,10 +163,11 @@ int ha_key_cmp(register HA_KEYSEG *keyseg, register uchar *a,
else
{
uint
length
=
keyseg
->
length
;
key_length
-=
keyseg
->
length
;
if
(
piks
&&
(
flag
=
compare_bin
(
a
,
length
,
b
,
length
,
(
my_bool
)
((
nextflag
&
SEARCH_PREFIX
)
&&
next_
key_length
<=
0
))))
key_length
<=
0
))))
return
((
keyseg
->
flag
&
HA_REVERSE_SORT
)
?
-
flag
:
flag
);
a
+=
length
;
b
+=
length
;
...
...
@@ -179,12 +178,12 @@ int ha_key_cmp(register HA_KEYSEG *keyseg, register uchar *a,
int
a_length
,
b_length
,
pack_length
;
get_key_length
(
a_length
,
a
);
get_key_pack_length
(
b_length
,
pack_length
,
b
);
next_key_length
=
key_length
-
b_length
-
pack_length
;
key_length
-=
b_length
+
pack_length
;
if
(
piks
&&
(
flag
=
mi_compare_text
(
keyseg
->
charset
,
a
,
a_length
,
b
,
b_length
,
(
my_bool
)
((
nextflag
&
SEARCH_PREFIX
)
&&
next_
key_length
<=
0
))))
key_length
<=
0
))))
return
((
keyseg
->
flag
&
HA_REVERSE_SORT
)
?
-
flag
:
flag
);
a
+=
a_length
;
b
+=
b_length
;
...
...
@@ -196,12 +195,12 @@ int ha_key_cmp(register HA_KEYSEG *keyseg, register uchar *a,
int
a_length
,
b_length
,
pack_length
;
get_key_length
(
a_length
,
a
);
get_key_pack_length
(
b_length
,
pack_length
,
b
);
next_key_length
=
key_length
-
b_length
-
pack_length
;
key_length
-=
b_length
+
pack_length
;
if
(
piks
&&
(
flag
=
compare_bin
(
a
,
a_length
,
b
,
b_length
,
(
my_bool
)
((
nextflag
&
SEARCH_PREFIX
)
&&
next_
key_length
<=
0
))))
key_length
<=
0
))))
return
((
keyseg
->
flag
&
HA_REVERSE_SORT
)
?
-
flag
:
flag
);
a
+=
a_length
;
b
+=
b_length
;
...
...
@@ -216,6 +215,7 @@ int ha_key_cmp(register HA_KEYSEG *keyseg, register uchar *a,
return
((
keyseg
->
flag
&
HA_REVERSE_SORT
)
?
-
flag
:
flag
);
a
=
end
;
b
++
;
key_length
-=
keyseg
->
length
;
break
;
}
case
HA_KEYTYPE_SHORT_INT
:
...
...
@@ -225,6 +225,7 @@ int ha_key_cmp(register HA_KEYSEG *keyseg, register uchar *a,
return
((
keyseg
->
flag
&
HA_REVERSE_SORT
)
?
-
flag
:
flag
);
a
=
end
;
b
+=
2
;
/* sizeof(short int); */
key_length
-=
keyseg
->
length
;
break
;
case
HA_KEYTYPE_USHORT_INT
:
{
...
...
@@ -235,6 +236,7 @@ int ha_key_cmp(register HA_KEYSEG *keyseg, register uchar *a,
return
((
keyseg
->
flag
&
HA_REVERSE_SORT
)
?
-
flag
:
flag
);
a
=
end
;
b
+=
2
;
/* sizeof(short int); */
key_length
-=
keyseg
->
length
;
break
;
}
case
HA_KEYTYPE_LONG_INT
:
...
...
@@ -244,6 +246,7 @@ int ha_key_cmp(register HA_KEYSEG *keyseg, register uchar *a,
return
((
keyseg
->
flag
&
HA_REVERSE_SORT
)
?
-
flag
:
flag
);
a
=
end
;
b
+=
4
;
/* sizeof(long int); */
key_length
-=
keyseg
->
length
;
break
;
case
HA_KEYTYPE_ULONG_INT
:
u_1
=
mi_sint4korr
(
a
);
...
...
@@ -252,6 +255,7 @@ int ha_key_cmp(register HA_KEYSEG *keyseg, register uchar *a,
return
((
keyseg
->
flag
&
HA_REVERSE_SORT
)
?
-
flag
:
flag
);
a
=
end
;
b
+=
4
;
/* sizeof(long int); */
key_length
-=
keyseg
->
length
;
break
;
case
HA_KEYTYPE_INT24
:
l_1
=
mi_sint3korr
(
a
);
...
...
@@ -260,6 +264,7 @@ int ha_key_cmp(register HA_KEYSEG *keyseg, register uchar *a,
return
((
keyseg
->
flag
&
HA_REVERSE_SORT
)
?
-
flag
:
flag
);
a
=
end
;
b
+=
3
;
key_length
-=
keyseg
->
length
;
break
;
case
HA_KEYTYPE_UINT24
:
l_1
=
mi_uint3korr
(
a
);
...
...
@@ -268,6 +273,7 @@ int ha_key_cmp(register HA_KEYSEG *keyseg, register uchar *a,
return
((
keyseg
->
flag
&
HA_REVERSE_SORT
)
?
-
flag
:
flag
);
a
=
end
;
b
+=
3
;
key_length
-=
keyseg
->
length
;
break
;
case
HA_KEYTYPE_FLOAT
:
mi_float4get
(
f_1
,
a
);
...
...
@@ -276,6 +282,7 @@ int ha_key_cmp(register HA_KEYSEG *keyseg, register uchar *a,
return
((
keyseg
->
flag
&
HA_REVERSE_SORT
)
?
-
flag
:
flag
);
a
=
end
;
b
+=
4
;
/* sizeof(float); */
key_length
-=
keyseg
->
length
;
break
;
case
HA_KEYTYPE_DOUBLE
:
mi_float8get
(
d_1
,
a
);
...
...
@@ -284,6 +291,7 @@ int ha_key_cmp(register HA_KEYSEG *keyseg, register uchar *a,
return
((
keyseg
->
flag
&
HA_REVERSE_SORT
)
?
-
flag
:
flag
);
a
=
end
;
b
+=
8
;
/* sizeof(double); */
key_length
-=
keyseg
->
length
;
break
;
case
HA_KEYTYPE_NUM
:
/* Numeric key */
{
...
...
@@ -300,7 +308,7 @@ int ha_key_cmp(register HA_KEYSEG *keyseg, register uchar *a,
{
alength
=
*
a
++
;
blength
=
*
b
++
;
end
=
a
+
alength
;
next_key_length
=
key_length
-
blength
-
1
;
key_length
-=
blength
+
1
;
}
else
{
...
...
@@ -309,6 +317,7 @@ int ha_key_cmp(register HA_KEYSEG *keyseg, register uchar *a,
/* remove pre space from keys */
for
(
;
alength
&&
*
a
==
' '
;
a
++
,
alength
--
)
;
for
(
;
blength
&&
*
b
==
' '
;
b
++
,
blength
--
)
;
key_length
-=
keyseg
->
length
;
}
if
(
piks
)
...
...
@@ -360,6 +369,7 @@ int ha_key_cmp(register HA_KEYSEG *keyseg, register uchar *a,
return
((
keyseg
->
flag
&
HA_REVERSE_SORT
)
?
-
flag
:
flag
);
a
=
end
;
b
+=
8
;
key_length
-=
keyseg
->
length
;
break
;
}
case
HA_KEYTYPE_ULONGLONG
:
...
...
@@ -371,6 +381,7 @@ int ha_key_cmp(register HA_KEYSEG *keyseg, register uchar *a,
return
((
keyseg
->
flag
&
HA_REVERSE_SORT
)
?
-
flag
:
flag
);
a
=
end
;
b
+=
8
;
key_length
-=
keyseg
->
length
;
break
;
}
#endif
...
...
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