Uploaded image for project: 'Cassandra'
  1. Cassandra
  2. CASSANDRA-18585

Alter Type does not validate changes like Create Type does

    XMLWordPrintableJSON

Details

    Description

      Create Type attempts to block undesired field types, but this validation is not cared over to Alter Type Add Field; which allows you to add unexpected/desired types

      Assertions.assertThatThrownBy(() -> createType("CREATE TYPE %s (f counter)")).hasRootCauseMessage("A user type cannot contain counters");
      String type = createType(KEYSPACE, "CREATE TYPE %s (a int)");
      schemaChange(String.format("ALTER TYPE %s.%s ADD f counter", KEYSPACE, type));
      UserType udt = Keyspace.open(KEYSPACE).getMetadata().types.get(UTF8Type.instance.decompose(type)).get();
      logger.warn("UDT: {}", udt);
      
      UDT: org.apache.cassandra.db.marshal.UserType(cql_test_keyspace,747970655f3031,61:org.apache.cassandra.db.marshal.Int32Type,66:org.apache.cassandra.db.marshal.CounterColumnType)
      

      Attachments

        Activity

          People

            urbanchef Roman Mushchinski
            dcapwell David Capwell
            Roman Mushchinski
            Andres de la Peña, Stefan Miklosovic
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Time Tracking

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0h
                0h
                Logged:
                Time Spent - 2h 20m
                2h 20m