Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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: #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
- Loading branch information