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
b8a12a8c
Commit
b8a12a8c
authored
Apr 25, 2002
by
ram@gw.udmsearch.izhnet.ru
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
MI_KEYSEG -> HA_KEYSEG
_mi_key_cmp -> ha_key_cmp
parent
eab2893d
Changes
38
Show whitespace changes
Inline
Side-by-side
Showing
38 changed files
with
106 additions
and
105 deletions
+106
-105
BitKeeper/etc/logging_ok
BitKeeper/etc/logging_ok
+1
-0
heap/heapdef.h
heap/heapdef.h
+1
-1
heap/hp_hash.c
heap/hp_hash.c
+10
-10
heap/hp_open.c
heap/hp_open.c
+3
-3
heap/hp_test1.c
heap/hp_test1.c
+1
-1
heap/hp_test2.c
heap/hp_test2.c
+1
-1
include/heap.h
include/heap.h
+1
-1
include/my_handler.h
include/my_handler.h
+4
-4
include/myisam.h
include/myisam.h
+3
-3
myisam/ft_eval.h
myisam/ft_eval.h
+1
-1
myisam/ft_static.c
myisam/ft_static.c
+1
-1
myisam/ft_test1.c
myisam/ft_test1.c
+1
-1
myisam/ftdefs.h
myisam/ftdefs.h
+1
-1
myisam/fulltext.h
myisam/fulltext.h
+1
-1
myisam/mi_check.c
myisam/mi_check.c
+8
-8
myisam/mi_create.c
myisam/mi_create.c
+4
-4
myisam/mi_dbug.c
myisam/mi_dbug.c
+1
-1
myisam/mi_key.c
myisam/mi_key.c
+4
-4
myisam/mi_open.c
myisam/mi_open.c
+5
-5
myisam/mi_rnext_same.c
myisam/mi_rnext_same.c
+1
-1
myisam/mi_search.c
myisam/mi_search.c
+11
-11
myisam/mi_test1.c
myisam/mi_test1.c
+2
-2
myisam/mi_test2.c
myisam/mi_test2.c
+2
-2
myisam/mi_test3.c
myisam/mi_test3.c
+1
-1
myisam/mi_unique.c
myisam/mi_unique.c
+2
-2
myisam/mi_write.c
myisam/mi_write.c
+1
-1
myisam/myisamchk.c
myisam/myisamchk.c
+1
-1
myisam/myisamdef.h
myisam/myisamdef.h
+7
-7
myisam/rt_mbr.c
myisam/rt_mbr.c
+7
-7
myisam/rt_mbr.h
myisam/rt_mbr.h
+7
-7
myisam/rt_test.c
myisam/rt_test.c
+1
-1
myisam/sp_key.c
myisam/sp_key.c
+1
-1
myisam/sp_test.c
myisam/sp_test.c
+1
-1
myisammrg/myrg_queue.c
myisammrg/myrg_queue.c
+1
-1
mysys/my_handler.c
mysys/my_handler.c
+2
-2
sql/ha_heap.cc
sql/ha_heap.cc
+3
-3
sql/ha_myisam.cc
sql/ha_myisam.cc
+2
-2
sql/sql_select.cc
sql/sql_select.cc
+1
-1
No files found.
BitKeeper/etc/logging_ok
View file @
b8a12a8c
...
...
@@ -53,3 +53,4 @@ tonu@x3.internalnet
venu@work.mysql.com
zak@balfor.local
zak@linux.local
ram@gw.udmsearch.izhnet.ru
heap/heapdef.h
View file @
b8a12a8c
...
...
@@ -42,7 +42,7 @@ typedef struct st_hp_hash_info
}
HASH_INFO
;
typedef
struct
{
MI
_KEYSEG
*
keyseg
;
HA
_KEYSEG
*
keyseg
;
uint
key_length
;
uint
search_flag
;
}
heap_rb_param
;
...
...
heap/hp_hash.c
View file @
b8a12a8c
...
...
@@ -195,7 +195,7 @@ ulong hp_hashnr(register HP_KEYDEF *keydef, register const byte *key)
{
/*register*/
ulong
nr
=
1
,
nr2
=
4
;
MI
_KEYSEG
*
seg
,
*
endseg
;
HA
_KEYSEG
*
seg
,
*
endseg
;
for
(
seg
=
keydef
->
seg
,
endseg
=
seg
+
keydef
->
keysegs
;
seg
<
endseg
;
seg
++
)
{
...
...
@@ -242,7 +242,7 @@ ulong hp_rec_hashnr(register HP_KEYDEF *keydef, register const byte *rec)
{
/*register*/
ulong
nr
=
1
,
nr2
=
4
;
MI
_KEYSEG
*
seg
,
*
endseg
;
HA
_KEYSEG
*
seg
,
*
endseg
;
for
(
seg
=
keydef
->
seg
,
endseg
=
seg
+
keydef
->
keysegs
;
seg
<
endseg
;
seg
++
)
{
...
...
@@ -300,7 +300,7 @@ ulong hp_rec_hashnr(register HP_KEYDEF *keydef, register const byte *rec)
ulong
hp_hashnr
(
register
HP_KEYDEF
*
keydef
,
register
const
byte
*
key
)
{
register
ulong
nr
=
0
;
MI
_KEYSEG
*
seg
,
*
endseg
;
HA
_KEYSEG
*
seg
,
*
endseg
;
for
(
seg
=
keydef
->
seg
,
endseg
=
seg
+
keydef
->
keysegs
;
seg
<
endseg
;
seg
++
)
{
...
...
@@ -341,7 +341,7 @@ ulong hp_hashnr(register HP_KEYDEF *keydef, register const byte *key)
ulong
hp_rec_hashnr
(
register
HP_KEYDEF
*
keydef
,
register
const
byte
*
rec
)
{
register
ulong
nr
=
0
;
MI
_KEYSEG
*
seg
,
*
endseg
;
HA
_KEYSEG
*
seg
,
*
endseg
;
for
(
seg
=
keydef
->
seg
,
endseg
=
seg
+
keydef
->
keysegs
;
seg
<
endseg
;
seg
++
)
{
...
...
@@ -381,7 +381,7 @@ ulong hp_rec_hashnr(register HP_KEYDEF *keydef, register const byte *rec)
int
hp_rec_key_cmp
(
HP_KEYDEF
*
keydef
,
const
byte
*
rec1
,
const
byte
*
rec2
)
{
MI
_KEYSEG
*
seg
,
*
endseg
;
HA
_KEYSEG
*
seg
,
*
endseg
;
for
(
seg
=
keydef
->
seg
,
endseg
=
seg
+
keydef
->
keysegs
;
seg
<
endseg
;
seg
++
)
{
...
...
@@ -412,7 +412,7 @@ int hp_rec_key_cmp(HP_KEYDEF *keydef, const byte *rec1, const byte *rec2)
int
hp_key_cmp
(
HP_KEYDEF
*
keydef
,
const
byte
*
rec
,
const
byte
*
key
)
{
MI
_KEYSEG
*
seg
,
*
endseg
;
HA
_KEYSEG
*
seg
,
*
endseg
;
for
(
seg
=
keydef
->
seg
,
endseg
=
seg
+
keydef
->
keysegs
;
seg
<
endseg
;
...
...
@@ -450,7 +450,7 @@ int hp_key_cmp(HP_KEYDEF *keydef, const byte *rec, const byte *key)
void
hp_make_key
(
HP_KEYDEF
*
keydef
,
byte
*
key
,
const
byte
*
rec
)
{
MI
_KEYSEG
*
seg
,
*
endseg
;
HA
_KEYSEG
*
seg
,
*
endseg
;
for
(
seg
=
keydef
->
seg
,
endseg
=
seg
+
keydef
->
keysegs
;
seg
<
endseg
;
seg
++
)
{
...
...
@@ -464,7 +464,7 @@ void hp_make_key(HP_KEYDEF *keydef, byte *key, const byte *rec)
void
hp_rb_make_key
(
HP_KEYDEF
*
keydef
,
byte
*
key
,
const
byte
*
rec
,
byte
*
recpos
)
{
MI
_KEYSEG
*
seg
,
*
endseg
;
HA
_KEYSEG
*
seg
,
*
endseg
;
/* -1 means that HA_KEYTYPE_END segment will not copy */
for
(
seg
=
keydef
->
seg
,
endseg
=
seg
+
keydef
->
keysegs
-
1
;
seg
<
endseg
;
...
...
@@ -481,7 +481,7 @@ void hp_rb_make_key(HP_KEYDEF *keydef, byte *key,
uint
hp_rb_pack_key
(
HP_INFO
*
info
,
uint
inx
,
uchar
*
key
,
const
uchar
*
old
,
uint
k_length
)
{
MI
_KEYSEG
*
seg
,
*
endseg
;
HA
_KEYSEG
*
seg
,
*
endseg
;
uchar
*
start_key
=
key
;
HP_KEYDEF
*
keydef
=
info
->
s
->
keydef
+
inx
;
...
...
@@ -508,7 +508,7 @@ uint hp_rb_pack_key(HP_INFO *info, uint inx, uchar *key, const uchar *old,
my_bool
hp_if_null_in_key
(
HP_KEYDEF
*
keydef
,
const
byte
*
record
)
{
MI
_KEYSEG
*
seg
,
*
endseg
;
HA
_KEYSEG
*
seg
,
*
endseg
;
for
(
seg
=
keydef
->
seg
,
endseg
=
seg
+
keydef
->
keysegs
;
seg
<
endseg
;
seg
++
)
{
if
(
seg
->
null_bit
&&
(
record
[
seg
->
null_pos
]
&
seg
->
null_bit
))
...
...
heap/hp_open.c
View file @
b8a12a8c
...
...
@@ -41,7 +41,7 @@ HP_INFO *heap_open(const char *name, int mode, uint keys, HP_KEYDEF *keydef,
uint
i
,
j
,
key_segs
,
max_length
,
length
;
HP_INFO
*
info
;
HP_SHARE
*
share
;
MI
_KEYSEG
*
keyseg
;
HA
_KEYSEG
*
keyseg
;
DBUG_ENTER
(
"heap_open"
);
...
...
@@ -72,14 +72,14 @@ HP_INFO *heap_open(const char *name, int mode, uint keys, HP_KEYDEF *keydef,
}
if
(
!
(
share
=
(
HP_SHARE
*
)
my_malloc
((
uint
)
sizeof
(
HP_SHARE
)
+
keys
*
sizeof
(
HP_KEYDEF
)
+
key_segs
*
sizeof
(
MI
_KEYSEG
),
key_segs
*
sizeof
(
HA
_KEYSEG
),
MYF
(
MY_ZEROFILL
))))
{
pthread_mutex_unlock
(
&
THR_LOCK_heap
);
DBUG_RETURN
(
0
);
}
share
->
keydef
=
(
HP_KEYDEF
*
)
(
share
+
1
);
keyseg
=
(
MI
_KEYSEG
*
)
(
share
->
keydef
+
keys
);
keyseg
=
(
HA
_KEYSEG
*
)
(
share
->
keydef
+
keys
);
init_block
(
&
share
->
block
,
reclength
+
1
,
min_records
,
max_records
);
/* Fix keys */
memcpy
(
share
->
keydef
,
keydef
,(
size_t
)
(
sizeof
(
keydef
[
0
])
*
keys
));
...
...
heap/hp_test1.c
View file @
b8a12a8c
...
...
@@ -36,7 +36,7 @@ int main(int argc, char **argv)
char
record
[
128
],
key
[
32
];
const
char
*
filename
;
HP_KEYDEF
keyinfo
[
10
];
MI
_KEYSEG
keyseg
[
4
];
HA
_KEYSEG
keyseg
[
4
];
MY_INIT
(
argv
[
0
]);
filename
=
"test1"
;
...
...
heap/hp_test2.c
View file @
b8a12a8c
...
...
@@ -61,7 +61,7 @@ int main(int argc, char *argv[])
const
char
*
filename
,
*
filename2
;
HP_INFO
*
file
,
*
file2
;
HP_KEYDEF
keyinfo
[
MAX_KEYS
];
MI
_KEYSEG
keyseg
[
MAX_KEYS
*
5
];
HA
_KEYSEG
keyseg
[
MAX_KEYS
*
5
];
HEAP_PTR
position
;
MY_INIT
(
argv
[
0
]);
/* init my_sys library & pthreads */
LINT_INIT
(
position
);
...
...
include/heap.h
View file @
b8a12a8c
...
...
@@ -85,7 +85,7 @@ typedef struct st_hp_keydef /* Key definition with open */
uint
length
;
/* Length of key (automatic) */
uint8
algorithm
;
/* HASH / BTREE */
uint
ref_offs
;
/* Data reference offset */
MI
_KEYSEG
*
seg
;
HA
_KEYSEG
*
seg
;
HP_BLOCK
block
;
/* Where keys are saved */
TREE
rb_tree
;
int
(
*
write_key
)(
struct
st_heap_info
*
info
,
struct
st_hp_keydef
*
keyinfo
,
...
...
include/my_handler.h
View file @
b8a12a8c
...
...
@@ -23,7 +23,7 @@
#include "m_ctype.h"
#include "myisampack.h"
typedef
struct
st_
MI
_KEYSEG
/* Key-portion */
typedef
struct
st_
HA
_KEYSEG
/* Key-portion */
{
uint8
type
;
/* Type of key (for sort) */
uint8
language
;
...
...
@@ -34,7 +34,7 @@ typedef struct st_MI_KEYSEG /* Key-portion */
uint32
start
;
/* Start of key in record */
uint32
null_pos
;
/* position to NULL indicator */
CHARSET_INFO
*
charset
;
}
MI
_KEYSEG
;
}
HA
_KEYSEG
;
#define get_key_length(length,key) \
{ if ((uchar) *(key) != 255) \
...
...
@@ -52,11 +52,11 @@ typedef struct st_MI_KEYSEG /* Key-portion */
extern
int
_mi_compare_text
(
CHARSET_INFO
*
,
uchar
*
,
uint
,
uchar
*
,
uint
,
my_bool
);
extern
int
_mi_key_cmp
(
register
MI
_KEYSEG
*
keyseg
,
register
uchar
*
a
,
extern
int
ha_key_cmp
(
register
HA
_KEYSEG
*
keyseg
,
register
uchar
*
a
,
register
uchar
*
b
,
uint
key_length
,
uint
nextflag
,
uint
*
diff_pos
);
extern
int
hp_rb_key_cmp
(
register
MI
_KEYSEG
*
keyseg
,
register
uchar
*
a
,
extern
int
hp_rb_key_cmp
(
register
HA
_KEYSEG
*
keyseg
,
register
uchar
*
a
,
register
uchar
*
b
,
uint
key_length
,
uint
nextflag
,
uint
*
diff_pos
);
...
...
include/myisam.h
View file @
b8a12a8c
...
...
@@ -122,7 +122,7 @@ typedef struct st_mi_keydef /* Key definition with open & info */
uint16
block_size
;
/* block_size (auto) */
uint32
version
;
/* For concurrent read/write */
MI
_KEYSEG
*
seg
,
*
end
;
HA
_KEYSEG
*
seg
,
*
end
;
int
(
*
bin_search
)(
struct
st_myisam_info
*
info
,
struct
st_mi_keydef
*
keyinfo
,
uchar
*
page
,
uchar
*
key
,
uint
key_len
,
uint
comp_flag
,
uchar
*
*
ret_pos
,
...
...
@@ -146,7 +146,7 @@ typedef struct st_unique_def /* Segment definition of unique */
uint16
keysegs
;
/* Number of key-segment */
uchar
key
;
/* Mapped to which key */
uint8
null_are_equal
;
MI
_KEYSEG
*
seg
,
*
end
;
HA
_KEYSEG
*
seg
,
*
end
;
}
MI_UNIQUEDEF
;
typedef
struct
st_mi_decode_tree
/* Decode huff-table */
...
...
@@ -318,7 +318,7 @@ typedef struct st_sort_info {
char
*
record
,
*
buff
;
void
*
wordlist
,
*
wordptr
;
MI_KEYDEF
*
keyinfo
;
MI
_KEYSEG
*
keyseg
;
HA
_KEYSEG
*
keyseg
;
}
SORT_INFO
;
typedef
struct
st_mi_check_param
...
...
myisam/ft_eval.h
View file @
b8a12a8c
...
...
@@ -33,7 +33,7 @@ FILE *df,*qf;
MI_COLUMNDEF
recinfo
[
3
];
MI_KEYDEF
keyinfo
[
2
];
MI
_KEYSEG
keyseg
[
10
];
HA
_KEYSEG
keyseg
[
10
];
#define SWL_INIT 500
#define SWL_PLUS 50
...
...
myisam/ft_static.c
View file @
b8a12a8c
...
...
@@ -23,7 +23,7 @@ ulong ft_max_word_len=HA_FT_MAXLEN;
ulong
ft_max_word_len_for_sort
=
20
;
const
char
*
ft_boolean_syntax
=
"+ -><()~*:
\"\"
&|"
;
const
MI
_KEYSEG
ft_keysegs
[
FT_SEGS
]
=
{
const
HA
_KEYSEG
ft_keysegs
[
FT_SEGS
]
=
{
{
HA_KEYTYPE_VARTEXT
,
/* type */
7
,
/* language (will be overwritten) */
...
...
myisam/ft_test1.c
View file @
b8a12a8c
...
...
@@ -45,7 +45,7 @@ int main(int argc,char *argv[])
static
MI_COLUMNDEF
recinfo
[
3
];
static
MI_KEYDEF
keyinfo
[
2
];
static
MI
_KEYSEG
keyseg
[
10
];
static
HA
_KEYSEG
keyseg
[
10
];
static
int
run_test
(
const
char
*
filename
)
{
...
...
myisam/ftdefs.h
View file @
b8a12a8c
...
...
@@ -122,7 +122,7 @@ byte ft_simple_get_word(byte **, byte *, FT_WORD *);
typedef
struct
_st_ft_seg_iterator
{
uint
num
,
len
;
MI
_KEYSEG
*
seg
;
HA
_KEYSEG
*
seg
;
const
byte
*
rec
,
*
pos
;
}
FT_SEG_ITERATOR
;
...
...
myisam/fulltext.h
View file @
b8a12a8c
...
...
@@ -32,7 +32,7 @@
#define FT_SEGS 2
#endif
/* EVAL_RUN */
extern
const
MI
_KEYSEG
ft_keysegs
[
FT_SEGS
];
extern
const
HA
_KEYSEG
ft_keysegs
[
FT_SEGS
];
int
_mi_ft_cmp
(
MI_INFO
*
,
uint
,
const
byte
*
,
const
byte
*
);
int
_mi_ft_add
(
MI_INFO
*
,
uint
,
byte
*
,
const
byte
*
,
my_off_t
);
...
...
myisam/mi_check.c
View file @
b8a12a8c
...
...
@@ -588,7 +588,7 @@ static int chk_index(MI_CHECK *param, MI_INFO *info, MI_KEYDEF *keyinfo,
goto
err
;
}
if
((
*
keys
)
++
&&
(
flag
=
_mi
_key_cmp
(
keyinfo
->
seg
,
info
->
lastkey
,
key
,
key_length
,
(
flag
=
ha
_key_cmp
(
keyinfo
->
seg
,
info
->
lastkey
,
key
,
key_length
,
comp_flag
,
&
not_used
))
>=
0
)
{
DBUG_DUMP
(
"old"
,(
byte
*
)
info
->
lastkey
,
info
->
lastkey_length
);
...
...
@@ -606,7 +606,7 @@ static int chk_index(MI_CHECK *param, MI_INFO *info, MI_KEYDEF *keyinfo,
if
(
*
keys
!=
1L
)
/* not first_key */
{
uint
diff
;
_mi
_key_cmp
(
keyinfo
->
seg
,
info
->
lastkey
,
key
,
USE_WHOLE_KEY
,
SEARCH_FIND
,
ha
_key_cmp
(
keyinfo
->
seg
,
info
->
lastkey
,
key
,
USE_WHOLE_KEY
,
SEARCH_FIND
,
&
diff
);
param
->
unique_count
[
diff
-
1
]
++
;
}
...
...
@@ -674,7 +674,7 @@ static ha_checksum calc_checksum(ha_rows count)
static
uint
isam_key_length
(
MI_INFO
*
info
,
register
MI_KEYDEF
*
keyinfo
)
{
uint
length
;
MI
_KEYSEG
*
keyseg
;
HA
_KEYSEG
*
keyseg
;
DBUG_ENTER
(
"isam_key_length"
);
length
=
info
->
s
->
rec_reflength
;
...
...
@@ -2625,7 +2625,7 @@ int sort_write_record(SORT_INFO *sort_info)
static
int
sort_key_cmp
(
SORT_INFO
*
sort_info
,
const
void
*
a
,
const
void
*
b
)
{
uint
not_used
;
return
(
_mi
_key_cmp
(
sort_info
->
keyseg
,
*
((
uchar
**
)
a
),
*
((
uchar
**
)
b
),
return
(
ha
_key_cmp
(
sort_info
->
keyseg
,
*
((
uchar
**
)
a
),
*
((
uchar
**
)
b
),
USE_WHOLE_KEY
,
SEARCH_SAME
,
&
not_used
));
}
/* sort_key_cmp */
...
...
@@ -2639,7 +2639,7 @@ static int sort_key_write(SORT_INFO *sort_info, const void *a)
if
(
sort_info
->
key_block
->
inited
)
{
cmp
=
_mi
_key_cmp
(
sort_info
->
keyseg
,
sort_info
->
key_block
->
lastkey
,(
uchar
*
)
a
,
cmp
=
ha
_key_cmp
(
sort_info
->
keyseg
,
sort_info
->
key_block
->
lastkey
,(
uchar
*
)
a
,
USE_WHOLE_KEY
,
SEARCH_FIND
|
SEARCH_UPDATE
,
&
diff_pos
);
sort_info
->
unique
[
diff_pos
-
1
]
++
;
}
...
...
@@ -2922,7 +2922,7 @@ int recreate_table(MI_CHECK *param, MI_INFO **org_info, char *filename)
MI_INFO
info
;
MYISAM_SHARE
share
;
MI_KEYDEF
*
keyinfo
,
*
key
,
*
key_end
;
MI
_KEYSEG
*
keysegs
,
*
keyseg
;
HA
_KEYSEG
*
keysegs
,
*
keyseg
;
MI_COLUMNDEF
*
recdef
,
*
rec
,
*
end
;
MI_UNIQUEDEF
*
uniquedef
,
*
u_ptr
,
*
u_end
;
MI_STATUS_INFO
status_info
;
...
...
@@ -2944,7 +2944,7 @@ int recreate_table(MI_CHECK *param, MI_INFO **org_info, char *filename)
(
size_t
)
(
sizeof
(
MI_KEYDEF
)
*
share
.
base
.
keys
));
key_parts
=
share
.
base
.
all_key_parts
;
if
(
!
(
keysegs
=
(
MI_KEYSEG
*
)
my_alloca
(
sizeof
(
MI
_KEYSEG
)
*
if
(
!
(
keysegs
=
(
HA_KEYSEG
*
)
my_alloca
(
sizeof
(
HA
_KEYSEG
)
*
(
key_parts
+
share
.
base
.
keys
))))
{
my_afree
((
gptr
)
keyinfo
);
...
...
@@ -2980,7 +2980,7 @@ int recreate_table(MI_CHECK *param, MI_INFO **org_info, char *filename)
/* Change the new key to point at the saved key segments */
memcpy
((
byte
*
)
keysegs
,(
byte
*
)
share
.
keyparts
,
(
size_t
)
(
sizeof
(
MI
_KEYSEG
)
*
(
key_parts
+
share
.
base
.
keys
+
(
size_t
)
(
sizeof
(
HA
_KEYSEG
)
*
(
key_parts
+
share
.
base
.
keys
+
share
.
state
.
header
.
uniques
)));
keyseg
=
keysegs
;
for
(
key
=
keyinfo
,
key_end
=
keyinfo
+
share
.
base
.
keys
;
key
!=
key_end
;
key
++
)
...
...
myisam/mi_create.c
View file @
b8a12a8c
...
...
@@ -53,7 +53,7 @@ int mi_create(const char *name,uint keys,MI_KEYDEF *keydefs,
MYISAM_SHARE
share
;
MI_KEYDEF
*
keydef
,
tmp_keydef
;
MI_UNIQUEDEF
*
uniquedef
;
MI
_KEYSEG
*
keyseg
,
tmp_keyseg
;
HA
_KEYSEG
*
keyseg
,
tmp_keyseg
;
MI_COLUMNDEF
*
rec
;
ulong
*
rec_per_key_part
;
my_off_t
key_root
[
MI_MAX_POSSIBLE_KEY
],
key_del
[
MI_MAX_KEY_BLOCK_SIZE
];
...
...
@@ -440,7 +440,7 @@ int mi_create(const char *name,uint keys,MI_KEYDEF *keydefs,
info_length
=
base_pos
+
(
uint
)
(
MI_BASE_INFO_SIZE
+
keys
*
MI_KEYDEF_SIZE
+
uniques
*
MI_UNIQUEDEF_SIZE
+
(
key_segs
+
unique_key_parts
)
*
MI
_KEYSEG_SIZE
+
(
key_segs
+
unique_key_parts
)
*
HA
_KEYSEG_SIZE
+
columns
*
MI_COLUMNDEF_SIZE
);
bmove
(
share
.
state
.
header
.
file_version
,(
byte
*
)
myisam_file_magic
,
4
);
...
...
@@ -596,14 +596,14 @@ int mi_create(const char *name,uint keys,MI_KEYDEF *keydefs,
goto
err
;
for
(
j
=
0
;
j
<
ft_segs
;
j
++
)
{
MI
_KEYSEG
seg
=
ft_keysegs
[
j
];
HA
_KEYSEG
seg
=
ft_keysegs
[
j
];
seg
.
language
=
keydefs
[
i
].
seg
[
0
].
language
;
if
(
mi_keyseg_write
(
file
,
&
seg
))
goto
err
;
}
for
(
j
=
0
;
j
<
sp_segs
;
j
++
)
{
MI
_KEYSEG
sseg
;
HA
_KEYSEG
sseg
;
sseg
.
type
=
SPTYPE
;
sseg
.
language
=
7
;
sseg
.
null_bit
=
0
;
...
...
myisam/mi_dbug.c
View file @
b8a12a8c
...
...
@@ -20,7 +20,7 @@
/* Print a key in user understandable format */
void
_mi_print_key
(
FILE
*
stream
,
register
MI
_KEYSEG
*
keyseg
,
void
_mi_print_key
(
FILE
*
stream
,
register
HA
_KEYSEG
*
keyseg
,
const
uchar
*
key
,
uint
length
)
{
int
flag
;
...
...
myisam/mi_key.c
View file @
b8a12a8c
...
...
@@ -37,7 +37,7 @@ uint _mi_make_key(register MI_INFO *info, uint keynr, uchar *key,
{
byte
*
pos
,
*
end
;
uchar
*
start
;
reg1
MI
_KEYSEG
*
keyseg
;
reg1
HA
_KEYSEG
*
keyseg
;
DBUG_ENTER
(
"_mi_make_key"
);
if
(
info
->
s
->
keyinfo
[
keynr
].
flag
&
HA_SPATIAL
)
...
...
@@ -153,7 +153,7 @@ uint _mi_pack_key(register MI_INFO *info, uint keynr, uchar *key, uchar *old,
{
uint
length
;
uchar
*
pos
,
*
end
,
*
start_key
=
key
;
reg1
MI
_KEYSEG
*
keyseg
;
reg1
HA
_KEYSEG
*
keyseg
;
enum
ha_base_keytype
type
;
DBUG_ENTER
(
"_mi_pack_key"
);
...
...
@@ -252,7 +252,7 @@ static int _mi_put_key_in_record(register MI_INFO *info, uint keynr,
{
reg2
byte
*
key
;
byte
*
pos
,
*
key_end
;
reg1
MI
_KEYSEG
*
keyseg
;
reg1
HA
_KEYSEG
*
keyseg
;
byte
*
blob_ptr
;
DBUG_ENTER
(
"_mi_put_key_in_record"
);
...
...
@@ -385,7 +385,7 @@ int _mi_read_key_record(MI_INFO *info, my_off_t filepos, byte *buf)
void
update_auto_increment
(
MI_INFO
*
info
,
const
byte
*
record
)
{
ulonglong
value
;
MI
_KEYSEG
*
keyseg
=
info
->
s
->
keyinfo
[
info
->
s
->
base
.
auto_key
-
1
].
seg
;
HA
_KEYSEG
*
keyseg
=
info
->
s
->
keyinfo
[
info
->
s
->
base
.
auto_key
-
1
].
seg
;
const
uchar
*
key
=
(
uchar
*
)
record
+
keyseg
->
start
;
switch
(
keyseg
->
type
)
{
...
...
myisam/mi_open.c
View file @
b8a12a8c
...
...
@@ -256,7 +256,7 @@ MI_INFO *mi_open(const char *name, int mode, uint open_flags)
&
share
->
uniqueinfo
,
uniques
*
sizeof
(
MI_UNIQUEDEF
),
&
share
->
keyparts
,
(
key_parts
+
unique_key_parts
+
keys
+
uniques
)
*
sizeof
(
MI
_KEYSEG
),
sizeof
(
HA
_KEYSEG
),
&
share
->
rec
,
(
share
->
base
.
fields
+
1
)
*
sizeof
(
MI_COLUMNDEF
),
&
share
->
blobs
,
sizeof
(
MI_BLOB
)
*
share
->
base
.
blobs
,
...
...
@@ -286,7 +286,7 @@ MI_INFO *mi_open(const char *name, int mode, uint open_flags)
share
->
blocksize
=
min
(
IO_SIZE
,
myisam_block_size
);
{
MI
_KEYSEG
*
pos
=
share
->
keyparts
;
HA
_KEYSEG
*
pos
=
share
->
keyparts
;
for
(
i
=
0
;
i
<
keys
;
i
++
)
{
disk_pos
=
mi_keydef_read
(
disk_pos
,
&
share
->
keyinfo
[
i
]);
...
...
@@ -949,9 +949,9 @@ char *mi_keydef_read(char *ptr, MI_KEYDEF *keydef)
** mi_keyseg
***************************************************************************/
int
mi_keyseg_write
(
File
file
,
const
MI
_KEYSEG
*
keyseg
)
int
mi_keyseg_write
(
File
file
,
const
HA
_KEYSEG
*
keyseg
)
{
uchar
buff
[
MI
_KEYSEG_SIZE
];
uchar
buff
[
HA
_KEYSEG_SIZE
];
uchar
*
ptr
=
buff
;
*
ptr
++
=
keyseg
->
type
;
...
...
@@ -969,7 +969,7 @@ int mi_keyseg_write(File file, const MI_KEYSEG *keyseg)
}
char
*
mi_keyseg_read
(
char
*
ptr
,
MI
_KEYSEG
*
keyseg
)
char
*
mi_keyseg_read
(
char
*
ptr
,
HA
_KEYSEG
*
keyseg
)
{
keyseg
->
type
=
*
ptr
++
;
keyseg
->
language
=
*
ptr
++
;
...
...
myisam/mi_rnext_same.c
View file @
b8a12a8c
...
...
@@ -60,7 +60,7 @@ int mi_rnext_same(MI_INFO *info, byte *buf)
info
->
lastkey_length
,
flag
,
info
->
s
->
state
.
key_root
[
inx
])))
break
;
if
(
_mi
_key_cmp
(
keyinfo
->
seg
,
info
->
lastkey2
,
info
->
lastkey
,
if
(
ha
_key_cmp
(
keyinfo
->
seg
,
info
->
lastkey2
,
info
->
lastkey
,
info
->
last_rkey_length
,
SEARCH_FIND
,
&
not_used
))
{
error
=
1
;
...
...
myisam/mi_search.c
View file @
b8a12a8c
...
...
@@ -133,7 +133,7 @@ int _mi_search(register MI_INFO *info, register MI_KEYDEF *keyinfo,
&
info
->
lastkey_length
))
goto
err
;
if
((
nextflag
&
SEARCH_LAST
)
&&
_mi
_key_cmp
(
keyinfo
->
seg
,
info
->
lastkey
,
key
,
key_len
,
SEARCH_FIND
,
ha
_key_cmp
(
keyinfo
->
seg
,
info
->
lastkey
,
key
,
key_len
,
SEARCH_FIND
,
&
not_used
))
{
my_errno
=
HA_ERR_KEY_NOT_FOUND
;
/* Didn't find key */
...
...
@@ -191,7 +191,7 @@ int _mi_bin_search(MI_INFO *info, register MI_KEYDEF *keyinfo, uchar *page,
while
(
start
!=
end
)
{
mid
=
(
start
+
end
)
/
2
;
if
((
flag
=
_mi
_key_cmp
(
keyinfo
->
seg
,
page
+
(
uint
)
mid
*
totlength
,
key
,
key_len
,
if
((
flag
=
ha
_key_cmp
(
keyinfo
->
seg
,
page
+
(
uint
)
mid
*
totlength
,
key
,
key_len
,
comp_flag
,
&
not_used
))
>=
0
)
end
=
mid
;
...
...
@@ -199,7 +199,7 @@ int _mi_bin_search(MI_INFO *info, register MI_KEYDEF *keyinfo, uchar *page,
start
=
mid
+
1
;
}
if
(
mid
!=
start
)
flag
=
_mi
_key_cmp
(
keyinfo
->
seg
,
page
+
(
uint
)
start
*
totlength
,
key
,
key_len
,
flag
=
ha
_key_cmp
(
keyinfo
->
seg
,
page
+
(
uint
)
start
*
totlength
,
key
,
key_len
,
comp_flag
,
&
not_used
);
if
(
flag
<
0
)
start
++
;
/* point at next, bigger key */
...
...
@@ -239,7 +239,7 @@ int _mi_seq_search(MI_INFO *info, register MI_KEYDEF *keyinfo, uchar *page,
length
,
page
,
end
));
DBUG_RETURN
(
MI_FOUND_WRONG_KEY
);
}
if
((
flag
=
_mi
_key_cmp
(
keyinfo
->
seg
,
t_buff
,
key
,
key_len
,
comp_flag
,
if
((
flag
=
ha
_key_cmp
(
keyinfo
->
seg
,
t_buff
,
key
,
key_len
,
comp_flag
,
&
not_used
))
>=
0
)
break
;
#ifdef EXTRA_DEBUG
...
...
@@ -262,7 +262,7 @@ int _mi_prefix_search(MI_INFO *info, register MI_KEYDEF *keyinfo, uchar *page,
{
/* my_flag is raw comparison result to be changed according to
SEARCH_NO_FIND,SEARCH_LAST and HA_REVERSE_SORT flags.
flag is the value returned by
_mi
_key_cmp and as treated as final */
flag is the value returned by
ha
_key_cmp and as treated as final */
int
flag
=
0
,
my_flag
=-
1
;
uint
nod_flag
,
length
,
len
,
matched
,
cmplen
,
kseg_len
;
uint
prefix_len
,
suffix_len
;
...
...
@@ -351,7 +351,7 @@ int _mi_prefix_search(MI_INFO *info, register MI_KEYDEF *keyinfo, uchar *page,
DBUG_PRINT
(
"loop"
,(
"page: '%.*s%.*s'"
,
prefix_len
,
t_buff
+
seg_len_pack
,
suffix_len
,
vseg
));
{
uchar
*
from
=
vseg
+
suffix_len
;
MI
_KEYSEG
*
keyseg
;
HA
_KEYSEG
*
keyseg
;
uint
l
;
for
(
keyseg
=
keyinfo
->
seg
+
1
;
keyseg
->
type
;
keyseg
++
)
...
...
@@ -423,7 +423,7 @@ int _mi_prefix_search(MI_INFO *info, register MI_KEYDEF *keyinfo, uchar *page,
else
if
(
key_len_left
>
0
)
{
uint
not_used
;
if
((
flag
=
_mi
_key_cmp
(
keyinfo
->
seg
+
1
,
vseg
,
if
((
flag
=
ha
_key_cmp
(
keyinfo
->
seg
+
1
,
vseg
,
k
,
key_len_left
,
nextflag
,
&
not_used
))
>=
0
)
break
;
}
...
...
@@ -674,7 +674,7 @@ uint _mi_get_static_key(register MI_KEYDEF *keyinfo, uint nod_flag,
uint
_mi_get_pack_key
(
register
MI_KEYDEF
*
keyinfo
,
uint
nod_flag
,
register
uchar
**
page_pos
,
register
uchar
*
key
)
{
reg1
MI
_KEYSEG
*
keyseg
;
reg1
HA
_KEYSEG
*
keyseg
;
uchar
*
start_key
,
*
page
=*
page_pos
;
uint
length
;
...
...
@@ -807,7 +807,7 @@ uint _mi_get_pack_key(register MI_KEYDEF *keyinfo, uint nod_flag,
uint
_mi_get_binary_pack_key
(
register
MI_KEYDEF
*
keyinfo
,
uint
nod_flag
,
register
uchar
**
page_pos
,
register
uchar
*
key
)
{
reg1
MI
_KEYSEG
*
keyseg
;
reg1
HA
_KEYSEG
*
keyseg
;
uchar
*
start_key
,
*
page
=*
page_pos
,
*
page_end
,
*
from
,
*
from_end
;
uint
length
,
tmp
;
...
...
@@ -1006,7 +1006,7 @@ uchar *_mi_get_last_key(MI_INFO *info, MI_KEYDEF *keyinfo, uchar *page,
uint
_mi_keylength
(
MI_KEYDEF
*
keyinfo
,
register
uchar
*
key
)
{
reg1
MI
_KEYSEG
*
keyseg
;
reg1
HA
_KEYSEG
*
keyseg
;
uchar
*
start
;
if
(
!
(
keyinfo
->
flag
&
(
HA_VAR_LENGTH_KEY
|
HA_BINARY_PACK_KEY
)))
...
...
@@ -1272,7 +1272,7 @@ _mi_calc_var_pack_key_length(MI_KEYDEF *keyinfo,uint nod_flag,uchar *next_key,
uchar
*
org_key
,
uchar
*
prev_key
,
uchar
*
key
,
MI_KEY_PARAM
*
s_temp
)
{
reg1
MI
_KEYSEG
*
keyseg
;
reg1
HA
_KEYSEG
*
keyseg
;
int
length
;
uint
key_length
,
ref_length
,
org_key_length
=
0
,
length_pack
,
new_key_length
,
diff_flag
,
pack_marker
;
...
...
myisam/mi_test1.c
View file @
b8a12a8c
...
...
@@ -33,8 +33,8 @@ static uint unique_key=HA_NOSAME,key_cacheing=0,opt_unique=0;
static
uint
silent
;
static
MI_COLUMNDEF
recinfo
[
4
];
static
MI_KEYDEF
keyinfo
[
10
];
static
MI
_KEYSEG
keyseg
[
10
];
static
MI
_KEYSEG
uniqueseg
[
10
];
static
HA
_KEYSEG
keyseg
[
10
];
static
HA
_KEYSEG
uniqueseg
[
10
];
static
int
run_test
(
const
char
*
filename
);
static
void
get_options
(
int
argc
,
char
*
argv
[]);
...
...
myisam/mi_test2.c
View file @
b8a12a8c
...
...
@@ -55,7 +55,7 @@ static uint use_blob=0;
static
uint16
key1
[
1001
],
key3
[
5000
];
static
char
record
[
300
],
record2
[
300
],
key
[
100
],
key2
[
100
],
read_record
[
300
],
read_record2
[
300
],
read_record3
[
300
];
static
MI
_KEYSEG
glob_keyseg
[
MYISAM_KEYS
][
MAX_PARTS
];
static
HA
_KEYSEG
glob_keyseg
[
MYISAM_KEYS
][
MAX_PARTS
];
/* Test program */
...
...
@@ -1006,7 +1006,7 @@ static void put_blob_in_record(char *blob_pos, char **blob_buffer)
static
void
copy_key
(
MI_INFO
*
info
,
uint
inx
,
uchar
*
rec
,
uchar
*
key_buff
)
{
MI
_KEYSEG
*
keyseg
;
HA
_KEYSEG
*
keyseg
;
for
(
keyseg
=
info
->
s
->
keyinfo
[
inx
].
seg
;
keyseg
->
type
;
keyseg
++
)
{
...
...
myisam/mi_test3.c
View file @
b8a12a8c
...
...
@@ -59,7 +59,7 @@ int main(int argc,char **argv)
uint
i
=
0
;
MI_KEYDEF
keyinfo
[
10
];
MI_COLUMNDEF
recinfo
[
10
];
MI
_KEYSEG
keyseg
[
10
][
2
];
HA
_KEYSEG
keyseg
[
10
][
2
];
MY_INIT
(
argv
[
0
]);
get_options
(
argc
,
argv
);
...
...
myisam/mi_unique.c
View file @
b8a12a8c
...
...
@@ -70,7 +70,7 @@ ha_checksum mi_unique_hash(MI_UNIQUEDEF *def, const byte *record)
{
const
byte
*
pos
,
*
end
;
ha_checksum
crc
=
0
;
MI
_KEYSEG
*
keyseg
;
HA
_KEYSEG
*
keyseg
;
for
(
keyseg
=
def
->
seg
;
keyseg
<
def
->
end
;
keyseg
++
)
{
...
...
@@ -122,7 +122,7 @@ int mi_unique_comp(MI_UNIQUEDEF *def, const byte *a, const byte *b,
my_bool
null_are_equal
)
{
const
byte
*
pos_a
,
*
pos_b
,
*
end
;
MI
_KEYSEG
*
keyseg
;
HA
_KEYSEG
*
keyseg
;
for
(
keyseg
=
def
->
seg
;
keyseg
<
def
->
end
;
keyseg
++
)
{
...
...
myisam/mi_write.c
View file @
b8a12a8c
...
...
@@ -764,7 +764,7 @@ int _mi_ck_write_tree(register MI_INFO *info, uint keynr, uchar *key,
static
int
keys_compare
(
bulk_insert_param
*
param
,
uchar
*
key1
,
uchar
*
key2
)
{
uint
not_used
;
return
_mi
_key_cmp
(
param
->
info
->
s
->
keyinfo
[
param
->
keynr
].
seg
,
return
ha
_key_cmp
(
param
->
info
->
s
->
keyinfo
[
param
->
keynr
].
seg
,
key1
,
key2
,
USE_WHOLE_KEY
,
SEARCH_SAME
,
&
not_used
);
}
...
...
myisam/myisamchk.c
View file @
b8a12a8c
...
...
@@ -1062,7 +1062,7 @@ static void descript(MI_CHECK *param, register MI_INFO *info, my_string name)
{
uint
key
,
keyseg_nr
,
field
,
start
;
reg3
MI_KEYDEF
*
keyinfo
;
reg2
MI
_KEYSEG
*
keyseg
;
reg2
HA
_KEYSEG
*
keyseg
;
reg4
const
char
*
text
;
char
buff
[
160
],
length
[
10
],
*
pos
,
*
end
;
enum
en_fieldtype
type
;
...
...
myisam/myisamdef.h
View file @
b8a12a8c
...
...
@@ -96,7 +96,7 @@ typedef struct st_mi_state_info
#define MI_STATE_EXTRA_SIZE ((MI_MAX_KEY+MI_MAX_KEY_BLOCK_SIZE)*MI_STATE_KEY_SIZE + MI_MAX_KEY*MI_MAX_KEY_SEG*MI_STATE_KEYSEG_SIZE)
#define MI_KEYDEF_SIZE (2+ 5*2)
#define MI_UNIQUEDEF_SIZE (2+1+1)
#define
MI
_KEYSEG_SIZE (6+ 2*2 + 4*2)
#define
HA
_KEYSEG_SIZE (6+ 2*2 + 4*2)
#define MI_COLUMNDEF_SIZE (2*3+1)
#define MI_BASE_INFO_SIZE (5*8 + 8*4 + 4 + 4*2 + 16)
#define MI_INDEX_BLOCK_MARGIN 16
/* Safety margin for .MYI tables */
...
...
@@ -156,7 +156,7 @@ typedef struct st_mi_isam_share { /* Shared between opens */
MI_BASE_INFO
base
;
MI_KEYDEF
*
keyinfo
;
/* Key definitions */
MI_UNIQUEDEF
*
uniqueinfo
;
/* unique definitions */
MI
_KEYSEG
*
keyparts
;
/* key part info */
HA
_KEYSEG
*
keyparts
;
/* key part info */
MI_COLUMNDEF
*
rec
;
/* Pointer to field information */
MI_PACK
pack
;
/* Data about packed records */
MI_BLOB
*
blobs
;
/* Pointer to blobs */
...
...
@@ -355,7 +355,7 @@ struct st_myisam_info {
#define PACK_TYPE_SELECTED 1
/* Bits in field->pack_type */
#define PACK_TYPE_SPACE_FIELDS 2
#define PACK_TYPE_ZERO_FILL 4
#define MI_FOUND_WRONG_KEY 32738
/* Impossible value from
_mi
_key_cmp */
#define MI_FOUND_WRONG_KEY 32738
/* Impossible value from
ha
_key_cmp */
#define MI_MAX_KEY_BLOCK_SIZE (MI_MAX_KEY_BLOCK_LENGTH/MI_MIN_KEY_BLOCK_LENGTH)
#define MI_BLOCK_SIZE(key_length,data_pointer,key_pointer) ((((key_length+data_pointer+key_pointer)*4+key_pointer+2)/myisam_block_size+1)*myisam_block_size)
...
...
@@ -475,7 +475,7 @@ extern void _mi_kpointer(MI_INFO *info,uchar *buff,my_off_t pos);
extern
my_off_t
_mi_dpos
(
MI_INFO
*
info
,
uint
nod_flag
,
uchar
*
after_key
);
extern
my_off_t
_mi_rec_pos
(
MYISAM_SHARE
*
info
,
uchar
*
ptr
);
extern
void
_mi_dpointer
(
MI_INFO
*
info
,
uchar
*
buff
,
my_off_t
pos
);
extern
int
_mi_key_cmp
(
MI
_KEYSEG
*
keyseg
,
uchar
*
a
,
uchar
*
b
,
extern
int
ha_key_cmp
(
HA
_KEYSEG
*
keyseg
,
uchar
*
a
,
uchar
*
b
,
uint
key_length
,
uint
nextflag
,
uint
*
diff_length
);
extern
uint
_mi_get_static_key
(
MI_KEYDEF
*
keyinfo
,
uint
nod_flag
,
uchar
*
*
page
,
uchar
*
key
);
...
...
@@ -515,7 +515,7 @@ extern my_bool _mi_rec_check(MI_INFO *info,const char *from);
extern
int
_mi_write_part_record
(
MI_INFO
*
info
,
my_off_t
filepos
,
ulong
length
,
my_off_t
next_filepos
,
byte
**
record
,
ulong
*
reclength
,
int
*
flag
);
extern
void
_mi_print_key
(
FILE
*
stream
,
MI
_KEYSEG
*
keyseg
,
const
uchar
*
key
,
extern
void
_mi_print_key
(
FILE
*
stream
,
HA
_KEYSEG
*
keyseg
,
const
uchar
*
key
,
uint
length
);
extern
my_bool
_mi_read_pack_info
(
MI_INFO
*
info
,
pbool
fix_keys
);
extern
int
_mi_read_pack_record
(
MI_INFO
*
info
,
my_off_t
filepos
,
byte
*
buf
);
...
...
@@ -606,8 +606,8 @@ char *mi_state_info_read(char *ptr, MI_STATE_INFO *state);
uint
mi_state_info_read_dsk
(
File
file
,
MI_STATE_INFO
*
state
,
my_bool
pRead
);
uint
mi_base_info_write
(
File
file
,
MI_BASE_INFO
*
base
);
char
*
my_n_base_info_read
(
char
*
ptr
,
MI_BASE_INFO
*
base
);
int
mi_keyseg_write
(
File
file
,
const
MI
_KEYSEG
*
keyseg
);
char
*
mi_keyseg_read
(
char
*
ptr
,
MI
_KEYSEG
*
keyseg
);
int
mi_keyseg_write
(
File
file
,
const
HA
_KEYSEG
*
keyseg
);
char
*
mi_keyseg_read
(
char
*
ptr
,
HA
_KEYSEG
*
keyseg
);
uint
mi_keydef_write
(
File
file
,
MI_KEYDEF
*
keydef
);
char
*
mi_keydef_read
(
char
*
ptr
,
MI_KEYDEF
*
keydef
);
uint
mi_uniquedef_write
(
File
file
,
MI_UNIQUEDEF
*
keydef
);
...
...
myisam/rt_mbr.c
View file @
b8a12a8c
...
...
@@ -93,7 +93,7 @@
MBR_DATA(a,b) Data reference is the same
Returns 0 on success.
*/
int
rtree_key_cmp
(
MI
_KEYSEG
*
keyseg
,
uchar
*
b
,
uchar
*
a
,
uint
key_length
,
int
rtree_key_cmp
(
HA
_KEYSEG
*
keyseg
,
uchar
*
b
,
uchar
*
a
,
uint
key_length
,
uint
nextflag
)
{
for
(;
(
int
)
key_length
>
0
;
keyseg
+=
2
)
...
...
@@ -186,7 +186,7 @@ int rtree_key_cmp(MI_KEYSEG *keyseg, uchar *b, uchar *a, uint key_length,
/*
Calculates rectangle volume
*/
double
rtree_rect_volume
(
MI
_KEYSEG
*
keyseg
,
uchar
*
a
,
uint
key_length
)
double
rtree_rect_volume
(
HA
_KEYSEG
*
keyseg
,
uchar
*
a
,
uint
key_length
)
{
double
res
=
1
;
for
(;
(
int
)
key_length
>
0
;
keyseg
+=
2
)
...
...
@@ -269,7 +269,7 @@ double rtree_rect_volume(MI_KEYSEG *keyseg, uchar *a, uint key_length)
/*
Creates an MBR as an array of doubles.
*/
int
rtree_d_mbr
(
MI
_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
)
{
...
...
@@ -366,7 +366,7 @@ Creates common minimal bounding rectungle
for two input rectagnles a and b
Result is written to c
*/
int
rtree_combine_rect
(
MI
_KEYSEG
*
keyseg
,
uchar
*
a
,
uchar
*
b
,
uchar
*
c
,
int
rtree_combine_rect
(
HA
_KEYSEG
*
keyseg
,
uchar
*
a
,
uchar
*
b
,
uchar
*
c
,
uint
key_length
)
{
...
...
@@ -466,7 +466,7 @@ int rtree_combine_rect(MI_KEYSEG *keyseg, uchar* a, uchar* b, uchar* c,
/*
Calculates overlapping area of two MBRs a & b
*/
double
rtree_overlapping_area
(
MI
_KEYSEG
*
keyseg
,
uchar
*
a
,
uchar
*
b
,
double
rtree_overlapping_area
(
HA
_KEYSEG
*
keyseg
,
uchar
*
a
,
uchar
*
b
,
uint
key_length
)
{
double
res
=
1
;
...
...
@@ -559,7 +559,7 @@ double rtree_overlapping_area(MI_KEYSEG *keyseg, uchar* a, uchar* b,
/*
Calculates MBR_AREA(a+b) - MBR_AREA(a)
*/
double
rtree_area_increase
(
MI
_KEYSEG
*
keyseg
,
uchar
*
a
,
uchar
*
b
,
double
rtree_area_increase
(
HA
_KEYSEG
*
keyseg
,
uchar
*
a
,
uchar
*
b
,
uint
key_length
,
double
*
ab_area
)
{
double
a_area
=
1
;
...
...
@@ -675,7 +675,7 @@ double rtree_area_increase(MI_KEYSEG *keyseg, uchar* a, uchar* b,
/*
Calculates key page total MBR = MBR(key1) + MBR(key2) + ...
*/
int
rtree_page_mbr
(
MI_INFO
*
info
,
MI
_KEYSEG
*
keyseg
,
uchar
*
page_buf
,
int
rtree_page_mbr
(
MI_INFO
*
info
,
HA
_KEYSEG
*
keyseg
,
uchar
*
page_buf
,
uchar
*
c
,
uint
key_length
)
{
uint
inc
=
0
;
...
...
myisam/rt_mbr.h
View file @
b8a12a8c
...
...
@@ -18,16 +18,16 @@
#ifndef _rt_mbr_h
#define _rt_mbr_h
int
rtree_key_cmp
(
MI
_KEYSEG
*
keyseg
,
uchar
*
a
,
uchar
*
b
,
uint
key_length
,
int
rtree_key_cmp
(
HA
_KEYSEG
*
keyseg
,
uchar
*
a
,
uchar
*
b
,
uint
key_length
,
uint
nextflag
);
int
rtree_combine_rect
(
MI
_KEYSEG
*
keyseg
,
uchar
*
,
uchar
*
,
uchar
*
,
int
rtree_combine_rect
(
HA
_KEYSEG
*
keyseg
,
uchar
*
,
uchar
*
,
uchar
*
,
uint
key_length
);
double
rtree_rect_volume
(
MI
_KEYSEG
*
keyseg
,
uchar
*
,
uint
key_length
);
int
rtree_d_mbr
(
MI
_KEYSEG
*
keyseg
,
uchar
*
a
,
uint
key_length
,
double
*
res
);
double
rtree_overlapping_area
(
MI
_KEYSEG
*
keyseg
,
uchar
*
a
,
uchar
*
b
,
double
rtree_rect_volume
(
HA
_KEYSEG
*
keyseg
,
uchar
*
,
uint
key_length
);
int
rtree_d_mbr
(
HA
_KEYSEG
*
keyseg
,
uchar
*
a
,
uint
key_length
,
double
*
res
);
double
rtree_overlapping_area
(
HA
_KEYSEG
*
keyseg
,
uchar
*
a
,
uchar
*
b
,
uint
key_length
);
double
rtree_area_increase
(
MI
_KEYSEG
*
keyseg
,
uchar
*
a
,
uchar
*
b
,
double
rtree_area_increase
(
HA
_KEYSEG
*
keyseg
,
uchar
*
a
,
uchar
*
b
,
uint
key_length
,
double
*
ab_area
);
int
rtree_page_mbr
(
MI_INFO
*
info
,
MI
_KEYSEG
*
keyseg
,
uchar
*
page_buf
,
int
rtree_page_mbr
(
MI_INFO
*
info
,
HA
_KEYSEG
*
keyseg
,
uchar
*
page_buf
,
uchar
*
c
,
uint
key_length
);
#endif
/* _rt_mbr_h */
myisam/rt_test.c
View file @
b8a12a8c
...
...
@@ -47,7 +47,7 @@ int run_test(const char *filename)
MI_CREATE_INFO
create_info
;
MI_COLUMNDEF
recinfo
[
20
];
MI_KEYDEF
keyinfo
[
20
];
MI
_KEYSEG
keyseg
[
20
];
HA
_KEYSEG
keyseg
[
20
];
int
silent
=
0
;
int
opt_unique
=
0
;
...
...
myisam/sp_key.c
View file @
b8a12a8c
...
...
@@ -33,7 +33,7 @@ static int sp_mbr_from_wkb(uchar (*wkb), uint size, uint n_dims, double *mbr);
uint
sp_make_key
(
register
MI_INFO
*
info
,
uint
keynr
,
uchar
*
key
,
const
byte
*
record
,
my_off_t
filepos
)
{
MI
_KEYSEG
*
keyseg
;
HA
_KEYSEG
*
keyseg
;
MI_KEYDEF
*
keyinfo
=
&
info
->
s
->
keyinfo
[
keynr
];
uint
len
=
0
;
byte
*
pos
;
...
...
myisam/sp_test.c
View file @
b8a12a8c
...
...
@@ -56,7 +56,7 @@ int run_test(const char *filename)
MI_CREATE_INFO
create_info
;
MI_COLUMNDEF
recinfo
[
20
];
MI_KEYDEF
keyinfo
[
20
];
MI
_KEYSEG
keyseg
[
20
];
HA
_KEYSEG
keyseg
[
20
];
int
silent
=
0
;
int
create_flag
=
0
;
...
...
myisammrg/myrg_queue.c
View file @
b8a12a8c
...
...
@@ -23,7 +23,7 @@ static int queue_key_cmp(void *keyseg, byte *a, byte *b)
MI_INFO
*
aa
=
((
MYRG_TABLE
*
)
a
)
->
table
;
MI_INFO
*
bb
=
((
MYRG_TABLE
*
)
b
)
->
table
;
uint
not_used
;
int
ret
=
_mi_key_cmp
((
MI
_KEYSEG
*
)
keyseg
,
aa
->
lastkey
,
bb
->
lastkey
,
int
ret
=
ha_key_cmp
((
HA
_KEYSEG
*
)
keyseg
,
aa
->
lastkey
,
bb
->
lastkey
,
USE_WHOLE_KEY
,
SEARCH_FIND
,
&
not_used
);
return
ret
<
0
?
-
1
:
ret
>
0
?
1
:
0
;
}
/* queue_key_cmp */
...
...
mysys/my_handler.c
View file @
b8a12a8c
...
...
@@ -67,7 +67,7 @@ Returns <0, 0, >0 acording to which is bigger
Key_length specifies length of key to use. Number-keys can't be splited
If flag <> SEARCH_FIND compare also position
*/
int
_mi_key_cmp
(
register
MI
_KEYSEG
*
keyseg
,
register
uchar
*
a
,
int
ha_key_cmp
(
register
HA
_KEYSEG
*
keyseg
,
register
uchar
*
a
,
register
uchar
*
b
,
uint
key_length
,
uint
nextflag
,
uint
*
diff_pos
)
{
...
...
@@ -393,7 +393,7 @@ Returns <0, 0, >0 acording to which is bigger
Key_length specifies length of key to use. Number-keys can't be splited
If flag <> SEARCH_FIND compare also position
*/
int
hp_rb_key_cmp
(
register
MI
_KEYSEG
*
keyseg
,
register
uchar
*
a
,
int
hp_rb_key_cmp
(
register
HA
_KEYSEG
*
keyseg
,
register
uchar
*
a
,
register
uchar
*
b
,
uint
key_length
,
uint
nextflag
,
uint
*
diff_pos
)
{
...
...
sql/ha_heap.cc
View file @
b8a12a8c
...
...
@@ -36,7 +36,7 @@ int ha_heap::open(const char *name, int mode, uint test_if_locked)
uint
key
,
parts
,
mem_per_row
=
0
;
ulong
max_rows
;
HP_KEYDEF
*
keydef
;
MI
_KEYSEG
*
seg
;
HA
_KEYSEG
*
seg
;
for
(
key
=
parts
=
0
;
key
<
table
->
keys
;
key
++
)
{
...
...
@@ -48,9 +48,9 @@ int ha_heap::open(const char *name, int mode, uint test_if_locked)
}
if
(
!
(
keydef
=
(
HP_KEYDEF
*
)
my_malloc
(
table
->
keys
*
sizeof
(
HP_KEYDEF
)
+
parts
*
sizeof
(
MI
_KEYSEG
),
MYF
(
MY_WME
))))
parts
*
sizeof
(
HA
_KEYSEG
),
MYF
(
MY_WME
))))
return
my_errno
;
seg
=
my_reinterpret_cast
(
MI
_KEYSEG
*
)
(
keydef
+
table
->
keys
);
seg
=
my_reinterpret_cast
(
HA
_KEYSEG
*
)
(
keydef
+
table
->
keys
);
for
(
key
=
0
;
key
<
table
->
keys
;
key
++
)
{
KEY
*
pos
=
table
->
key_info
+
key
;
...
...
sql/ha_myisam.cc
View file @
b8a12a8c
...
...
@@ -993,7 +993,7 @@ int ha_myisam::create(const char *name, register TABLE *table,
KEY
*
pos
;
MI_KEYDEF
*
keydef
;
MI_COLUMNDEF
*
recinfo
,
*
recinfo_pos
;
MI
_KEYSEG
*
keyseg
;
HA
_KEYSEG
*
keyseg
;
uint
options
=
table
->
db_options_in_use
;
DBUG_ENTER
(
"ha_myisam::create"
);
...
...
@@ -1002,7 +1002,7 @@ int ha_myisam::create(const char *name, register TABLE *table,
&
recinfo
,(
table
->
fields
*
2
+
2
)
*
sizeof
(
MI_COLUMNDEF
),
&
keydef
,
table
->
keys
*
sizeof
(
MI_KEYDEF
),
&
keyseg
,
((
table
->
key_parts
+
table
->
keys
)
*
sizeof
(
MI
_KEYSEG
)),
((
table
->
key_parts
+
table
->
keys
)
*
sizeof
(
HA
_KEYSEG
)),
0
)))
DBUG_RETURN
(
1
);
...
...
sql/sql_select.cc
View file @
b8a12a8c
...
...
@@ -3942,7 +3942,7 @@ static bool create_myisam_tmp_table(TABLE *table,TMP_TABLE_PARAM *param,
if
(
table
->
keys
)
{
// Get keys for ni_create
bool
using_unique_constraint
=
0
;
MI_KEYSEG
*
seg
=
(
MI
_KEYSEG
*
)
sql_calloc
(
sizeof
(
*
seg
)
*
HA_KEYSEG
*
seg
=
(
HA
_KEYSEG
*
)
sql_calloc
(
sizeof
(
*
seg
)
*
keyinfo
->
key_parts
);
if
(
!
seg
)
goto
err
;
...
...
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