Skip to content

Commit

Permalink
Merge pull request #131036 from cockroachdb/blathers/backport-release…
Browse files Browse the repository at this point in the history
…-24.1-129070

release-24.1: changefeedccl: don't hide error encountered during table resolution
  • Loading branch information
asg0451 committed Sep 20, 2024
2 parents 58f50a3 + be5e6bf commit 47047f4
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
3 changes: 1 addition & 2 deletions pkg/ccl/changefeedccl/changefeed_stmt.go
Original file line number Diff line number Diff line change
Expand Up @@ -807,8 +807,7 @@ func getTableDescriptors(
if err != nil {
var m *backupresolver.MissingTableErr
if errors.As(err, &m) {
tableName := m.GetTableName()
err = errors.Errorf("table %q does not exist", tableName)
err = errors.Wrapf(m.Unwrap(), "table %q does not exist", m.GetTableName())
}
err = errors.Wrap(err, "failed to resolve targets in the CHANGEFEED stmt")
if !initialHighWater.IsEmpty() {
Expand Down
2 changes: 1 addition & 1 deletion pkg/ccl/changefeedccl/changefeed_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -714,7 +714,7 @@ func TestMissingTableErr(t *testing.T) {

t.Run("changefeed on non existing table fails", func(t *testing.T) {
kvSQL := sqlutils.MakeSQLRunner(s.DB)
kvSQL.ExpectErr(t, `^pq: failed to resolve targets in the CHANGEFEED stmt: table "foo" does not exist$`,
kvSQL.ExpectErr(t, `^pq: failed to resolve targets in the CHANGEFEED stmt: table "foo" does not exist`,
`CREATE CHANGEFEED FOR foo`,
)
})
Expand Down

0 comments on commit 47047f4

Please sign in to comment.