File tree Expand file tree Collapse file tree 1 file changed +9
-1
lines changed
Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -2550,8 +2550,16 @@ func TestLogicalReplicationCreationChecks(t *testing.T) {
25502550 expectErr (t , "tab" , "cannot create logical replication stream: table tab has a partial index partial_idx" )
25512551 replicationtestutils .WaitForAllProducerJobsToFail (t , dbB )
25522552
2553- // Check for virtual computed columns that are a key of a secondary index .
2553+ // Check for hash sharded indexes .
25542554 dbA .Exec (t , "DROP INDEX partial_idx" )
2555+ dbA .Exec (t , "CREATE INDEX hash_idx ON tab(pk) USING HASH WITH (bucket_count = 4)" )
2556+ dbB .Exec (t , "CREATE INDEX hash_idx ON b.tab(pk) USING HASH WITH (bucket_count = 4)" )
2557+ expectErr (t , "tab" , "tab has a virtual computed column crdb_internal_pk_shard_4 that is a key of index hash_idx" )
2558+ replicationtestutils .WaitForAllProducerJobsToFail (t , dbB )
2559+ dbA .Exec (t , "DROP INDEX hash_idx" )
2560+ dbB .Exec (t , "DROP INDEX hash_idx" )
2561+
2562+ // Check for virtual computed columns that are a key of a secondary index.
25552563 dbA .Exec (t , "ALTER TABLE tab ADD COLUMN virtual_col INT NOT NULL AS (pk + 1) VIRTUAL" )
25562564 dbB .Exec (t , "ALTER TABLE b.tab ADD COLUMN virtual_col INT NOT NULL AS (pk + 1) VIRTUAL" )
25572565 dbA .Exec (t , "CREATE INDEX virtual_col_idx ON tab(virtual_col)" )
You can’t perform that action at this time.
0 commit comments