Skip to content

Commit

Permalink
sql: interleaved tables notice was incorrectly labeled as an error
Browse files Browse the repository at this point in the history
Fixes: #70526

Previously, interleaved tables were only deprecated, and
later on we fully dropped support for them returning a new
notice with the word "error" indicating they were no-ops. This
was inadequates because the message is not fatal and only a notice.
To address this, this patch will change them message type to notice.

Release note: None
  • Loading branch information
fqazi committed Sep 21, 2021
1 parent 16d935d commit 12a943b
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 10 deletions.
4 changes: 2 additions & 2 deletions pkg/ccl/logictestccl/testdata/logic_test/partitioning
Original file line number Diff line number Diff line change
Expand Up @@ -97,10 +97,10 @@ CREATE TABLE interleave_root (a INT PRIMARY KEY) PARTITION BY LIST (a) (
PARTITION p0 VALUES IN (0)
)

statement notice ERROR: creation of new interleaved tables or interleaved indexes is no longer supported and will be ignored. For details, see https://www.cockroachlabs.com/docs/releases/v20.2.0#deprecations
statement notice NOTICE: creation of new interleaved tables or interleaved indexes is no longer supported and will be ignored. For details, see https://www.cockroachlabs.com/docs/releases/v20.2.0#deprecations
CREATE TABLE interleave_child (a INT PRIMARY KEY) INTERLEAVE IN PARENT interleave_root (a)

statement notice ERROR: creation of new interleaved tables or interleaved indexes is no longer supported and will be ignored. For details, see https://www.cockroachlabs.com/docs/releases/v20.2.0#deprecations
statement notice NOTICE: creation of new interleaved tables or interleaved indexes is no longer supported and will be ignored. For details, see https://www.cockroachlabs.com/docs/releases/v20.2.0#deprecations
CREATE TABLE t (a INT PRIMARY KEY) INTERLEAVE IN PARENT interleave_root (a) PARTITION BY LIST (a) (
PARTITION p0 VALUES IN (0)
)
Expand Down
4 changes: 2 additions & 2 deletions pkg/ccl/logictestccl/testdata/logic_test/regional_by_row
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ LOCALITY REGIONAL BY ROW
statement ok
CREATE TABLE parent_table (pk INT PRIMARY KEY)

statement notice ERROR: creation of new interleaved tables or interleaved indexes is no longer supported and will be ignored. For details, see https://www.cockroachlabs.com/docs/releases/v20.2.0#deprecations
statement notice NOTICE: creation of new interleaved tables or interleaved indexes is no longer supported and will be ignored. For details, see https://www.cockroachlabs.com/docs/releases/v20.2.0#deprecations
CREATE TABLE regional_by_row_table_int (
pk INT NOT NULL PRIMARY KEY
)
Expand Down Expand Up @@ -348,7 +348,7 @@ CREATE INDEX bad_idx ON regional_by_row_table(a) USING HASH WITH BUCKET_COUNT =
statement error hash sharded indexes are not compatible with REGIONAL BY ROW tables
ALTER TABLE regional_by_row_table ALTER PRIMARY KEY USING COLUMNS(pk2) USING HASH WITH BUCKET_COUNT = 8

statement notice ERROR: creation of new interleaved tables or interleaved indexes is no longer supported and will be ignored. For details, see https://www.cockroachlabs.com/docs/releases/v20.2.0#deprecations
statement notice NOTICE: creation of new interleaved tables or interleaved indexes is no longer supported and will be ignored. For details, see https://www.cockroachlabs.com/docs/releases/v20.2.0#deprecations
CREATE INDEX bad_idx_int ON regional_by_row_table(pk) INTERLEAVE IN PARENT parent_table(pk)

statement ok
Expand Down
9 changes: 3 additions & 6 deletions pkg/sql/create_index.go
Original file line number Diff line number Diff line change
Expand Up @@ -614,12 +614,9 @@ var interleavedTableDisabledError = errors.WithIssueLink(
errors.IssueLink{IssueURL: build.MakeIssueURL(52009)},
)

var interleavedTableDisabledMigrationError = errors.WithIssueLink(
pgerror.New(pgcode.WarningDeprecatedFeature,
"creation of new interleaved tables or interleaved indexes is no longer supported and will be ignored."+
" For details, see https://www.cockroachlabs.com/docs/releases/v20.2.0#deprecations"),
errors.IssueLink{IssueURL: build.MakeIssueURL(52009)},
)
var interleavedTableDisabledMigrationError = pgnotice.Newf(
"creation of new interleaved tables or interleaved indexes is no longer supported and will be ignored." +
" For details, see https://www.cockroachlabs.com/docs/releases/v20.2.0#deprecations")

// interleavedTableDeprecationAction either returns an error, if interleaved
// tables are disabled, or sends a notice, if they're not. Returns any error
Expand Down

0 comments on commit 12a943b

Please sign in to comment.