Skip to content

Commit

Permalink
VReplication: more unrecoverable error codes (#10559) (#10562)
Browse files Browse the repository at this point in the history
* VReplication: more unrecoverable error codes

Signed-off-by: Shlomi Noach <2607934+shlomi-noach@users.noreply.github.com>

* correct path for test files

Signed-off-by: Shlomi Noach <2607934+shlomi-noach@users.noreply.github.com>
  • Loading branch information
shlomi-noach committed Jun 22, 2022
1 parent 3198c87 commit e5180a1
Show file tree
Hide file tree
Showing 11 changed files with 78 additions and 1 deletion.
1 change: 1 addition & 0 deletions go/mysql/constants.go
Original file line number Diff line number Diff line change
Expand Up @@ -535,6 +535,7 @@ const (
ERTableNameNotAllowedHere = 1250
ERQueryInterrupted = 1317
ERTruncatedWrongValueForField = 1366
ERIllegalValueForType = 1367
ERDataTooLong = 1406
ErrWrongValueForType = 1411
ERWarnDataTruncated = 1265
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
modify column t datetime
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
drop table if exists onlineddl_test;
create table onlineddl_test (
id int auto_increment,
t varchar(128) charset utf8 collate utf8_general_ci,
primary key(id)
) auto_increment=1;

insert into onlineddl_test values (null, '2021-12-21 12:21:11');

drop event if exists onlineddl_test;
delimiter ;;
create event onlineddl_test
on schedule every 1 second
starts current_timestamp
ends current_timestamp + interval 60 second
on completion not preserve
enable
do
begin
insert into onlineddl_test values (null, '2021-12-21 12:21:12');
insert into onlineddl_test values (null, '2021-12-21 12:21:13');
insert into onlineddl_test values (null, '');
end ;;
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Incorrect datetime value
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
modify column t datetime
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
drop table if exists onlineddl_test;
create table onlineddl_test (
id int auto_increment,
t varchar(128) charset utf8 collate utf8_general_ci,
primary key(id)
) auto_increment=1;

insert into onlineddl_test values (null, '2021-12-21 12:21:11');

drop event if exists onlineddl_test;
delimiter ;;
create event onlineddl_test
on schedule every 1 second
starts current_timestamp
ends current_timestamp + interval 60 second
on completion not preserve
enable
do
begin
insert into onlineddl_test values (null, '2021-12-21 12:21:12');
insert into onlineddl_test values (null, '2021-12-21 12:21:13');
insert into onlineddl_test values (null, 'something else');
end ;;
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Incorrect datetime value
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
modify column t datetime
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
drop table if exists onlineddl_test;
create table onlineddl_test (
id int auto_increment,
t varchar(128) charset utf8 collate utf8_general_ci,
primary key(id)
) auto_increment=1;

insert into onlineddl_test values (null, '2021-12-21 12:21:11');

drop event if exists onlineddl_test;
delimiter ;;
create event onlineddl_test
on schedule every 1 second
starts current_timestamp
ends current_timestamp + interval 60 second
on completion not preserve
enable
do
begin
insert into onlineddl_test values (null, '2021-12-21 12:21:12');
insert into onlineddl_test values (null, '2021-12-21 12:21:13');
insert into onlineddl_test values (null, '2021-12-21 12:21:14');
end ;;
2 changes: 2 additions & 0 deletions go/vt/vttablet/tabletmanager/vreplication/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,9 @@ func isUnrecoverableError(err error) bool {
mysql.ERWarnDataOutOfRange,
mysql.ERDataTooLong,
mysql.ERWarnDataTruncated,
mysql.ERTruncatedWrongValue,
mysql.ERTruncatedWrongValueForField,
mysql.ERIllegalValueForType,
mysql.ErrWrongValueForType,
mysql.ErrCantCreateGeometryObject,
mysql.ErrGISDataWrongEndianess,
Expand Down
2 changes: 1 addition & 1 deletion go/vt/vttablet/tabletserver/tabletserver.go
Original file line number Diff line number Diff line change
Expand Up @@ -1501,7 +1501,7 @@ func convertErrorCode(err error) vtrpcpb.Code {
mysql.ERCantAggregate3Collations, mysql.ERCantAggregateNCollations, mysql.ERVariableIsNotStruct, mysql.ERUnknownCollation, mysql.ERWrongNameForIndex,
mysql.ERWrongNameForCatalog, mysql.ERBadFTColumn, mysql.ERTruncatedWrongValue, mysql.ERTooMuchAutoTimestampCols, mysql.ERInvalidOnUpdate, mysql.ERUnknownTimeZone,
mysql.ERInvalidCharacterString, mysql.ERIllegalReference, mysql.ERDerivedMustHaveAlias, mysql.ERTableNameNotAllowedHere, mysql.ERDataTooLong, mysql.ERDataOutOfRange,
mysql.ERTruncatedWrongValueForField:
mysql.ERTruncatedWrongValueForField, mysql.ERIllegalValueForType:
errCode = vtrpcpb.Code_INVALID_ARGUMENT
case mysql.ERSpecifiedAccessDenied:
errCode = vtrpcpb.Code_PERMISSION_DENIED
Expand Down

0 comments on commit e5180a1

Please sign in to comment.