Skip to content

Commit 52bb304

Browse files
committed
workload: fix tpcc unsafe_internals_accessed logs
The tpcc workload started generating a lot of unsafe_internals_accessed logs due to the use of `crdb_internal.force_error`. This PR fixes this by replacing the usage of `crdb_internal.force_error` with `(1/0)::INT` which provides the same functionality of forcing an error without using an internal built in. Epic: None Release note: None
1 parent 6cabe06 commit 52bb304

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

pkg/workload/tpcc/new_order.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -426,7 +426,8 @@ func (n *newOrder) run(ctx context.Context, wID int) (interface{}, time.Duration
426426
fmt.Sprintf(`
427427
UPDATE stock
428428
SET
429-
s_quantity = CASE (s_i_id, s_w_id) %[1]s ELSE crdb_internal.force_error('', 'unknown case') END,
429+
-- force error in ELSE case with a divide by zero error
430+
s_quantity = CASE (s_i_id, s_w_id) %[1]s ELSE (1/0)::INT END,
430431
s_ytd = CASE (s_i_id, s_w_id) %[2]s END,
431432
s_order_cnt = CASE (s_i_id, s_w_id) %[3]s END,
432433
s_remote_cnt = CASE (s_i_id, s_w_id) %[4]s END

0 commit comments

Comments
 (0)