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
ba62e1a7
Commit
ba62e1a7
authored
Nov 19, 2002
by
ram@mysql.r18.ru
Browse files
Options
Browse Files
Download
Plain Diff
Merge rkalimullin@work.mysql.com:/home/bk/mysql-4.1
into mysql.r18.ru:/usr/home/ram/mysql-4.1.bdb
parents
c57be845
5991e3fc
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
65 additions
and
0 deletions
+65
-0
heap/hp_create.c
heap/hp_create.c
+16
-0
heap/hp_hash.c
heap/hp_hash.c
+49
-0
No files found.
heap/hp_create.c
View file @
ba62e1a7
...
...
@@ -55,6 +55,22 @@ int heap_create(const char *name, uint keys, HP_KEYDEF *keydef,
if
(
keyinfo
->
algorithm
==
HA_KEY_ALG_BTREE
)
keyinfo
->
rb_tree
.
size_of_element
++
;
}
switch
(
keyinfo
->
seg
[
j
].
type
)
{
case
HA_KEYTYPE_SHORT_INT
:
case
HA_KEYTYPE_LONG_INT
:
case
HA_KEYTYPE_FLOAT
:
case
HA_KEYTYPE_DOUBLE
:
case
HA_KEYTYPE_USHORT_INT
:
case
HA_KEYTYPE_ULONG_INT
:
case
HA_KEYTYPE_LONGLONG
:
case
HA_KEYTYPE_ULONGLONG
:
case
HA_KEYTYPE_INT24
:
case
HA_KEYTYPE_UINT24
:
case
HA_KEYTYPE_INT8
:
keyinfo
->
seg
[
j
].
flag
|=
HA_SWAP_KEY
;
default:
break
;
}
}
keyinfo
->
length
=
length
;
length
+=
keyinfo
->
rb_tree
.
size_of_element
+
...
...
heap/hp_hash.c
View file @
ba62e1a7
...
...
@@ -443,6 +443,43 @@ uint hp_rb_make_key(HP_KEYDEF *keydef, byte *key,
if
(
!
(
*
key
++=
1
-
test
(
rec
[
seg
->
null_pos
]
&
seg
->
null_bit
)))
continue
;
}
if
(
seg
->
flag
&
HA_SWAP_KEY
)
{
uint
length
=
seg
->
length
;
byte
*
pos
=
(
byte
*
)
rec
+
seg
->
start
;
#ifdef HAVE_ISNAN
if
(
seg
->
type
==
HA_KEYTYPE_FLOAT
)
{
float
nr
;
float4get
(
nr
,
pos
);
if
(
isnan
(
nr
))
{
/* Replace NAN with zero */
bzero
(
key
,
length
);
key
+=
length
;
continue
;
}
}
else
if
(
seg
->
type
==
HA_KEYTYPE_DOUBLE
)
{
double
nr
;
float8get
(
nr
,
pos
);
if
(
isnan
(
nr
))
{
bzero
(
key
,
length
);
key
+=
length
;
continue
;
}
}
#endif
pos
+=
length
;
while
(
length
--
)
{
*
key
++=
*--
pos
;
}
continue
;
}
memcpy
(
key
,
rec
+
seg
->
start
,
(
size_t
)
seg
->
length
);
key
+=
seg
->
length
;
}
...
...
@@ -467,6 +504,18 @@ uint hp_rb_pack_key(HP_KEYDEF *keydef, uchar *key, const uchar *old, uint k_len)
continue
;
}
}
if
(
seg
->
flag
&
HA_SWAP_KEY
)
{
uint
length
=
seg
->
length
;
byte
*
pos
=
(
byte
*
)
old
+
length
;
k_len
-=
length
;
while
(
length
--
)
{
*
key
++=
*--
pos
;
}
continue
;
}
memcpy
((
byte
*
)
key
,
old
,
seg
->
length
);
key
+=
seg
->
length
;
k_len
-=
seg
->
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