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
af82d56a
Commit
af82d56a
authored
Apr 23, 2023
by
Nikita Malyavin
Committed by
Sergei Golubchik
Aug 15, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
unpack_row: set the correct fields in has_value_set for online alter
parent
ecb9db4c
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
66 additions
and
1 deletion
+66
-1
mysql-test/main/alter_table_online_debug.result
mysql-test/main/alter_table_online_debug.result
+34
-0
mysql-test/main/alter_table_online_debug.test
mysql-test/main/alter_table_online_debug.test
+29
-0
sql/rpl_record.cc
sql/rpl_record.cc
+3
-1
No files found.
mysql-test/main/alter_table_online_debug.result
View file @
af82d56a
...
@@ -1312,6 +1312,40 @@ insert into t select repeat('a',130000);
...
@@ -1312,6 +1312,40 @@ insert into t select repeat('a',130000);
set debug_sync= "now signal end";
set debug_sync= "now signal end";
connection default;
connection default;
drop table t;
drop table t;
#
# Test that correct fields are marked as explicit:
# Drop a, reorder b, add new column with default.
#
create table t (a int primary key, b int) engine=innodb;
insert into t values (1, 1), (2, 2), (3, 3);
set debug_sync= "alter_table_copy_end signal copy wait_for goon";
alter table t drop primary key, drop a,
change b c bigint,
add x longblob default 123456;
connection con1;
set debug_sync= "now wait_for copy";
update t set b = 5 where a = 1;
update t set b = NULL where a = 1;
select * from t;
a b
1 NULL
2 2
3 3
update t set a = 100 where a = 1;
update t set b = -10 where a = 100;
select * from t;
a b
2 2
3 3
100 -10
set debug_sync= "now signal goon";
connection default;
select * from t;
c x
-10 123456
2 123456
3 123456
drop table t;
set debug_sync= reset;
set debug_sync= reset;
disconnect con1;
disconnect con1;
disconnect con2;
disconnect con2;
...
...
mysql-test/main/alter_table_online_debug.test
View file @
af82d56a
...
@@ -1498,6 +1498,35 @@ set debug_sync= "now signal end";
...
@@ -1498,6 +1498,35 @@ set debug_sync= "now signal end";
--
reap
--
reap
drop
table
t
;
drop
table
t
;
--
echo
#
--
echo
# Test that correct fields are marked as explicit:
--
echo
# Drop a, reorder b, add new column with default.
--
echo
#
create
table
t
(
a
int
primary
key
,
b
int
)
engine
=
innodb
;
insert
into
t
values
(
1
,
1
),
(
2
,
2
),
(
3
,
3
);
set
debug_sync
=
"alter_table_copy_end signal copy wait_for goon"
;
send
alter
table
t
drop
primary
key
,
drop
a
,
change
b
c
bigint
,
add
x
longblob
default
123456
;
--
connection
con1
set
debug_sync
=
"now wait_for copy"
;
update
t
set
b
=
5
where
a
=
1
;
update
t
set
b
=
NULL
where
a
=
1
;
select
*
from
t
;
update
t
set
a
=
100
where
a
=
1
;
update
t
set
b
=
-
10
where
a
=
100
;
select
*
from
t
;
set
debug_sync
=
"now signal goon"
;
--
connection
default
--
reap
select
*
from
t
;
drop
table
t
;
set
debug_sync
=
reset
;
set
debug_sync
=
reset
;
--
disconnect
con1
--
disconnect
con1
...
...
sql/rpl_record.cc
View file @
af82d56a
...
@@ -254,7 +254,8 @@ int unpack_row(const rpl_group_info *rgi, TABLE *table, uint const colcnt,
...
@@ -254,7 +254,8 @@ int unpack_row(const rpl_group_info *rgi, TABLE *table, uint const colcnt,
*/
*/
if
(
bitmap_is_set
(
cols
,
(
uint
)(
field_ptr
-
begin_ptr
)))
if
(
bitmap_is_set
(
cols
,
(
uint
)(
field_ptr
-
begin_ptr
)))
{
{
(
*
field_ptr
)
->
set_has_explicit_value
();
if
(
!
rpl_data
.
is_online_alter
())
(
*
field_ptr
)
->
set_has_explicit_value
();
if
((
null_mask
&
0xFF
)
==
0
)
if
((
null_mask
&
0xFF
)
==
0
)
{
{
DBUG_ASSERT
(
null_ptr
<
row_data
+
master_null_byte_count
);
DBUG_ASSERT
(
null_ptr
<
row_data
+
master_null_byte_count
);
...
@@ -376,6 +377,7 @@ int unpack_row(const rpl_group_info *rgi, TABLE *table, uint const colcnt,
...
@@ -376,6 +377,7 @@ int unpack_row(const rpl_group_info *rgi, TABLE *table, uint const colcnt,
for
(
const
auto
*
copy
=
rpl_data
.
copy_fields
;
for
(
const
auto
*
copy
=
rpl_data
.
copy_fields
;
copy
!=
rpl_data
.
copy_fields_end
;
copy
++
)
copy
!=
rpl_data
.
copy_fields_end
;
copy
++
)
{
{
copy
->
to_field
->
set_has_explicit_value
();
copy
->
do_copy
(
copy
);
copy
->
do_copy
(
copy
);
}
}
}
}
...
...
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