You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cassandra.apache.org by if...@apache.org on 2020/01/08 16:11:14 UTC

[cassandra] branch cassandra-3.11 updated (00316e9 -> 9635e55)

This is an automated email from the ASF dual-hosted git repository.

ifesdjeen pushed a change to branch cassandra-3.11
in repository https://gitbox.apache.org/repos/asf/cassandra.git.


    from 00316e9  Merge branch 'cassandra-3.0' into cassandra-3.11
     new 0c54cc9  Queries on hidden columns act as if these columns do not exist
     new 9635e55  Merge branch 'cassandra-3.0' into cassandra-3.11

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .../org/apache/cassandra/config/CFMetaData.java    | 30 ++++++++-
 .../cql3/validation/operations/AlterTest.java      | 27 ++++++++
 .../cql3/validation/operations/CreateTest.java     | 13 ++++
 .../cql3/validation/operations/DeleteTest.java     | 64 ++++++++++++++++++
 .../cql3/validation/operations/InsertTest.java     | 68 +++++++++++++++++++
 .../cql3/validation/operations/SelectTest.java     | 76 ++++++++++++++++++++++
 .../cql3/validation/operations/UpdateTest.java     | 57 ++++++++++++++++
 .../cassandra/db/PartitionRangeReadTest.java       |  6 --
 8 files changed, 334 insertions(+), 7 deletions(-)


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cassandra.apache.org
For additional commands, e-mail: commits-help@cassandra.apache.org


[cassandra] 01/01: Merge branch 'cassandra-3.0' into cassandra-3.11

Posted by if...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

ifesdjeen pushed a commit to branch cassandra-3.11
in repository https://gitbox.apache.org/repos/asf/cassandra.git

commit 9635e55f73598c0f7aece56d5e603198ca464fcc
Merge: 00316e9 0c54cc9
Author: Alex Petrov <ol...@gmail.com>
AuthorDate: Wed Jan 8 17:02:15 2020 +0100

    Merge branch 'cassandra-3.0' into cassandra-3.11

 .../org/apache/cassandra/config/CFMetaData.java    | 30 ++++++++-
 .../cql3/validation/operations/AlterTest.java      | 27 ++++++++
 .../cql3/validation/operations/CreateTest.java     | 13 ++++
 .../cql3/validation/operations/DeleteTest.java     | 64 ++++++++++++++++++
 .../cql3/validation/operations/InsertTest.java     | 68 +++++++++++++++++++
 .../cql3/validation/operations/SelectTest.java     | 76 ++++++++++++++++++++++
 .../cql3/validation/operations/UpdateTest.java     | 57 ++++++++++++++++
 .../cassandra/db/PartitionRangeReadTest.java       |  6 --
 8 files changed, 334 insertions(+), 7 deletions(-)

diff --cc src/java/org/apache/cassandra/config/CFMetaData.java
index 632c530,5888f42..992357d
--- a/src/java/org/apache/cassandra/config/CFMetaData.java
+++ b/src/java/org/apache/cassandra/config/CFMetaData.java
@@@ -125,11 -120,8 +125,13 @@@ public final class CFMetaDat
      // for those tables in practice).
      private volatile ColumnDefinition compactValueColumn;
  
+     private volatile Set<ColumnDefinition> hiddenColumns;
+ 
 +    public final DataResource resource;
 +
 +    //For hot path serialization it's often easier to store this info here
 +    private volatile ColumnFilter allColumnFilter;
 +
      /**
       * These two columns are "virtual" (e.g. not persisted together with schema).
       *
@@@ -398,7 -386,23 +400,25 @@@
          else
              this.comparator = new ClusteringComparator(extractTypes(clusteringColumns));
  
+         Set<ColumnDefinition> hiddenColumns;
+         if (isCompactTable() && isDense && CompactTables.hasEmptyCompactValue(this))
+         {
+             hiddenColumns = Collections.singleton(compactValueColumn);
+         }
+         else if (isCompactTable() && !isDense && !isSuper)
+         {
+             hiddenColumns = Sets.newHashSetWithExpectedSize(clusteringColumns.size() + 1);
+             hiddenColumns.add(compactValueColumn);
+             hiddenColumns.addAll(clusteringColumns);
+ 
+         }
+         else
+         {
+             hiddenColumns = Collections.emptySet();
+         }
+         this.hiddenColumns = hiddenColumns;
++
 +        this.allColumnFilter = ColumnFilter.all(this);
      }
  
      public Indexes getIndexes()
diff --cc test/unit/org/apache/cassandra/cql3/validation/operations/CreateTest.java
index 66078c5,1f436b9..edb6668
--- a/test/unit/org/apache/cassandra/cql3/validation/operations/CreateTest.java
+++ b/test/unit/org/apache/cassandra/cql3/validation/operations/CreateTest.java
@@@ -669,6 -494,19 +669,19 @@@ public class CreateTest extends CQLTest
          assertRows(execute("SELECT * FROM %s WHERE b = ?", 4), row(2, 4));
      }
  
+     /**
+      * Test for CASSANDRA-13917
+      */
+     @Test
+     public void testCreateIndextWithCompactStaticFormat() throws Throwable
+     {
+         createTable("CREATE TABLE %s (a int PRIMARY KEY, b int, c int) WITH COMPACT STORAGE");
 -        assertInvalidMessage("No column definition found for column column1",
++        assertInvalidMessage("Undefined column name column1",
+                              "CREATE INDEX column1_index on %s (column1)");
 -        assertInvalidMessage("No column definition found for column value",
++        assertInvalidMessage("Undefined column name value",
+                              "CREATE INDEX value_index on %s (value)");
+     }
+ 
      @Test
      // tests CASSANDRA-9565
      public void testDoubleWith() throws Throwable
diff --cc test/unit/org/apache/cassandra/cql3/validation/operations/DeleteTest.java
index ef1b5ac,9d495b3..66554da
--- a/test/unit/org/apache/cassandra/cql3/validation/operations/DeleteTest.java
+++ b/test/unit/org/apache/cassandra/cql3/validation/operations/DeleteTest.java
@@@ -1506,6 -1452,70 +1506,70 @@@ public class DeleteTest extends CQLTest
          execute("DELETE FROM %s WHERE k = ? AND a >= ? AND a < ?", "a", 0, 2);
      }
  
+     /**
+      * Test for CASSANDRA-13917
+     */
+     @Test
+     public void testWithCompactStaticFormat() throws Throwable
+     {
+         createTable("CREATE TABLE %s (a int PRIMARY KEY, b int, c int) WITH COMPACT STORAGE");
+         testWithCompactFormat();
+ 
+         // if column1 is present, hidden column is called column2
+         createTable("CREATE TABLE %s (a int PRIMARY KEY, b int, c int, column1 int) WITH COMPACT STORAGE");
 -        assertInvalidMessage("Undefined name column2 in where clause ('column2 = 1')",
++        assertInvalidMessage("Undefined column name column2",
+                              "DELETE FROM %s WHERE a = 1 AND column2= 1");
 -        assertInvalidMessage("Undefined name column2 in where clause ('column2 = 1')",
++        assertInvalidMessage("Undefined column name column2",
+                              "DELETE FROM %s WHERE a = 1 AND column2 = 1 AND value1 = 1");
 -        assertInvalidMessage("Unknown identifier column2",
++        assertInvalidMessage("Undefined column name column2",
+                              "DELETE column2 FROM %s WHERE a = 1");
+ 
+         // if value is present, hidden column is called value1
+         createTable("CREATE TABLE %s (a int PRIMARY KEY, b int, c int, value int) WITH COMPACT STORAGE");
 -        assertInvalidMessage("Undefined name value1 in where clause ('value1 = 1')",
++        assertInvalidMessage("Undefined column name value1",
+                              "DELETE FROM %s WHERE a = 1 AND value1 = 1");
 -        assertInvalidMessage("Undefined name value1 in where clause ('value1 = 1')",
++        assertInvalidMessage("Undefined column name value1",
+                              "DELETE FROM %s WHERE a = 1 AND value1 = 1 AND column1 = 1");
 -        assertInvalidMessage("Unknown identifier value1",
++        assertInvalidMessage("Undefined column name value1",
+                              "DELETE value1 FROM %s WHERE a = 1");
+     }
+ 
+     /**
+      * Test for CASSANDRA-13917
+      */
+     @Test
+     public void testWithCompactNonStaticFormat() throws Throwable
+     {
+         createTable("CREATE TABLE %s (a int, b int, PRIMARY KEY (a, b)) WITH COMPACT STORAGE");
+         execute("INSERT INTO %s (a, b) VALUES (1, 1)");
+         execute("INSERT INTO %s (a, b) VALUES (2, 1)");
+         assertRows(execute("SELECT a, b FROM %s"),
+                    row(1, 1),
+                    row(2, 1));
+         testWithCompactFormat();
+ 
+         createTable("CREATE TABLE %s (a int, b int, v int, PRIMARY KEY (a, b)) WITH COMPACT STORAGE");
+         execute("INSERT INTO %s (a, b, v) VALUES (1, 1, 3)");
+         execute("INSERT INTO %s (a, b, v) VALUES (2, 1, 4)");
+         assertRows(execute("SELECT a, b, v FROM %s"),
+                    row(1, 1, 3),
+                    row(2, 1, 4));
+         testWithCompactFormat();
+     }
+ 
+     private void testWithCompactFormat() throws Throwable
+     {
 -        assertInvalidMessage("Undefined name value in where clause ('value = 1')",
++        assertInvalidMessage("Undefined column name value",
+                              "DELETE FROM %s WHERE a = 1 AND value = 1");
 -        assertInvalidMessage("Undefined name column1 in where clause ('column1 = 1')",
++        assertInvalidMessage("Undefined column name column1",
+                              "DELETE FROM %s WHERE a = 1 AND column1= 1");
 -        assertInvalidMessage("Undefined name value in where clause ('value = 1')",
++        assertInvalidMessage("Undefined column name value",
+                              "DELETE FROM %s WHERE a = 1 AND value = 1 AND column1 = 1");
 -        assertInvalidMessage("Unknown identifier value",
++        assertInvalidMessage("Undefined column name value",
+                              "DELETE value FROM %s WHERE a = 1");
 -        assertInvalidMessage("Unknown identifier column1",
++        assertInvalidMessage("Undefined column name column1",
+                              "DELETE column1 FROM %s WHERE a = 1");
+     }
  
      /**
       * Checks if the memtable is empty or not
diff --cc test/unit/org/apache/cassandra/cql3/validation/operations/InsertTest.java
index 488e1c7,8c42668..5f1c435
--- a/test/unit/org/apache/cassandra/cql3/validation/operations/InsertTest.java
+++ b/test/unit/org/apache/cassandra/cql3/validation/operations/InsertTest.java
@@@ -18,14 -18,11 +18,15 @@@
  
  package org.apache.cassandra.cql3.validation.operations;
  
 +import org.junit.Assert;
  import org.junit.Test;
  
 +import org.apache.cassandra.cql3.Attributes;
  import org.apache.cassandra.cql3.CQLTester;
 +import org.apache.cassandra.cql3.UntypedResultSet;
 +import org.apache.cassandra.cql3.UntypedResultSet.Row;
  import org.apache.cassandra.exceptions.InvalidRequestException;
+ import org.apache.cassandra.utils.ByteBufferUtil;
  
  public class InsertTest extends CQLTester
  {
@@@ -210,6 -196,73 +211,73 @@@
                               "INSERT INTO %s (partitionKey, clustering_1, clustering_2, valuex) VALUES (0, 0, 0, 2)");
      }
  
+     /**
+      * Test for CASSANDRA-13917
+      */
+     @Test
+     public void testInsertWithCompactStaticFormat() throws Throwable
+     {
+         testWithCompactTable("CREATE TABLE %s (a int PRIMARY KEY, b int, c int) WITH COMPACT STORAGE");
+ 
+         // if column1 is present, hidden column is called column2
+         createTable("CREATE TABLE %s (a int PRIMARY KEY, b int, c int, column1 int) WITH COMPACT STORAGE");
+         execute("INSERT INTO %s (a, b, c, column1) VALUES (1, 1, 1, 1)");
 -        assertInvalidMessage("Unknown identifier column2",
++        assertInvalidMessage("Undefined column name column2",
+                              "INSERT INTO %s (a, b, c, column2) VALUES (1, 1, 1, 1)");
+ 
+         // if value is present, hidden column is called value1
+         createTable("CREATE TABLE %s (a int PRIMARY KEY, b int, c int, value int) WITH COMPACT STORAGE");
+         execute("INSERT INTO %s (a, b, c, value) VALUES (1, 1, 1, 1)");
 -        assertInvalidMessage("Unknown identifier value1",
++        assertInvalidMessage("Undefined column name value1",
+                              "INSERT INTO %s (a, b, c, value1) VALUES (1, 1, 1, 1)");
+     }
+ 
+     /**
+      * Test for CASSANDRA-13917
+      */
+     @Test
+     public void testInsertWithCompactNonStaticFormat() throws Throwable
+     {
+         testWithCompactTable("CREATE TABLE %s (a int, b int, PRIMARY KEY (a, b)) WITH COMPACT STORAGE");
+         testWithCompactTable("CREATE TABLE %s (a int, b int, v int, PRIMARY KEY (a, b)) WITH COMPACT STORAGE");
+     }
+ 
+     private void testWithCompactTable(String tableQuery) throws Throwable
+     {
+         createTable(tableQuery);
+ 
+         // pass correct types to the hidden columns
 -        assertInvalidMessage("Unknown identifier column1",
++        assertInvalidMessage("Undefined column name column1",
+                              "INSERT INTO %s (a, b, column1) VALUES (?, ?, ?)",
+                              1, 1, 1, ByteBufferUtil.bytes('a'));
 -        assertInvalidMessage("Unknown identifier value",
++        assertInvalidMessage("Undefined column name value",
+                              "INSERT INTO %s (a, b, value) VALUES (?, ?, ?)",
+                              1, 1, 1, ByteBufferUtil.bytes('a'));
 -        assertInvalidMessage("Unknown identifier column1",
++        assertInvalidMessage("Undefined column name column1",
+                              "INSERT INTO %s (a, b, column1, value) VALUES (?, ?, ?, ?)",
+                              1, 1, 1, ByteBufferUtil.bytes('a'), ByteBufferUtil.bytes('b'));
 -        assertInvalidMessage("Unknown identifier value",
++        assertInvalidMessage("Undefined column name value",
+                              "INSERT INTO %s (a, b, value, column1) VALUES (?, ?, ?, ?)",
+                              1, 1, 1, ByteBufferUtil.bytes('a'), ByteBufferUtil.bytes('b'));
+ 
+         // pass incorrect types to the hidden columns
 -        assertInvalidMessage("Unknown identifier value",
++        assertInvalidMessage("Undefined column name value",
+                              "INSERT INTO %s (a, b, value) VALUES (?, ?, ?)",
+                              1, 1, 1, 1);
 -        assertInvalidMessage("Unknown identifier column1",
++        assertInvalidMessage("Undefined column name column1",
+                              "INSERT INTO %s (a, b, column1) VALUES (?, ?, ?)",
+                              1, 1, 1, 1);
+         assertEmpty(execute("SELECT * FROM %s"));
+ 
+         // pass null to the hidden columns
 -        assertInvalidMessage("Unknown identifier value",
++        assertInvalidMessage("Undefined column name value",
+                              "INSERT INTO %s (a, b, value) VALUES (?, ?, ?)",
+                              1, 1, null);
 -        assertInvalidMessage("Unknown identifier column1",
++        assertInvalidMessage("Undefined column name column1",
+                              "INSERT INTO %s (a, b, column1) VALUES (?, ?, ?)",
+                              1, 1, null);
+     }
+ 
      @Test
      public void testInsertWithCompactStorageAndTwoClusteringColumns() throws Throwable
      {
diff --cc test/unit/org/apache/cassandra/cql3/validation/operations/SelectTest.java
index 4cdf087,6182f11..dcf454a
--- a/test/unit/org/apache/cassandra/cql3/validation/operations/SelectTest.java
+++ b/test/unit/org/apache/cassandra/cql3/validation/operations/SelectTest.java
@@@ -4795,4 -3022,80 +4795,80 @@@ public class SelectTest extends CQLTest
              i++;
          }
      }
+ 
+     /**
+      * Test for CASSANDRA-13917
+      */
+     @Test
+     public void testWithCompactStaticFormat() throws Throwable
+     {
+         createTable("CREATE TABLE %s (a int PRIMARY KEY, b int, c int) WITH COMPACT STORAGE");
+         execute("INSERT INTO %s (a, b, c) VALUES (1, 1, 1)");
+         execute("INSERT INTO %s (a, b, c) VALUES (2, 1, 1)");
+         assertRows(execute("SELECT a, b, c FROM %s"),
+                    row(1, 1, 1),
+                    row(2, 1, 1));
+         testWithCompactFormat();
+ 
+         // if column column1 is present, hidden column is called column2
+         createTable("CREATE TABLE %s (a int PRIMARY KEY, b int, c int, column1 int) WITH COMPACT STORAGE");
+         execute("INSERT INTO %s (a, b, c, column1) VALUES (1, 1, 1, 1)");
+         execute("INSERT INTO %s (a, b, c, column1) VALUES (2, 1, 1, 2)");
+         assertRows(execute("SELECT a, b, c, column1 FROM %s"),
+                    row(1, 1, 1, 1),
+                    row(2, 1, 1, 2));
 -        assertInvalidMessage("Undefined name column2 in selection clause",
++        assertInvalidMessage("Undefined column name column2",
+                              "SELECT a, column2, value FROM %s");
+ 
+         // if column value is present, hidden column is called value1
+         createTable("CREATE TABLE %s (a int PRIMARY KEY, b int, c int, value int) WITH COMPACT STORAGE");
+         execute("INSERT INTO %s (a, b, c, value) VALUES (1, 1, 1, 1)");
+         execute("INSERT INTO %s (a, b, c, value) VALUES (2, 1, 1, 2)");
+         assertRows(execute("SELECT a, b, c, value FROM %s"),
+                    row(1, 1, 1, 1),
+                    row(2, 1, 1, 2));
 -        assertInvalidMessage("Undefined name value1 in selection clause",
++        assertInvalidMessage("Undefined column name value1",
+                              "SELECT a, value1, value FROM %s");
+     }
+ 
+     /**
+      * Test for CASSANDRA-13917
+     */
+     @Test
+     public void testWithCompactNonStaticFormat() throws Throwable
+     {
+         createTable("CREATE TABLE %s (a int, b int, PRIMARY KEY (a, b)) WITH COMPACT STORAGE");
+         execute("INSERT INTO %s (a, b) VALUES (1, 1)");
+         execute("INSERT INTO %s (a, b) VALUES (2, 1)");
+         assertRows(execute("SELECT a, b FROM %s"),
+                    row(1, 1),
+                    row(2, 1));
+         testWithCompactFormat();
+ 
+         createTable("CREATE TABLE %s (a int, b int, v int, PRIMARY KEY (a, b)) WITH COMPACT STORAGE");
+         execute("INSERT INTO %s (a, b, v) VALUES (1, 1, 3)");
+         execute("INSERT INTO %s (a, b, v) VALUES (2, 1, 4)");
+         assertRows(execute("SELECT a, b, v FROM %s"),
+                    row(1, 1, 3),
+                    row(2, 1, 4));
+         testWithCompactFormat();
+     }
+ 
+     private void testWithCompactFormat() throws Throwable
+     {
 -        assertInvalidMessage("Undefined name column1 in selection clause",
++        assertInvalidMessage("Undefined column name column1",
+                              "SELECT column1 FROM %s");
 -        assertInvalidMessage("Undefined name value in selection clause",
++        assertInvalidMessage("Undefined column name value",
+                              "SELECT value FROM %s");
 -        assertInvalidMessage("Undefined name value in selection clause",
++        assertInvalidMessage("Undefined column name value",
+                              "SELECT value, column1 FROM %s");
 -        assertInvalid("Undefined name column1 in where clause ('column1 = NULL')",
++        assertInvalid("Undefined column name column1",
+                       "SELECT * FROM %s WHERE column1 = null ALLOW FILTERING");
 -        assertInvalid("Undefined name value in where clause ('value = NULL')",
++        assertInvalid("Undefined column name value",
+                       "SELECT * FROM %s WHERE value = null ALLOW FILTERING");
 -        assertInvalidMessage("Undefined name column1 in selection clause",
++        assertInvalidMessage("Undefined column name column1",
+                              "SELECT WRITETIME(column1) FROM %s");
 -        assertInvalidMessage("Undefined name value in selection clause",
++        assertInvalidMessage("Undefined column name value",
+                              "SELECT WRITETIME(value) FROM %s");
+     }
  }
diff --cc test/unit/org/apache/cassandra/cql3/validation/operations/UpdateTest.java
index af6c4f9,8a9be19..1a8b49b
--- a/test/unit/org/apache/cassandra/cql3/validation/operations/UpdateTest.java
+++ b/test/unit/org/apache/cassandra/cql3/validation/operations/UpdateTest.java
@@@ -23,16 -23,14 +23,17 @@@ import java.util.Arrays
  import org.junit.Assert;
  import org.junit.Test;
  
 -import static org.apache.commons.lang3.StringUtils.isEmpty;
 -import static org.junit.Assert.assertTrue;
 -
 +import org.apache.cassandra.cql3.Attributes;
  import org.apache.cassandra.cql3.CQLTester;
 +import org.apache.cassandra.cql3.UntypedResultSet;
 +import org.apache.cassandra.cql3.UntypedResultSet.Row;
  import org.apache.cassandra.db.ColumnFamilyStore;
  import org.apache.cassandra.db.Keyspace;
+ import org.apache.cassandra.utils.ByteBufferUtil;
  
 +import static org.apache.commons.lang3.StringUtils.isEmpty;
 +import static org.junit.Assert.assertTrue;
 +
  public class UpdateTest extends CQLTester
  {
      @Test
@@@ -667,4 -609,60 +668,60 @@@
          ColumnFamilyStore cfs = keyspace.getColumnFamilyStore(currentTable());
          return cfs.metric.allMemtablesLiveDataSize.getValue() == 0;
      }
+ 
+     /**
+      * Test for CASSANDRA-13917
+      */
+     @Test
+     public void testUpdateWithCompactStaticFormat() throws Throwable
+     {
+         testWithCompactFormat("CREATE TABLE %s (a int PRIMARY KEY, b int, c int) WITH COMPACT STORAGE");
+ 
 -        assertInvalidMessage("Undefined name column1 in where clause ('column1 = ?')",
++        assertInvalidMessage("Undefined column name column1",
+                              "UPDATE %s SET b = 1 WHERE column1 = ?",
+                              ByteBufferUtil.bytes('a'));
 -        assertInvalidMessage("Undefined name value in where clause ('value = ?')",
++        assertInvalidMessage("Undefined column name value",
+                              "UPDATE %s SET b = 1 WHERE value = ?",
+                              ByteBufferUtil.bytes('a'));
+ 
+         // if column1 is present, hidden column is called column2
+         createTable("CREATE TABLE %s (a int PRIMARY KEY, b int, c int, column1 int) WITH COMPACT STORAGE");
+         execute("INSERT INTO %s (a, b, c, column1) VALUES (1, 1, 1, 1)");
+         execute("UPDATE %s SET column1 = 6 WHERE a = 1");
 -        assertInvalidMessage("Unknown identifier column2", "UPDATE %s SET column2 = 6 WHERE a = 0");
 -        assertInvalidMessage("Unknown identifier value", "UPDATE %s SET value = 6 WHERE a = 0");
++        assertInvalidMessage("Undefined column name column2", "UPDATE %s SET column2 = 6 WHERE a = 0");
++        assertInvalidMessage("Undefined column name value", "UPDATE %s SET value = 6 WHERE a = 0");
+ 
+         // if value is present, hidden column is called value1
+         createTable("CREATE TABLE %s (a int PRIMARY KEY, b int, c int, value int) WITH COMPACT STORAGE");
+         execute("INSERT INTO %s (a, b, c, value) VALUES (1, 1, 1, 1)");
+         execute("UPDATE %s SET value = 6 WHERE a = 1");
 -        assertInvalidMessage("Unknown identifier column1", "UPDATE %s SET column1 = 6 WHERE a = 1");
 -        assertInvalidMessage("Unknown identifier value1", "UPDATE %s SET value1 = 6 WHERE a = 1");
++        assertInvalidMessage("Undefined column name column1", "UPDATE %s SET column1 = 6 WHERE a = 1");
++        assertInvalidMessage("Undefined column name value1", "UPDATE %s SET value1 = 6 WHERE a = 1");
+     }
+ 
+     /**
+      * Test for CASSANDRA-13917
+      */
+     @Test
+     public void testUpdateWithCompactNonStaticFormat() throws Throwable
+     {
+         testWithCompactFormat("CREATE TABLE %s (a int, b int, PRIMARY KEY (a, b)) WITH COMPACT STORAGE");
+         testWithCompactFormat("CREATE TABLE %s (a int, b int, v int, PRIMARY KEY (a, b)) WITH COMPACT STORAGE");
+     }
+ 
+     private void testWithCompactFormat(String tableQuery) throws Throwable
+     {
+         createTable(tableQuery);
+         // pass correct types to hidden columns
 -        assertInvalidMessage("Unknown identifier column1",
++        assertInvalidMessage("Undefined column name column1",
+                              "UPDATE %s SET column1 = ? WHERE a = 0",
+                              ByteBufferUtil.bytes('a'));
 -        assertInvalidMessage("Unknown identifier value",
++        assertInvalidMessage("Undefined column name value",
+                              "UPDATE %s SET value = ? WHERE a = 0",
+                              ByteBufferUtil.bytes('a'));
+ 
+         // pass incorrect types to hidden columns
 -        assertInvalidMessage("Unknown identifier column1", "UPDATE %s SET column1 = 6 WHERE a = 0");
 -        assertInvalidMessage("Unknown identifier value", "UPDATE %s SET value = 6 WHERE a = 0");
++        assertInvalidMessage("Undefined column name column1", "UPDATE %s SET column1 = 6 WHERE a = 0");
++        assertInvalidMessage("Undefined column name value", "UPDATE %s SET value = 6 WHERE a = 0");
+     }
  }


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cassandra.apache.org
For additional commands, e-mail: commits-help@cassandra.apache.org