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

AlterViewStatement.checkAccess can throw exceptions

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Normal
    • Resolution: Not A Problem
    • 2.1.x
    • Legacy/CQL
    • None
    • Normal

    Description

      The AlterViewStatement.checkAccess method has code lines as follow:

      AlterViewStatement.java
        if (baseTable != null)
                  state.hasColumnFamilyAccess(keyspace(), baseTable.name, Permission.ALTER);
      

      These lines can throw InvalidRequestException. Indeed, DropTableStatement.checkAccess has a similar problem, and was fixed in CASSANDRA-6687. The fixed code is as follow:

      DropTableStatement.java
       try
              {
                  state.hasColumnFamilyAccess(keyspace(), columnFamily(), Permission.DROP);
              }
              catch (InvalidRequestException e)
              {
                  if (!ifExists)
                      throw e;
              }
      

      Please fix the problem as CASSANDRA-6687 did.

      Attachments

        1. cassandra.patch
          0.9 kB
          Hao Zhong

        Activity

          People

            haozhong Hao Zhong
            haozhong Hao Zhong
            Hao Zhong
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: