Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
104293: logictest: add a regression test for json comparison r=rafiss a=rafiss

fixes #49144

Other work resolved this issue. Add a test to make sure we don't regress on the functionality required by some tools.

Release note: None

104447: roachtest: reduce load for schemachange during tpcc tests r=rafiss a=rafiss

fixes #103552
fixes #103256

We've found that the cluster is overloaded during this test, so this commit scales down the load a little bit.

Release note: None

Co-authored-by: Rafi Shamim <rafi@cockroachlabs.com>
  • Loading branch information
craig[bot] and rafiss committed Jun 7, 2023
3 parents 7aea921 + 2a8bdb2 + 6d5d4c1 commit e410663
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 6 deletions.
4 changes: 2 additions & 2 deletions pkg/cmd/roachtest/tests/registry.go
Original file line number Diff line number Diff line change
Expand Up @@ -119,9 +119,9 @@ func RegisterTests(r registry.Registry) {
registerSSTableCorruption(r)
registerSchemaChangeBulkIngest(r)
registerSchemaChangeDuringKV(r)
registerSchemaChangeDuringTPCC1000(r)
registerSchemaChangeDuringTPCC800(r)
registerSchemaChangeIndexTPCC100(r)
registerSchemaChangeIndexTPCC1000(r)
registerSchemaChangeIndexTPCC800(r)
registerSchemaChangeInvertedIndex(r)
registerSchemaChangeMixedVersions(r)
registerDeclSchemaChangeCompatMixedVersions(r)
Expand Down
8 changes: 4 additions & 4 deletions pkg/cmd/roachtest/tests/schemachange.go
Original file line number Diff line number Diff line change
Expand Up @@ -295,8 +295,8 @@ func findIndexProblem(
return nil
}

func registerSchemaChangeIndexTPCC1000(r registry.Registry) {
r.Add(makeIndexAddTpccTest(r.MakeClusterSpec(5, spec.CPU(16)), 1000, time.Hour*2))
func registerSchemaChangeIndexTPCC800(r registry.Registry) {
r.Add(makeIndexAddTpccTest(r.MakeClusterSpec(5, spec.CPU(16)), 800, time.Hour*2))
}

func registerSchemaChangeIndexTPCC100(r registry.Registry) {
Expand Down Expand Up @@ -420,8 +420,8 @@ func makeSchemaChangeBulkIngestTest(
}
}

func registerSchemaChangeDuringTPCC1000(r registry.Registry) {
r.Add(makeSchemaChangeDuringTPCC(r.MakeClusterSpec(5, spec.CPU(16)), 1000, time.Hour*3))
func registerSchemaChangeDuringTPCC800(r registry.Registry) {
r.Add(makeSchemaChangeDuringTPCC(r.MakeClusterSpec(5, spec.CPU(16)), 800, time.Hour*3))
}

func makeSchemaChangeDuringTPCC(
Expand Down
21 changes: 21 additions & 0 deletions pkg/sql/logictest/testdata/logic_test/json
Original file line number Diff line number Diff line change
Expand Up @@ -952,3 +952,24 @@ query T
SELECT j FROM json_subscript_test WHERE j['other_field'] = '2' ORDER BY id
----
{"other_field": 2}

# Regression test for https://github.com/cockroachdb/cockroach/issues/49144.
# Check that json columns can be compared.

statement ok
CREATE TABLE test_49144 (
value jsonb
);
INSERT INTO test_49144 VALUES ('{"c": 2}'), ('{"c": 2.5}'), ('{"c": 3}')

query T
SELECT * FROM test_49144 WHERE ("test_49144"."value" -> 'c') > '2' ORDER BY 1
----
{"c": 2.5}
{"c": 3}

query T
SELECT * FROM test_49144 WHERE ("test_49144"."value" -> 'c') > '2.33' ORDER BY 1
----
{"c": 2.5}
{"c": 3}

0 comments on commit e410663

Please sign in to comment.