Skip to content

Commit

Permalink
opt/bench: fix up recently added query to EndToEnd benchmark
Browse files Browse the repository at this point in the history
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.

Release note: None
  • Loading branch information
yuzefovich committed May 22, 2024
1 parent 41b6593 commit 15e7b75
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 15e7b75

Please sign in to comment.