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
f57f1d09
Commit
f57f1d09
authored
Sep 10, 2007
by
holyfoot/hf@hfmain.(none)
Browse files
Options
Browse Files
Download
Plain Diff
Merge bk@192.168.21.1:mysql-5.1-opt
into mysql.com:/home/hf/work/28430/my51-28430
parents
d61cfb27
a60f7988
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
44 additions
and
8 deletions
+44
-8
sql/ha_partition.cc
sql/ha_partition.cc
+31
-6
sql/ha_partition.h
sql/ha_partition.h
+1
-0
sql/handler.h
sql/handler.h
+11
-0
sql/log_event.cc
sql/log_event.cc
+1
-2
No files found.
sql/ha_partition.cc
View file @
f57f1d09
...
...
@@ -3235,14 +3235,9 @@ int ha_partition::rnd_next(uchar *buf)
void
ha_partition
::
position
(
const
uchar
*
record
)
{
handler
*
file
;
handler
*
file
=
m_file
[
m_last_part
]
;
DBUG_ENTER
(
"ha_partition::position"
);
if
(
unlikely
(
get_part_for_delete
(
record
,
m_rec0
,
m_part_info
,
&
m_last_part
)))
m_last_part
=
0
;
file
=
m_file
[
m_last_part
];
file
->
position
(
record
);
int2store
(
ref
,
m_last_part
);
memcpy
((
ref
+
PARTITION_BYTES_IN_POS
),
file
->
ref
,
...
...
@@ -3300,6 +3295,36 @@ int ha_partition::rnd_pos(uchar * buf, uchar *pos)
}
/*
Read row using position using given record to find
SYNOPSIS
rnd_pos_by_record()
record Current record in MySQL Row Format
RETURN VALUE
>0 Error code
0 Success
DESCRIPTION
this works as position()+rnd_pos() functions, but does some extra work,
calculating m_last_part - the partition to where the 'record'
should go.
called from replication (log_event.cc)
*/
int
ha_partition
::
rnd_pos_by_record
(
uchar
*
record
)
{
DBUG_ENTER
(
"ha_partition::rnd_pos_by_record"
);
if
(
unlikely
(
get_part_for_delete
(
record
,
m_rec0
,
m_part_info
,
&
m_last_part
)))
DBUG_RETURN
(
1
);
DBUG_RETURN
(
handler
::
rnd_pos_by_record
(
record
));
}
/****************************************************************************
MODULE index scan
****************************************************************************/
...
...
sql/ha_partition.h
View file @
f57f1d09
...
...
@@ -353,6 +353,7 @@ class ha_partition :public handler
virtual
int
rnd_end
();
virtual
int
rnd_next
(
uchar
*
buf
);
virtual
int
rnd_pos
(
uchar
*
buf
,
uchar
*
pos
);
virtual
int
rnd_pos_by_record
(
uchar
*
record
);
virtual
void
position
(
const
uchar
*
record
);
/*
...
...
sql/handler.h
View file @
f57f1d09
...
...
@@ -1343,6 +1343,17 @@ class handler :public Sql_alloc
virtual
int
ft_read
(
uchar
*
buf
)
{
return
HA_ERR_WRONG_COMMAND
;
}
virtual
int
rnd_next
(
uchar
*
buf
)
=
0
;
virtual
int
rnd_pos
(
uchar
*
buf
,
uchar
*
pos
)
=
0
;
/*
one has to use this method when to find
random position by record as the plain
position() call doesn't work for some
handlers for random position
*/
virtual
int
rnd_pos_by_record
(
uchar
*
record
)
{
position
(
record
);
return
rnd_pos
(
record
,
ref
);
}
virtual
int
read_first_row
(
uchar
*
buf
,
uint
primary_key
);
/*
The following function is only needed for tables that may be temporary
...
...
sql/log_event.cc
View file @
f57f1d09
...
...
@@ -7501,8 +7501,7 @@ int Rows_log_event::find_row(const Relay_log_info *rli)
*/
DBUG_PRINT
(
"info"
,(
"locating record using primary key (position)"
));
table
->
file
->
position
(
table
->
record
[
0
]);
error
=
table
->
file
->
rnd_pos
(
table
->
record
[
0
],
table
->
file
->
ref
);
int
error
=
table
->
file
->
rnd_pos_by_record
(
table
->
record
[
0
]);
if
(
error
)
{
DBUG_PRINT
(
"info"
,(
"rnd_pos returns error %d"
,
error
));
...
...
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