Skip to content

Commit

Permalink
Merge branch 'main' into fix-16439
Browse files Browse the repository at this point in the history
  • Loading branch information
ouyuanning authored May 28, 2024
2 parents 305b813 + d50b89e commit ebea053
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 2 deletions.
6 changes: 5 additions & 1 deletion pkg/frontend/authenticate.go
Original file line number Diff line number Diff line change
Expand Up @@ -4026,7 +4026,11 @@ func doDropPublication(ctx context.Context, ses *Session, dp *tree.DropPublicati
return err
}
if !execResultArrayHasData(erArray) {
return moerr.NewInternalError(ctx, "publication '%s' does not exist", dp.Name)
if !dp.IfExists {
return moerr.NewInternalError(ctx, "publication '%s' does not exist", dp.Name)
} else {
return err
}
}

sql, err = getSqlForDropPubInfo(ctx, string(dp.Name), false)
Expand Down
7 changes: 7 additions & 0 deletions test/distributed/cases/tenant/pub_sub2.result
Original file line number Diff line number Diff line change
Expand Up @@ -117,3 +117,10 @@ drop database sub1;
drop database sub2;
drop account a1;
drop account a2;
create database sub1;
create table sub1.t1 (a int,b int);
insert into sub1.t1 values (1, 1), (2, 2), (3, 3);
create publication pub1 database sub1;
drop publication if exists pub1;
drop publication if exists pub1;
drop database if exists sub1;
13 changes: 12 additions & 1 deletion test/distributed/cases/tenant/pub_sub2.sql
Original file line number Diff line number Diff line change
Expand Up @@ -91,4 +91,15 @@ drop publication pub3;
drop database sub1;
drop database sub2;
drop account a1;
drop account a2;
drop account a2;

create database sub1;
create table sub1.t1 (a int,b int);
insert into sub1.t1 values (1, 1), (2, 2), (3, 3);

create publication pub1 database sub1;

drop publication if exists pub1;
drop publication if exists pub1;

drop database if exists sub1;

0 comments on commit ebea053

Please sign in to comment.