Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
124572: opt/bench: fix up recently added query to EndToEnd benchmark r=yuzefovich a=yuzefovich

For some reason, the JSON parser is not happy when we're using the placeholders for the JSON type (due to using escape characters somewhere in the driver), so this commit inlines the placeholder values into the query (we already do this for a couple of other queries). Additionally, we forgot to perform the cleanup to avoid duplicate key violations.

Fixes: cockroachdb#124526.

Release note: None

Co-authored-by: Yahor Yuzefovich <[email protected]>
  • Loading branch information
craig[bot] and yuzefovich committed May 23, 2024
2 parents faa4e64 + 15e7b75 commit 4d5d887
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions pkg/sql/opt/bench/bench_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -455,9 +455,10 @@ var queries = [...]benchQuery{
args: []interface{}{"'abc'"},
},
{
name: "json-insert",
query: "INSERT INTO json_table(k, i, j) VALUES ($1, $2, $3)",
args: []interface{}{1, 10, `'{"a": "foo", "b": "bar", "c": [2, 3, "baz", true, false, null]}'`},
name: "json-insert",
query: `INSERT INTO json_table(k, i, j) VALUES (1, 10, '{"a": "foo", "b": "bar", "c": [2, 3, "baz", true, false, null]}')`,
args: []interface{}{},
cleanup: "TRUNCATE TABLE json_table",
},
{
name: "batch-insert-one",
Expand Down

0 comments on commit 4d5d887

Please sign in to comment.