Skip to content

Commit

Permalink
[#24832] DocDB: Failing test TestPgRegressTablegroup
Browse files Browse the repository at this point in the history
Summary:
As side effect of 8ae50dd/D39539 master error code was added to error message.
It caused test to fail, since it expect exact message match.

Fixed by removing error code from this message.
Jira: DB-13944

Test Plan: ./yb_build.sh release --java-test 'org.yb.pgsql.TestPgRegressTablegroup'

Reviewers: zdrudi

Reviewed By: zdrudi

Subscribers: ybase

Tags: #jenkins-ready

Differential Revision: https://phorge.dev.yugabyte.com/D39910
  • Loading branch information
spolitov committed Nov 12, 2024
1 parent 378da05 commit 3d0d0f9
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 9 deletions.
13 changes: 7 additions & 6 deletions src/yb/master/catalog_manager.cc
Original file line number Diff line number Diff line change
Expand Up @@ -3276,14 +3276,15 @@ Result<ColocationId> ConceiveColocationId(
const CreateTableRequestPB& req, ContainsColocationIdFn contains_colocation_id) {
if (req.has_colocation_id()) {
if (req.colocation_id() < kFirstNormalColocationId) {
return STATUS_EC_FORMAT(
InvalidArgument, MasterError(MasterErrorPB::INVALID_SCHEMA),
"Colocation ID cannot be less than $0", kFirstNormalColocationId);
return STATUS_FORMAT(
InvalidArgument, "Colocation ID cannot be less than $0", kFirstNormalColocationId)
.CloneAndAddErrorCode(MasterError(MasterErrorPB::INVALID_SCHEMA));
}
if (contains_colocation_id(req.colocation_id())) {
return STATUS_EC_FORMAT(
InvalidArgument, MasterError(MasterErrorPB::INVALID_SCHEMA),
"Colocation group already contains a table with colocation ID $0", req.colocation_id());
return STATUS_FORMAT(
InvalidArgument, "Colocation group already contains a table with colocation ID $0",
req.colocation_id())
.CloneAndAddErrorCode(MasterError(MasterErrorPB::INVALID_SCHEMA));
}
return req.colocation_id();
}
Expand Down
4 changes: 1 addition & 3 deletions src/yb/tserver/pg_create_table.cc
Original file line number Diff line number Diff line change
Expand Up @@ -220,9 +220,7 @@ Status PgCreateTable::Exec(
}
return STATUS(InvalidArgument, "Duplicate table");
}
return STATUS_FORMAT(
InvalidArgument, "Invalid table definition: $0",
s.ToString(false /* include_file_and_line */, false /* include_code */));
return STATUS_FORMAT(InvalidArgument, "Invalid table definition: $0", s.message());
}

return Status::OK();
Expand Down

0 comments on commit 3d0d0f9

Please sign in to comment.