Skip to content

Commit fdb5624

Browse files
craig[bot]rafiss
andcommitted
152031: multiregionccl: update comments in test after a bug was fixed r=rafiss a=rafiss The test had comments that described the buggy behavior. bb61a22 fixed the bug, so the comment needed updating. Epic: None Release note: None 152034: workload/schemachange: fix error code for unknown type r=rafiss a=rafiss There is another error that can occur when creating a table with an unknown type, so this commit teaches the workload to handle it. informs #150547 Release note: None Co-authored-by: Rafi Shamim <[email protected]>
3 parents 89e1b5a + 66c2745 + ce4b7b2 commit fdb5624

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

pkg/ccl/multiregionccl/multiregion_system_table_test.go

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -632,12 +632,11 @@ func TestDropRegionFromUserDatabaseCleansUpSystemTables(t *testing.T) {
632632
// Drop a region from the USER database (not system database)
633633
sDB.Exec(t, `ALTER DATABASE userdb DROP REGION "us-east2"`)
634634

635-
// BUG: sql_instances table is now empty, but it shouldn't be
636-
// The region still exists in the system database, so instances should remain
635+
// Verify that dropping a region from a user database doesn't affect system.sql_instances.
636+
// The region still exists in the system database, so instances should remain unchanged.
637637
finalCount := sDB.QueryStr(t, `SELECT count(*) FROM system.sql_instances`)
638638
require.NotEmpty(t, finalCount)
639-
// This assertion will fail, demonstrating the bug.
640-
// The count should remain the same since we only dropped from userdb, not system
639+
// The count should remain the same since we only dropped from userdb, not system.
641640
require.Equal(t, initialCount[0][0], finalCount[0][0],
642641
"sql_instances count should not change when dropping region from user database")
643642
}

pkg/workload/schemachange/operation_generator.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1319,10 +1319,13 @@ func (og *operationGenerator) createTable(ctx context.Context, tx pgx.Tx) (*opSt
13191319
opStmt.potentialExecErrors.addAll(codesWithConditions{
13201320
{code: pgcode.Syntax, condition: hasVectorType},
13211321
{code: pgcode.FeatureNotSupported, condition: hasVectorType},
1322+
{code: pgcode.UndefinedObject, condition: hasVectorType},
13221323
{code: pgcode.Syntax, condition: hasCitextType},
13231324
{code: pgcode.FeatureNotSupported, condition: hasCitextType},
1325+
{code: pgcode.UndefinedObject, condition: hasCitextType},
13241326
{code: pgcode.Syntax, condition: hasLtreeType},
13251327
{code: pgcode.FeatureNotSupported, condition: hasLtreeType},
1328+
{code: pgcode.UndefinedObject, condition: hasLtreeType},
13261329
})
13271330
opStmt.sql = tree.Serialize(stmt)
13281331
return opStmt, nil

0 commit comments

Comments
 (0)