[1/2] git commit: Fix handling of EXECUTE with skip_metadata=false

2014-10-13 Thread aleksey
Repository: cassandra
Updated Branches:
  refs/heads/trunk 27fdf4211 -> a19c91280


Fix handling of EXECUTE with skip_metadata=false

patch by Aleksey Yeschenko and Jake Luciani; reviewed by Sylvain
Lebresne


Project: http://git-wip-us.apache.org/repos/asf/cassandra/repo
Commit: http://git-wip-us.apache.org/repos/asf/cassandra/commit/63cb95e0
Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/63cb95e0
Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/63cb95e0

Branch: refs/heads/trunk
Commit: 63cb95e012ae3cc197b42b9aa881f905449437b1
Parents: dee15a8
Author: Aleksey Yeschenko 
Authored: Tue Oct 14 00:23:54 2014 +0300
Committer: Aleksey Yeschenko 
Committed: Tue Oct 14 00:24:04 2014 +0300

--
 .../org/apache/cassandra/cql3/ResultSet.java|   2 +-
 .../cql3/PreparedStatementCleanupTest.java  |  86 -
 .../cassandra/cql3/PreparedStatementsTest.java  | 122 +++
 3 files changed, 123 insertions(+), 87 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/cassandra/blob/63cb95e0/src/java/org/apache/cassandra/cql3/ResultSet.java
--
diff --git a/src/java/org/apache/cassandra/cql3/ResultSet.java 
b/src/java/org/apache/cassandra/cql3/ResultSet.java
index 3928060..e463b29 100644
--- a/src/java/org/apache/cassandra/cql3/ResultSet.java
+++ b/src/java/org/apache/cassandra/cql3/ResultSet.java
@@ -266,7 +266,7 @@ public class ResultSet
 
 public Metadata copy()
 {
-return new Metadata(flags, names, columnCount, pagingState);
+return new Metadata(EnumSet.copyOf(flags), names, columnCount, 
pagingState);
 }
 
 // The maximum number of values that the ResultSet can hold. This can 
be bigger than columnCount due to CASSANDRA-4911

http://git-wip-us.apache.org/repos/asf/cassandra/blob/63cb95e0/test/unit/org/apache/cassandra/cql3/PreparedStatementCleanupTest.java
--
diff --git 
a/test/unit/org/apache/cassandra/cql3/PreparedStatementCleanupTest.java 
b/test/unit/org/apache/cassandra/cql3/PreparedStatementCleanupTest.java
deleted file mode 100644
index 3e725e9..000
--- a/test/unit/org/apache/cassandra/cql3/PreparedStatementCleanupTest.java
+++ /dev/null
@@ -1,86 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.cassandra.cql3;
-
-import com.datastax.driver.core.Cluster;
-import com.datastax.driver.core.PreparedStatement;
-import com.datastax.driver.core.Session;
-import org.apache.cassandra.SchemaLoader;
-import org.apache.cassandra.config.DatabaseDescriptor;
-import org.apache.cassandra.config.Schema;
-import org.apache.cassandra.service.EmbeddedCassandraService;
-import org.junit.AfterClass;
-import org.junit.BeforeClass;
-import org.junit.Test;
-
-public class PreparedStatementCleanupTest extends SchemaLoader
-{
-private static Cluster cluster;
-private static Session session;
-
-private static final String KEYSPACE = "prepared_stmt_cleanup";
-private static final String createKsStatement = "CREATE KEYSPACE " + 
KEYSPACE +
-" WITH REPLICATION = { 
'class' : 'SimpleStrategy', 'replication_factor' : 1 };";
-private static final String dropKsStatement = "DROP KEYSPACE IF EXISTS " + 
KEYSPACE;
-
-@BeforeClass
-public static void setup() throws Exception
-{
-Schema.instance.clear();
-
-EmbeddedCassandraService cassandra = new EmbeddedCassandraService();
-cassandra.start();
-
-// Currently the native server start method return before the server 
is fully binded to the socket, so we need
-// to wait slightly before trying to connect to it. We should fix this 
but in the meantime using a sleep.
-Thread.sleep(500);
-
-   cluster = Cluster.builder().addContactPoint("127.0.0.1")
-   
.withPort(DatabaseDescriptor.getNativeTransportPort())
-   .build();
-session 

git commit: Fix handling of EXECUTE with skip_metadata=false

2014-10-13 Thread aleksey
Repository: cassandra
Updated Branches:
  refs/heads/cassandra-2.1 dee15a85c -> 63cb95e01


Fix handling of EXECUTE with skip_metadata=false

patch by Aleksey Yeschenko and Jake Luciani; reviewed by Sylvain
Lebresne


Project: http://git-wip-us.apache.org/repos/asf/cassandra/repo
Commit: http://git-wip-us.apache.org/repos/asf/cassandra/commit/63cb95e0
Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/63cb95e0
Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/63cb95e0

Branch: refs/heads/cassandra-2.1
Commit: 63cb95e012ae3cc197b42b9aa881f905449437b1
Parents: dee15a8
Author: Aleksey Yeschenko 
Authored: Tue Oct 14 00:23:54 2014 +0300
Committer: Aleksey Yeschenko 
Committed: Tue Oct 14 00:24:04 2014 +0300

--
 .../org/apache/cassandra/cql3/ResultSet.java|   2 +-
 .../cql3/PreparedStatementCleanupTest.java  |  86 -
 .../cassandra/cql3/PreparedStatementsTest.java  | 122 +++
 3 files changed, 123 insertions(+), 87 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/cassandra/blob/63cb95e0/src/java/org/apache/cassandra/cql3/ResultSet.java
--
diff --git a/src/java/org/apache/cassandra/cql3/ResultSet.java 
b/src/java/org/apache/cassandra/cql3/ResultSet.java
index 3928060..e463b29 100644
--- a/src/java/org/apache/cassandra/cql3/ResultSet.java
+++ b/src/java/org/apache/cassandra/cql3/ResultSet.java
@@ -266,7 +266,7 @@ public class ResultSet
 
 public Metadata copy()
 {
-return new Metadata(flags, names, columnCount, pagingState);
+return new Metadata(EnumSet.copyOf(flags), names, columnCount, 
pagingState);
 }
 
 // The maximum number of values that the ResultSet can hold. This can 
be bigger than columnCount due to CASSANDRA-4911

http://git-wip-us.apache.org/repos/asf/cassandra/blob/63cb95e0/test/unit/org/apache/cassandra/cql3/PreparedStatementCleanupTest.java
--
diff --git 
a/test/unit/org/apache/cassandra/cql3/PreparedStatementCleanupTest.java 
b/test/unit/org/apache/cassandra/cql3/PreparedStatementCleanupTest.java
deleted file mode 100644
index 3e725e9..000
--- a/test/unit/org/apache/cassandra/cql3/PreparedStatementCleanupTest.java
+++ /dev/null
@@ -1,86 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.cassandra.cql3;
-
-import com.datastax.driver.core.Cluster;
-import com.datastax.driver.core.PreparedStatement;
-import com.datastax.driver.core.Session;
-import org.apache.cassandra.SchemaLoader;
-import org.apache.cassandra.config.DatabaseDescriptor;
-import org.apache.cassandra.config.Schema;
-import org.apache.cassandra.service.EmbeddedCassandraService;
-import org.junit.AfterClass;
-import org.junit.BeforeClass;
-import org.junit.Test;
-
-public class PreparedStatementCleanupTest extends SchemaLoader
-{
-private static Cluster cluster;
-private static Session session;
-
-private static final String KEYSPACE = "prepared_stmt_cleanup";
-private static final String createKsStatement = "CREATE KEYSPACE " + 
KEYSPACE +
-" WITH REPLICATION = { 
'class' : 'SimpleStrategy', 'replication_factor' : 1 };";
-private static final String dropKsStatement = "DROP KEYSPACE IF EXISTS " + 
KEYSPACE;
-
-@BeforeClass
-public static void setup() throws Exception
-{
-Schema.instance.clear();
-
-EmbeddedCassandraService cassandra = new EmbeddedCassandraService();
-cassandra.start();
-
-// Currently the native server start method return before the server 
is fully binded to the socket, so we need
-// to wait slightly before trying to connect to it. We should fix this 
but in the meantime using a sleep.
-Thread.sleep(500);
-
-   cluster = Cluster.builder().addContactPoint("127.0.0.1")
-   
.withPort(DatabaseDescriptor.getNativeTransportPort())
-   .build();
-