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
df0771c6
Commit
df0771c6
authored
May 31, 2022
by
Sergei Golubchik
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
no ALTER TABLE should return ER_NO_DEFAULT_FOR_FIELD
parent
a5776aa3
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
4 deletions
+19
-4
mysql-test/main/alter_table_online.result
mysql-test/main/alter_table_online.result
+0
-4
sql/sql_table.cc
sql/sql_table.cc
+19
-0
No files found.
mysql-test/main/alter_table_online.result
View file @
df0771c6
...
...
@@ -56,10 +56,6 @@ connection con2;
insert into t1 values (123), (456), (789);
set debug_sync= 'now SIGNAL end';
connection default;
Warnings:
Warning 1364 Field 'b' doesn't have a default value
Warning 1364 Field 'b' doesn't have a default value
Warning 1364 Field 'b' doesn't have a default value
select * from t1;
a b
5 0
...
...
sql/sql_table.cc
View file @
df0771c6
...
...
@@ -11534,6 +11534,22 @@ bool mysql_trans_commit_alter_copy_data(THD *thd)
}
#ifdef HAVE_REPLICATION
/*
locking ALTER TABLE doesn't issue ER_NO_DEFAULT_FOR_FIELD, so online
ALTER shouldn't either
*/
class
Has_default_error_handler
:
public
Internal_error_handler
{
public:
bool
handle_condition
(
THD
*
,
uint
sql_errno
,
const
char
*
,
Sql_condition
::
enum_warning_level
*
,
const
char
*
,
Sql_condition
**
)
{
return
sql_errno
==
ER_NO_DEFAULT_FOR_FIELD
;
}
};
static
int
online_alter_read_from_binlog
(
THD
*
thd
,
rpl_group_info
*
rgi
,
Cache_flip_event_log
*
log
)
{
...
...
@@ -11550,6 +11566,8 @@ static int online_alter_read_from_binlog(THD *thd, rpl_group_info *rgi,
thd_progress_report
(
thd
,
0
,
my_b_write_tell
(
log_file
));
Abort_on_warning_instant_set
old_abort_on_warning
(
thd
,
0
);
Has_default_error_handler
hdeh
;
thd
->
push_internal_handler
(
&
hdeh
);
do
{
const
auto
*
descr_event
=
rgi
->
rli
->
relay_log
.
description_event_for_exec
;
...
...
@@ -11569,6 +11587,7 @@ static int online_alter_read_from_binlog(THD *thd, rpl_group_info *rgi,
thd_progress_report
(
thd
,
my_b_tell
(
log_file
),
thd
->
progress
.
max_counter
);
DEBUG_SYNC
(
thd
,
"alter_table_online_progress"
);
}
while
(
!
error
);
thd
->
pop_internal_handler
();
return
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