Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

upgrades: fix upgrade to add statement_diagnostics_requests.completed… #93487

Merged
merged 1 commit into from
Dec 13, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,7 @@ func registerValidateSystemSchemaAfterVersionUpgrade(r registry.Registry) {
}

// expected and actual output of `SHOW CREATE ALL TABLES;`.
var expected string
var actual string
var expected, actual string

// Query node `SHOW CREATE ALL TABLES` and store return in output.
obtainSystemSchemaStep := func(node int, output *string) versionStep {
Expand All @@ -83,13 +82,13 @@ func registerValidateSystemSchemaAfterVersionUpgrade(r registry.Registry) {
}

// Compare whether two strings are equal -- used to compare expected and actual.
validateEquivalenceStep := func(str1, str2 string) versionStep {
validateEquivalenceStep := func(str1, str2 *string) versionStep {
return func(ctx context.Context, t test.Test, u *versionUpgradeTest) {
if str1 != str2 {
if *str1 != *str2 {
t.Fatal("After upgrading, `USE system; SHOW CREATE ALL TABLES;` " +
"does not match expected output after version upgrade.\n")
}
t.L().Printf("validating succeeded")
t.L().Printf("validating succeeded:\n%v", *str1)
}
}

Expand All @@ -116,7 +115,7 @@ func registerValidateSystemSchemaAfterVersionUpgrade(r registry.Registry) {
obtainSystemSchemaStep(1, &actual),

// Compare the results.
validateEquivalenceStep(expected, actual),
validateEquivalenceStep(&expected, &actual),
)
u.run(ctx, t)
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ ALTER TABLE system.statement_diagnostics_requests

createCompletedIdxV3 = `
CREATE INDEX completed_idx ON system.statement_diagnostics_requests (completed, ID)
STORING (statement_fingerprint, sampling_probability, min_execution_latency, expires_at)`
STORING (statement_fingerprint, min_execution_latency, expires_at, sampling_probability)`

dropCompletedIdxV2 = `DROP INDEX IF EXISTS system.statement_diagnostics_requests@completed_idx_v2`
)
Expand Down