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
adcbf015
Commit
adcbf015
authored
Sep 15, 2022
by
Sergei Golubchik
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
cleanup: read_set/write_set are based on metadata
they should be set once, not for every row
parent
bf62d8e7
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
14 deletions
+14
-14
sql/log_event_server.cc
sql/log_event_server.cc
+6
-6
sql/table.cc
sql/table.cc
+8
-8
No files found.
sql/log_event_server.cc
View file @
adcbf015
...
...
@@ -6047,6 +6047,12 @@ int Rows_log_event::do_apply_event(rpl_group_info *rgi)
&
m_cols_ai
:
&
m_cols
);
bitmap_intersect
(
table
->
write_set
,
after_image
);
if
(
table
->
versioned
())
{
bitmap_set_bit
(
table
->
write_set
,
table
->
s
->
vers
.
start_fieldno
);
bitmap_set_bit
(
table
->
write_set
,
table
->
s
->
vers
.
end_fieldno
);
}
this
->
slave_exec_mode
=
slave_exec_mode_options
;
// fix the mode
// Do event specific preparations
...
...
@@ -7681,8 +7687,6 @@ Rows_log_event::write_row(rpl_group_info *rgi,
if
(
table
->
versioned
(
VERS_TIMESTAMP
))
{
ulong
sec_part
;
bitmap_set_bit
(
table
->
read_set
,
table
->
vers_start_field
()
->
field_index
);
table
->
file
->
column_bitmaps_signal
();
// Check whether a row came from unversioned table and fix vers fields.
if
(
table
->
vers_start_field
()
->
get_timestamp
(
&
sec_part
)
==
0
&&
sec_part
==
0
)
table
->
vers_update_fields
();
...
...
@@ -8207,18 +8211,15 @@ int Rows_log_event::find_row(rpl_group_info *rgi)
{
Field
*
row_end
=
table
->
vers_end_field
();
DBUG_ASSERT
(
table
->
read_set
);
bitmap_set_bit
(
table
->
read_set
,
row_end
->
field_index
);
// check whether master table is unversioned
if
(
row_end
->
val_int
()
==
0
)
{
bitmap_set_bit
(
table
->
write_set
,
row_end
->
field_index
);
// Plain source table may have a PRIMARY KEY. And row_end is always
// a part of PRIMARY KEY. Set it to max value for engine to find it in
// index. Needed for an UPDATE/DELETE cases.
table
->
vers_end_field
()
->
set_max
();
m_vers_from_plain
=
true
;
}
table
->
file
->
column_bitmaps_signal
();
}
DBUG_PRINT
(
"info"
,(
"looking for the following record"
));
...
...
@@ -8578,7 +8579,6 @@ int Delete_rows_log_event::do_exec_row(rpl_group_info *rgi)
if
(
m_vers_from_plain
&&
m_table
->
versioned
(
VERS_TIMESTAMP
))
{
Field
*
end
=
m_table
->
vers_end_field
();
bitmap_set_bit
(
m_table
->
write_set
,
end
->
field_index
);
store_record
(
m_table
,
record
[
1
]);
end
->
set_time
();
error
=
m_table
->
file
->
ha_update_row
(
m_table
->
record
[
1
],
...
...
sql/table.cc
View file @
adcbf015
...
...
@@ -7614,6 +7614,8 @@ void TABLE::mark_columns_needed_for_update()
}
if
(
s
->
versioned
)
{
bitmap_set_bit
(
write_set
,
s
->
vers
.
start_fieldno
);
bitmap_set_bit
(
write_set
,
s
->
vers
.
end_fieldno
);
/*
For System Versioning we have to read all columns since we store
a copy of previous row with modified row_end back to a table.
...
...
@@ -7671,6 +7673,12 @@ void TABLE::mark_columns_needed_for_insert()
mark_auto_increment_column
();
if
(
default_field
)
mark_default_fields_for_write
(
TRUE
);
if
(
s
->
versioned
)
{
bitmap_set_bit
(
write_set
,
s
->
vers
.
start_fieldno
);
bitmap_set_bit
(
write_set
,
s
->
vers
.
end_fieldno
);
bitmap_set_bit
(
read_set
,
s
->
vers
.
end_fieldno
);
}
/* Mark virtual columns for insert */
if
(
vfield
)
mark_virtual_columns_for_write
(
TRUE
);
...
...
@@ -9148,29 +9156,21 @@ bool TABLE::check_period_overlaps(const KEY &key,
void
TABLE
::
vers_update_fields
()
{
if
(
!
vers_write
)
{
file
->
column_bitmaps_signal
();
return
;
}
if
(
versioned
(
VERS_TIMESTAMP
))
{
bitmap_set_bit
(
write_set
,
vers_start_field
()
->
field_index
);
if
(
vers_start_field
()
->
store_timestamp
(
in_use
->
query_start
(),
in_use
->
query_start_sec_part
()))
{
DBUG_ASSERT
(
0
);
}
vers_start_field
()
->
set_has_explicit_value
();
bitmap_set_bit
(
read_set
,
vers_start_field
()
->
field_index
);
}
bitmap_set_bit
(
write_set
,
vers_end_field
()
->
field_index
);
vers_end_field
()
->
set_max
();
vers_end_field
()
->
set_has_explicit_value
();
bitmap_set_bit
(
read_set
,
vers_end_field
()
->
field_index
);
file
->
column_bitmaps_signal
();
if
(
vfield
)
update_virtual_fields
(
file
,
VCOL_UPDATE_FOR_READ
);
}
...
...
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