Files
scylladb/test/cql/token_from_null_test.cql
Jan Ciolek d2ef55b12c test: use NetworkTopologyStrategy in all unit tests
As described in https://github.com/scylladb/scylladb/issues/8638,
we're moving away from `SimpleStrategy`, in the future
it will become deprecated.

We should remove all uses of it and replace them
with `NetworkTopologyStrategy`.

This change replaces `SimpleStrategy` with
`NetworkTopologyStrategy` in all unit tests,
or at least in the ones where it was reasonable to do so.
Some of the tests were written explicitly to test the
`SimpleStrategy` strategy, or changing the keyspace from
`SimpleStrategy` to `NetworkTopologyStrategy`.
These tests were left intact.
It's still a feature that is supported,
even if it's slowly getting deprecated.

The typical way to use `NetworkTopologyStrategy` is
to specify a replication factor for each datacenter.
This could be a bit cumbersome, we would have to fetch
the list of datacenters, set the repfactors, etc.

Luckily there is another way - we can just specify
a replication factor to use for or each existing
datacenter, like this:
```cql
CREATE KEYSPACE {} WITH REPLICATION =
{'class' : 'NetworkTopologyStrategy', 'replication_factor' : 1};
```

This makes the change rather straightforward - just replace all
instances of `'SimpleStrategy'', with `'NetworkTopologyStrategy'`.

Refs: https://github.com/scylladb/scylladb/issues/8638

Signed-off-by: Jan Ciolek <jan.ciolek@scylladb.com>

Closes #13990
2023-05-23 08:52:56 +03:00

14 lines
539 B
SQL

-- single null value
CREATE KEYSPACE reproducer WITH replication = {'class': 'NetworkTopologyStrategy', 'replication_factor': 1};
CREATE TABLE reproducer.t(pk int PRIMARY KEY, v int);
INSERT INTO reproducer.t (pk) VALUES (1);
SELECT TOKEN(v) FROM reproducer.t;
-- multiple null values
CREATE TABLE reproducer.t2(pk int PRIMARY KEY, a int, b int);
INSERT INTO reproducer.t2 (pk) VALUES (1);
SELECT TOKEN(pk, a, b) FROM reproducer.t2;
SELECT TOKEN(pk, b) FROM reproducer.t2;
SELECT TOKEN(a, b) FROM reproducer.t2;
DROP KEYSPACE reproducer;