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
ad42dc75
Commit
ad42dc75
authored
Jan 13, 2010
by
Mats Kindahl
Browse files
Options
Browse Files
Download
Plain Diff
Merging with mysql-5.1-rep+2-delivery1
parents
5b636ce2
f457a887
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
32 additions
and
14 deletions
+32
-14
sql/rpl_record.cc
sql/rpl_record.cc
+26
-14
sql/rpl_utility.cc
sql/rpl_utility.cc
+6
-0
No files found.
sql/rpl_record.cc
View file @
ad42dc75
...
...
@@ -150,13 +150,20 @@ pack_row(TABLE *table, MY_BITMAP const* cols,
the various member functions of Field and subclasses expect to
write.
The row is assumed to only consist of the fields for which the corresponding
bit in bitset @c cols is set; the other parts of the record are left alone.
The row is assumed to only consist of the fields for which the
corresponding bit in bitset @c cols is set; the other parts of the
record are left alone.
At most @c colcnt columns are read: if the table is larger than
that, the remaining fields are not filled in.
@param rli Relay log info
@note The relay log information can be NULL, which means that no
checking or comparison with the source table is done, simply
because it is not used. This feature is used by MySQL Backup to
unpack a row from from the backup image, but can be used for other
purposes as well.
@param rli Relay log info, which can be NULL
@param table Table to unpack into
@param colcnt Number of columns to read from record
@param row_data
...
...
@@ -170,10 +177,8 @@ pack_row(TABLE *table, MY_BITMAP const* cols,
@retval 0 No error
@retval ER_NO_DEFAULT_FOR_FIELD
Returned if one of the fields existing on the slave but not on the
master does not have a default value (and isn't nullable)
@retval HA_ERR_GENERIC
A generic, internal, error caused the unpacking to fail.
*/
#if !defined(MYSQL_CLIENT) && defined(HAVE_REPLICATION)
int
...
...
@@ -185,8 +190,8 @@ unpack_row(Relay_log_info const *rli,
{
DBUG_ENTER
(
"unpack_row"
);
DBUG_ASSERT
(
row_data
);
DBUG_ASSERT
(
table
);
size_t
const
master_null_byte_count
=
(
bitmap_bits_set
(
cols
)
+
7
)
/
8
;
int
error
=
0
;
uchar
const
*
null_ptr
=
row_data
;
uchar
const
*
pack_ptr
=
row_data
+
master_null_byte_count
;
...
...
@@ -202,14 +207,21 @@ unpack_row(Relay_log_info const *rli,
// The "current" null bits
unsigned
int
null_bits
=
*
null_ptr
++
;
uint
i
=
0
;
table_def
*
tabledef
;
TABLE
*
conv_table
;
bool
table_found
=
rli
->
get_table_data
(
table
,
&
tabledef
,
&
conv_table
);
table_def
*
tabledef
=
NULL
;
TABLE
*
conv_table
=
NULL
;
bool
table_found
=
rli
&&
rli
->
get_table_data
(
table
,
&
tabledef
,
&
conv_table
);
DBUG_PRINT
(
"debug"
,
(
"Table data: table_found: %d, tabldef: %p, conv_table: %p"
,
table_found
,
tabledef
,
conv_table
));
DBUG_ASSERT
(
table_found
);
if
(
!
table_found
)
return
HA_ERR_GENERIC
;
/*
If rli is NULL it means that there is no source table and that the
row shall just be unpacked without doing any checks. This feature
is used by MySQL Backup, but can be used for other purposes as
well.
*/
if
(
rli
&&
!
table_found
)
DBUG_RETURN
(
HA_ERR_GENERIC
);
for
(
field_ptr
=
begin_ptr
;
field_ptr
<
end_ptr
&&
*
field_ptr
;
++
field_ptr
)
{
...
...
@@ -372,7 +384,7 @@ unpack_row(Relay_log_info const *rli,
*
master_reclength
=
table
->
s
->
reclength
;
}
DBUG_RETURN
(
error
);
DBUG_RETURN
(
0
);
}
/**
...
...
sql/rpl_utility.cc
View file @
ad42dc75
...
...
@@ -592,6 +592,12 @@ can_convert_field_to(Field *field,
{
if
(
metadata
==
0
)
// Metadata can only be zero if no metadata was provided
{
/*
If there is no metadata, we either have an old event where no
metadata were supplied, or a type that does not require any
metadata. In either case, conversion can be done but no
conversion table is necessary.
*/
DBUG_PRINT
(
"debug"
,
(
"Base types are identical, but there is no metadata"
));
*
order_var
=
0
;
DBUG_RETURN
(
true
);
...
...
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