-
Notifications
You must be signed in to change notification settings - Fork 4k
Open
Labels
A-testeng-perfA-testingTesting tools and infrastructureTesting tools and infrastructureC-bugCode not up to spec/doc, specs & docs deemed correct. Solution expected to change code/behavior.Code not up to spec/doc, specs & docs deemed correct. Solution expected to change code/behavior.T-testengTestEng TeamTestEng Team
Description
This line panics when rows is 1 because it passes 0 to rand.IntN:
cockroach/pkg/workload/bank/bank.go
Line 240 in 7608143
| to := rng.IntN(b.rows - 1) |
We should require rows to be at least 2. If we don't, then this update query will need to be updated, otherwise the balance will just continuously decrease:
cockroach/pkg/workload/bank/bank.go
Lines 213 to 217 in 7608143
| updateStmt, err := db.Prepare(fmt.Sprintf(` | |
| UPDATE %s | |
| SET balance = CASE id WHEN $1 THEN balance-$3 WHEN $2 THEN balance+$3 END | |
| WHERE id IN ($1, $2) | |
| `, b.tableName("bank", tableIdx))) |
Jira issue: CRDB-54632
Metadata
Metadata
Assignees
Labels
A-testeng-perfA-testingTesting tools and infrastructureTesting tools and infrastructureC-bugCode not up to spec/doc, specs & docs deemed correct. Solution expected to change code/behavior.Code not up to spec/doc, specs & docs deemed correct. Solution expected to change code/behavior.T-testengTestEng TeamTestEng Team