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

Prevent ALTER TYPE from creating circular references

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Low
    • Resolution: Fixed
    • 2.1.10, 2.2.2, 3.0.0 rc1
    • None
    • None
    • Low

    Description

      It's possible to define circular/recursive types using ALTER TYPE. They won't work in practice when you try to insert data, but we should detect this earlier and prevent the type modification.

      Recursive type example (from JAVA-908):

      CREATE TYPE node (name text,);
      ALTER TYPE node ADD children frozen<list<node>>;
      

      Circular example (from Stack overflow):

      create type ping(pingid int);
      create type pong(pongid int, ping frozen<ping>);
      alter type ping ADD pong frozen<pong>;
      

      Note that, in the circular example, references are properly checked when dropping the types, so neither type can be dropped.

      Attachments

        Issue Links

          Activity

            People

              snazy Robert Stupp
              omichallat Olivier Michallat
              Robert Stupp
              Sylvain Lebresne
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: