From 8ecae38d6bb20838d137300aeca58a91524d45a4 Mon Sep 17 00:00:00 2001 From: Piotr Sarna Date: Thu, 2 Jul 2020 10:37:29 +0200 Subject: [PATCH] test: expand testing internal schema changes ... in order to ensure that not only ALTER TABLE, but also other schema altering statements are not allowed for distributed tables/keyspaces. --- test/boost/cql_query_test.cc | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/test/boost/cql_query_test.cc b/test/boost/cql_query_test.cc index f3bfe38ceb..2dd53458c7 100644 --- a/test/boost/cql_query_test.cc +++ b/test/boost/cql_query_test.cc @@ -4575,12 +4575,16 @@ SEASTAR_TEST_CASE(ck_slice_with_null_is_forbidden) { }); } -SEASTAR_TEST_CASE(test_internal_alter_table_on_a_distributed_table) { +SEASTAR_TEST_CASE(test_internal_schema_changes_on_a_distributed_table) { return do_with_cql_env([](cql_test_env& e) { return seastar::async([&e] { cquery_nofail(e, "create table t (p int primary key, v int)"); - const auto local_err = exception_predicate::message_contains("local"); + const auto local_err = exception_predicate::message_contains("internal query"); BOOST_REQUIRE_EXCEPTION(db::execute_cql("alter table ks.t add col abcd").get(), std::logic_error, local_err); + BOOST_REQUIRE_EXCEPTION(db::execute_cql("create table ks.t2 (id int primary key)").get(), std::logic_error, local_err); + BOOST_REQUIRE_EXCEPTION(db::execute_cql("create index on ks.t(v)").get(), std::logic_error, local_err); + BOOST_REQUIRE_EXCEPTION(db::execute_cql("drop table ks.t").get(), std::logic_error, local_err); + BOOST_REQUIRE_EXCEPTION(db::execute_cql("drop keyspace ks").get(), std::logic_error, local_err); }); }); }