Files
scylladb/cql3
Nadav Har'El 7cdee303cf Merge 'ks_prop_defs: disallow empty replication factor string in NTS' from Jan Ciołek
A CREATE KEYSPACE query which specifies an empty string ('') as the replication factor value is currently allowed:
```cql
CREATE KEYSPACE bad_ks WITH replication = {'class': 'NetworkTopologyStrategy', 'replication_factor': ''};
```

This is wrong, it's invalid to have an empty replication factor string.
It creates a keyspace without any replication, so the tables inside of it aren't writable.

Trying to create a `SimpleStrategy` keyspace with such replication factor throws an error, `NetworkTopolgyStrategy` should do the same.

The problem was in `prepare_options`, it treated an empty replication factor string as no replication factor.
Changing it to `std::optional` fixes the problem,
Now `std::nullopt` means no replication factor, and `make_optional("")` means that there is a replication factor, but it's described by an empty string.

Fixes: https://github.com/scylladb/scylladb/issues/13986

Closes #13988

* github.com:scylladb/scylladb:
  test/network_topology_strategy_test: Test NTS with replication_factor option in test_invalid_dcs
  ks_prop_defs: disallow empty replication factor string in NTS
2023-05-24 21:39:31 +03:00
..
2023-02-28 22:26:43 +02:00
2023-02-14 11:19:03 +02:00
2023-04-29 13:11:31 +02:00
2023-01-18 10:38:24 +02:00
2023-02-15 11:09:04 +02:00
2023-04-26 14:09:58 +08:00
2023-01-18 10:38:24 +02:00
2023-02-15 11:09:04 +02:00
2023-04-28 16:59:29 +08:00
2023-02-15 11:09:04 +02:00
2023-02-19 21:05:45 +02:00