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
f58484fa
Commit
f58484fa
authored
Nov 07, 2004
by
serg@serg.mylan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
s/ha_store_ptr/my_store_ptr/
s/ha_get_ptr/my_get_ptr/
parent
bb9cc040
Changes
7
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
52 additions
and
11 deletions
+52
-11
include/my_sys.h
include/my_sys.h
+2
-0
mysys/ptr_cmp.c
mysys/ptr_cmp.c
+39
-0
sql/filesort.cc
sql/filesort.cc
+1
-1
sql/ha_isam.cc
sql/ha_isam.cc
+3
-3
sql/ha_isammrg.cc
sql/ha_isammrg.cc
+2
-2
sql/ha_myisam.cc
sql/ha_myisam.cc
+3
-3
sql/ha_myisammrg.cc
sql/ha_myisammrg.cc
+2
-2
No files found.
include/my_sys.h
View file @
f58484fa
...
...
@@ -663,6 +663,8 @@ extern void radixsort_for_str_ptr(uchar* base[], uint number_of_elements,
extern
qsort_t
qsort2
(
void
*
base_ptr
,
size_t
total_elems
,
size_t
size
,
qsort2_cmp
cmp
,
void
*
cmp_argument
);
extern
qsort2_cmp
get_ptr_compare
(
uint
);
void
my_store_ptr
(
byte
*
buff
,
uint
pack_length
,
my_off_t
pos
);
my_off_t
my_get_ptr
(
byte
*
ptr
,
uint
pack_length
);
extern
int
init_io_cache
(
IO_CACHE
*
info
,
File
file
,
uint
cachesize
,
enum
cache_type
type
,
my_off_t
seek_offset
,
pbool
use_async_io
,
myf
cache_myflags
);
...
...
mysys/ptr_cmp.c
View file @
f58484fa
...
...
@@ -21,6 +21,7 @@
*/
#include "mysys_priv.h"
#include <myisampack.h>
static
int
ptr_compare
(
uint
*
compare_length
,
uchar
**
a
,
uchar
**
b
);
static
int
ptr_compare_0
(
uint
*
compare_length
,
uchar
**
a
,
uchar
**
b
);
...
...
@@ -152,3 +153,41 @@ static int ptr_compare_3(uint *compare_length,uchar **a, uchar **b)
}
return
(
0
);
}
void
my_store_ptr
(
byte
*
buff
,
uint
pack_length
,
my_off_t
pos
)
{
switch
(
pack_length
)
{
#if SIZEOF_OFF_T > 4
case
8
:
mi_int8store
(
buff
,
pos
);
break
;
case
7
:
mi_int7store
(
buff
,
pos
);
break
;
case
6
:
mi_int6store
(
buff
,
pos
);
break
;
case
5
:
mi_int5store
(
buff
,
pos
);
break
;
#endif
case
4
:
mi_int4store
(
buff
,
pos
);
break
;
case
3
:
mi_int3store
(
buff
,
pos
);
break
;
case
2
:
mi_int2store
(
buff
,
pos
);
break
;
case
1
:
buff
[
0
]
=
(
uchar
)
pos
;
break
;
default:
DBUG_ASSERT
(
0
);
}
return
;
}
my_off_t
my_get_ptr
(
byte
*
ptr
,
uint
pack_length
)
{
my_off_t
pos
;
switch
(
pack_length
)
{
#if SIZEOF_OFF_T > 4
case
8
:
pos
=
(
my_off_t
)
mi_uint8korr
(
ptr
);
break
;
case
7
:
pos
=
(
my_off_t
)
mi_uint7korr
(
ptr
);
break
;
case
6
:
pos
=
(
my_off_t
)
mi_uint6korr
(
ptr
);
break
;
case
5
:
pos
=
(
my_off_t
)
mi_uint5korr
(
ptr
);
break
;
#endif
case
4
:
pos
=
(
my_off_t
)
mi_uint4korr
(
ptr
);
break
;
case
3
:
pos
=
(
my_off_t
)
mi_uint3korr
(
ptr
);
break
;
case
2
:
pos
=
(
my_off_t
)
mi_uint2korr
(
ptr
);
break
;
case
1
:
pos
=
(
my_off_t
)
mi_uint2korr
(
ptr
);
break
;
default:
DBUG_ASSERT
(
0
);
}
return
pos
;
}
sql/filesort.cc
View file @
f58484fa
...
...
@@ -464,7 +464,7 @@ static ha_rows find_all_keys(SORTPARAM *param, SQL_SELECT *select,
error
=
file
->
rnd_next
(
sort_form
->
record
[
0
]);
if
(
!
flag
)
{
ha
_store_ptr
(
ref_pos
,
ref_length
,
record
);
// Position to row
my
_store_ptr
(
ref_pos
,
ref_length
,
record
);
// Position to row
record
+=
sort_form
->
db_record_offset
;
}
else
...
...
sql/ha_isam.cc
View file @
f58484fa
...
...
@@ -172,7 +172,7 @@ int ha_isam::rnd_pos(byte * buf, byte *pos)
{
statistic_increment
(
current_thd
->
status_var
.
ha_read_rnd_count
,
&
LOCK_status
);
int
error
=
nisam_rrnd
(
file
,
buf
,
(
ulong
)
ha
_get_ptr
(
pos
,
ref_length
));
int
error
=
nisam_rrnd
(
file
,
buf
,
(
ulong
)
my
_get_ptr
(
pos
,
ref_length
));
table
->
status
=
error
?
STATUS_NOT_FOUND
:
0
;
return
!
error
?
0
:
my_errno
?
my_errno
:
-
1
;
}
...
...
@@ -182,7 +182,7 @@ void ha_isam::position(const byte *record)
my_off_t
position
=
nisam_position
(
file
);
if
(
position
==
(
my_off_t
)
~
(
ulong
)
0
)
position
=
HA_OFFSET_ERROR
;
ha
_store_ptr
(
ref
,
ref_length
,
position
);
my
_store_ptr
(
ref
,
ref_length
,
position
);
}
void
ha_isam
::
info
(
uint
flag
)
...
...
@@ -227,7 +227,7 @@ void ha_isam::info(uint flag)
if
(
flag
&
HA_STATUS_ERRKEY
)
{
errkey
=
info
.
errkey
;
ha
_store_ptr
(
dupp_ref
,
ref_length
,
info
.
dupp_key_pos
);
my
_store_ptr
(
dupp_ref
,
ref_length
,
info
.
dupp_key_pos
);
}
if
(
flag
&
HA_STATUS_TIME
)
update_time
=
info
.
update_time
;
...
...
sql/ha_isammrg.cc
View file @
f58484fa
...
...
@@ -138,7 +138,7 @@ int ha_isammrg::rnd_next(byte *buf)
int
ha_isammrg
::
rnd_pos
(
byte
*
buf
,
byte
*
pos
)
{
statistic_increment
(
current_thd
->
status_var
.
ha_read_rnd_count
,
&
LOCK_status
);
int
error
=
mrg_rrnd
(
file
,
buf
,
(
ulong
)
ha
_get_ptr
(
pos
,
ref_length
));
int
error
=
mrg_rrnd
(
file
,
buf
,
(
ulong
)
my
_get_ptr
(
pos
,
ref_length
));
table
->
status
=
error
?
STATUS_NOT_FOUND
:
0
;
return
!
error
?
0
:
my_errno
?
my_errno
:
-
1
;
}
...
...
@@ -146,7 +146,7 @@ int ha_isammrg::rnd_pos(byte * buf, byte *pos)
void
ha_isammrg
::
position
(
const
byte
*
record
)
{
ulong
position
=
mrg_position
(
file
);
ha
_store_ptr
(
ref
,
ref_length
,
(
my_off_t
)
position
);
my
_store_ptr
(
ref
,
ref_length
,
(
my_off_t
)
position
);
}
...
...
sql/ha_myisam.cc
View file @
f58484fa
...
...
@@ -1197,7 +1197,7 @@ int ha_myisam::restart_rnd_next(byte *buf, byte *pos)
int
ha_myisam
::
rnd_pos
(
byte
*
buf
,
byte
*
pos
)
{
statistic_increment
(
current_thd
->
status_var
.
ha_read_rnd_count
,
&
LOCK_status
);
int
error
=
mi_rrnd
(
file
,
buf
,
ha
_get_ptr
(
pos
,
ref_length
));
int
error
=
mi_rrnd
(
file
,
buf
,
my
_get_ptr
(
pos
,
ref_length
));
table
->
status
=
error
?
STATUS_NOT_FOUND
:
0
;
return
error
;
}
...
...
@@ -1205,7 +1205,7 @@ int ha_myisam::rnd_pos(byte * buf, byte *pos)
void
ha_myisam
::
position
(
const
byte
*
record
)
{
my_off_t
position
=
mi_position
(
file
);
ha
_store_ptr
(
ref
,
ref_length
,
position
);
my
_store_ptr
(
ref
,
ref_length
,
position
);
}
void
ha_myisam
::
info
(
uint
flag
)
...
...
@@ -1261,7 +1261,7 @@ void ha_myisam::info(uint flag)
if
(
flag
&
HA_STATUS_ERRKEY
)
{
errkey
=
info
.
errkey
;
ha
_store_ptr
(
dupp_ref
,
ref_length
,
info
.
dupp_key_pos
);
my
_store_ptr
(
dupp_ref
,
ref_length
,
info
.
dupp_key_pos
);
}
if
(
flag
&
HA_STATUS_TIME
)
update_time
=
info
.
update_time
;
...
...
sql/ha_myisammrg.cc
View file @
f58484fa
...
...
@@ -190,7 +190,7 @@ int ha_myisammrg::rnd_next(byte *buf)
int
ha_myisammrg
::
rnd_pos
(
byte
*
buf
,
byte
*
pos
)
{
statistic_increment
(
current_thd
->
status_var
.
ha_read_rnd_count
,
&
LOCK_status
);
int
error
=
myrg_rrnd
(
file
,
buf
,
ha
_get_ptr
(
pos
,
ref_length
));
int
error
=
myrg_rrnd
(
file
,
buf
,
my
_get_ptr
(
pos
,
ref_length
));
table
->
status
=
error
?
STATUS_NOT_FOUND
:
0
;
return
error
;
}
...
...
@@ -198,7 +198,7 @@ int ha_myisammrg::rnd_pos(byte * buf, byte *pos)
void
ha_myisammrg
::
position
(
const
byte
*
record
)
{
ulonglong
position
=
myrg_position
(
file
);
ha
_store_ptr
(
ref
,
ref_length
,
(
my_off_t
)
position
);
my
_store_ptr
(
ref
,
ref_length
,
(
my_off_t
)
position
);
}
...
...
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