You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cassandra.apache.org by mi...@apache.org on 2014/05/08 22:35:50 UTC

[01/10] git commit: cqlsh should return a non-zero error code if a query fails

Repository: cassandra
Updated Branches:
  refs/heads/cassandra-1.2 d839350f4 -> 8abe9f6f5
  refs/heads/cassandra-2.0 d6f32e4fc -> 51f9e9804
  refs/heads/cassandra-2.1 8dab582c2 -> a0d096b03
  refs/heads/trunk 28497fd11 -> 310d6e4ef


cqlsh should return a non-zero error code if a query fails

patch by Branden Visser and Mikhail Stepura; reviewed by Mikhail Stepura for CASSANDRA-6344


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

Branch: refs/heads/cassandra-1.2
Commit: 8abe9f6f522146dc478f006a8160b4db1c233169
Parents: d839350
Author: Mikhail Stepura <mi...@apache.org>
Authored: Thu May 8 13:20:35 2014 -0700
Committer: Mikhail Stepura <mi...@apache.org>
Committed: Thu May 8 13:27:41 2014 -0700

----------------------------------------------------------------------
 CHANGES.txt | 1 +
 bin/cqlsh   | 4 ++++
 2 files changed, 5 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/8abe9f6f/CHANGES.txt
----------------------------------------------------------------------
diff --git a/CHANGES.txt b/CHANGES.txt
index 312cf06..7021e7b 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -23,6 +23,7 @@
  * remove duplicate query for local tokens (CASSANDRA-7182)
  * raise streaming phi convict threshold level (CASSANDRA-7063)
  * reduce garbage creation in calculatePendingRanges (CASSANDRA-7191)
+ * exit CQLSH with error status code if script fails (CASSANDRA-6344)
 
 1.2.16
  * Add UNLOGGED, COUNTER options to BATCH documentation (CASSANDRA-6816)

http://git-wip-us.apache.org/repos/asf/cassandra/blob/8abe9f6f/bin/cqlsh
----------------------------------------------------------------------
diff --git a/bin/cqlsh b/bin/cqlsh
index 8e1e0e2..24cb3b8 100755
--- a/bin/cqlsh
+++ b/bin/cqlsh
@@ -548,6 +548,7 @@ class Shell(cmd.Cmd):
             self.show_line_nums = True
         self.stdin = stdin
         self.query_out = sys.stdout
+        self.statement_error = False
 
     def set_expanded_cql_version(self, ver):
         ver, vertuple = full_cql_version(ver)
@@ -2175,6 +2176,7 @@ class Shell(cmd.Cmd):
         self.query_out.flush()
 
     def printerr(self, text, color=RED, newline=True, shownum=None):
+        self.statement_error = True
         if shownum is None:
             shownum = self.show_line_nums
         if shownum:
@@ -2404,6 +2406,8 @@ def main(options, hostname, port):
 
     shell.cmdloop()
     save_history()
+    if options.file and shell.statement_error:
+        sys.exit(2)
 
 if __name__ == '__main__':
     main(*read_options(sys.argv[1:], os.environ))


[08/10] git commit: Merge branch 'cassandra-2.0' into cassandra-2.1

Posted by mi...@apache.org.
Merge branch 'cassandra-2.0' into cassandra-2.1

Conflicts:
	CHANGES.txt


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

Branch: refs/heads/cassandra-2.1
Commit: a0d096b03639ec0824ed500af82550779e293b1e
Parents: 8dab582 51f9e98
Author: Mikhail Stepura <mi...@apache.org>
Authored: Thu May 8 13:32:40 2014 -0700
Committer: Mikhail Stepura <mi...@apache.org>
Committed: Thu May 8 13:32:40 2014 -0700

----------------------------------------------------------------------
 CHANGES.txt | 2 +-
 bin/cqlsh   | 4 ++++
 2 files changed, 5 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/a0d096b0/CHANGES.txt
----------------------------------------------------------------------
diff --cc CHANGES.txt
index 057fd34,3f7d68e..2d9ce55
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@@ -20,74 -26,24 +20,74 @@@ Merged from 1.2
   * Add Cloudstack snitch (CASSANDRA-7147)
   * Update system.peers correctly when relocating tokens (CASSANDRA-7126)
   * Add Google Compute Engine snitch (CASSANDRA-7132)
 - * Fix nodetool display with vnodes (CASSANDRA-7082)
 - * Fix schema concurrency exceptions (CASSANDRA-6841)
 - * Fix BatchlogManager#deleteBatch() use of millisecond timsestamps
 -   (CASSANDRA-6822)
 - * Fix batchlog to account for CF truncation records (CASSANDRA-6999)
 - * Fix CQLSH parsing of functions and BLOB literals (CASSANDRA-7018)
 - * Require nodetool rebuild_index to specify index names (CASSANDRA-7038)
 - * Ensure that batchlog and hint timeouts do not produce hints (CASSANDRA-7058)
 - * Always clean up references in SerializingCache (CASSANDRA-6994)
 - * Don't shut MessagingService down when replacing a node (CASSANDRA-6476)
 - * fix npe when doing -Dcassandra.fd_initial_value_ms (CASSANDRA-6751)
 - * Preserves CQL metadata when updating table from thrift (CASSANDRA-6831)
   * remove duplicate query for local tokens (CASSANDRA-7182)
- 
 - * raise streaming phi convict threshold level (CASSANDRA-7063)
 - * reduce garbage creation in calculatePendingRanges (CASSANDRA-7191)
+  * exit CQLSH with error status code if script fails (CASSANDRA-6344)
  
 -2.0.7
 +2.1.0-beta2
 + * Increase default CL space to 8GB (CASSANDRA-7031)
 + * Add range tombstones to read repair digests (CASSANDRA-6863)
 + * Fix BTree.clear for large updates (CASSANDRA-6943)
 + * Fail write instead of logging a warning when unable to append to CL
 +   (CASSANDRA-6764)
 + * Eliminate possibility of CL segment appearing twice in active list 
 +   (CASSANDRA-6557)
 + * Apply DONTNEED fadvise to commitlog segments (CASSANDRA-6759)
 + * Switch CRC component to Adler and include it for compressed sstables 
 +   (CASSANDRA-4165)
 + * Allow cassandra-stress to set compaction strategy options (CASSANDRA-6451)
 + * Add broadcast_rpc_address option to cassandra.yaml (CASSANDRA-5899)
 + * Auto reload GossipingPropertyFileSnitch config (CASSANDRA-5897)
 + * Fix overflow of memtable_total_space_in_mb (CASSANDRA-6573)
 + * Fix ABTC NPE and apply update function correctly (CASSANDRA-6692)
 + * Allow nodetool to use a file or prompt for password (CASSANDRA-6660)
 + * Fix AIOOBE when concurrently accessing ABSC (CASSANDRA-6742)
 + * Fix assertion error in ALTER TYPE RENAME (CASSANDRA-6705)
 + * Scrub should not always clear out repaired status (CASSANDRA-5351)
 + * Improve handling of range tombstone for wide partitions (CASSANDRA-6446)
 + * Fix ClassCastException for compact table with composites (CASSANDRA-6738)
 + * Fix potentially repairing with wrong nodes (CASSANDRA-6808)
 + * Change caching option syntax (CASSANDRA-6745)
 + * Fix stress to do proper counter reads (CASSANDRA-6835)
 + * Fix help message for stress counter_write (CASSANDRA-6824)
 + * Fix stress smart Thrift client to pick servers correctly (CASSANDRA-6848)
 + * Add logging levels (minimal, normal or verbose) to stress tool (CASSANDRA-6849)
 + * Fix race condition in Batch CLE (CASSANDRA-6860)
 + * Improve cleanup/scrub/upgradesstables failure handling (CASSANDRA-6774)
 + * ByteBuffer write() methods for serializing sstables (CASSANDRA-6781)
 + * Proper compare function for CollectionType (CASSANDRA-6783)
 + * Update native server to Netty 4 (CASSANDRA-6236)
 + * Fix off-by-one error in stress (CASSANDRA-6883)
 + * Make OpOrder AutoCloseable (CASSANDRA-6901)
 + * Remove sync repair JMX interface (CASSANDRA-6900)
 + * Add multiple memory allocation options for memtables (CASSANDRA-6689, 6694)
 + * Remove adjusted op rate from stress output (CASSANDRA-6921)
 + * Add optimized CF.hasColumns() implementations (CASSANDRA-6941)
 + * Serialize batchlog mutations with the version of the target node
 +   (CASSANDRA-6931)
 + * Optimize CounterColumn#reconcile() (CASSANDRA-6953)
 + * Properly remove 1.2 sstable support in 2.1 (CASSANDRA-6869)
 + * Lock counter cells, not partitions (CASSANDRA-6880)
 + * Track presence of legacy counter shards in sstables (CASSANDRA-6888)
 + * Ensure safe resource cleanup when replacing sstables (CASSANDRA-6912)
 + * Add failure handler to async callback (CASSANDRA-6747)
 + * Fix AE when closing SSTable without releasing reference (CASSANDRA-7000)
 + * Clean up IndexInfo on keyspace/table drops (CASSANDRA-6924)
 + * Only snapshot relative SSTables when sequential repair (CASSANDRA-7024)
 + * Require nodetool rebuild_index to specify index names (CASSANDRA-7038)
 + * fix cassandra stress errors on reads with native protocol (CASSANDRA-7033)
 + * Use OpOrder to guard sstable references for reads (CASSANDRA-6919)
 + * Preemptive opening of compaction result (CASSANDRA-6916)
 + * Multi-threaded scrub/cleanup/upgradesstables (CASSANDRA-5547)
 + * Optimize cellname comparison (CASSANDRA-6934)
 + * Native protocol v3 (CASSANDRA-6855)
 + * Optimize Cell liveness checks and clean up Cell (CASSANDRA-7119)
 + * Support consistent range movements (CASSANDRA-2434)
 +Merged from 2.0:
 + * Starting threads in OutboundTcpConnectionPool constructor causes race conditions (CASSANDRA-7177)
 + * Allow overriding cassandra-rackdc.properties file (CASSANDRA-7072)
 + * Set JMX RMI port to 7199 (CASSANDRA-7087)
 + * Use LOCAL_QUORUM for data reads at LOCAL_SERIAL (CASSANDRA-6939)
 + * Log a warning for large batches (CASSANDRA-6487)
   * Put nodes in hibernate when join_ring is false (CASSANDRA-6961)
   * Avoid early loading of non-system keyspaces before compaction-leftovers 
     cleanup at startup (CASSANDRA-6913)

http://git-wip-us.apache.org/repos/asf/cassandra/blob/a0d096b0/bin/cqlsh
----------------------------------------------------------------------
diff --cc bin/cqlsh
index 3f543da,ba02e83..ade2f21
--- a/bin/cqlsh
+++ b/bin/cqlsh
@@@ -515,11 -519,8 +515,12 @@@ class Shell(cmd.Cmd)
              self.show_line_nums = True
          self.stdin = stdin
          self.query_out = sys.stdout
 +        self.consistency_level = cassandra.ConsistencyLevel.ONE
 +        #Python driver returns BLOBs as string, but we expect them as buffer()
 +        cassandra.cqltypes.BytesType.deserialize = staticmethod(cassandra.cqltypes.BytesType.validate)
 +        cassandra.cqltypes.CassandraType.support_empty_values = True
          self.empty_lines = 0
+         self.statement_error = False
  
      def set_expanded_cql_version(self, ver):
          ver, vertuple = full_cql_version(ver)


[03/10] git commit: cqlsh should return a non-zero error code if a query fails

Posted by mi...@apache.org.
cqlsh should return a non-zero error code if a query fails

patch by Branden Visser and Mikhail Stepura; reviewed by Mikhail Stepura for CASSANDRA-6344


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

Branch: refs/heads/cassandra-2.1
Commit: 8abe9f6f522146dc478f006a8160b4db1c233169
Parents: d839350
Author: Mikhail Stepura <mi...@apache.org>
Authored: Thu May 8 13:20:35 2014 -0700
Committer: Mikhail Stepura <mi...@apache.org>
Committed: Thu May 8 13:27:41 2014 -0700

----------------------------------------------------------------------
 CHANGES.txt | 1 +
 bin/cqlsh   | 4 ++++
 2 files changed, 5 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/8abe9f6f/CHANGES.txt
----------------------------------------------------------------------
diff --git a/CHANGES.txt b/CHANGES.txt
index 312cf06..7021e7b 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -23,6 +23,7 @@
  * remove duplicate query for local tokens (CASSANDRA-7182)
  * raise streaming phi convict threshold level (CASSANDRA-7063)
  * reduce garbage creation in calculatePendingRanges (CASSANDRA-7191)
+ * exit CQLSH with error status code if script fails (CASSANDRA-6344)
 
 1.2.16
  * Add UNLOGGED, COUNTER options to BATCH documentation (CASSANDRA-6816)

http://git-wip-us.apache.org/repos/asf/cassandra/blob/8abe9f6f/bin/cqlsh
----------------------------------------------------------------------
diff --git a/bin/cqlsh b/bin/cqlsh
index 8e1e0e2..24cb3b8 100755
--- a/bin/cqlsh
+++ b/bin/cqlsh
@@ -548,6 +548,7 @@ class Shell(cmd.Cmd):
             self.show_line_nums = True
         self.stdin = stdin
         self.query_out = sys.stdout
+        self.statement_error = False
 
     def set_expanded_cql_version(self, ver):
         ver, vertuple = full_cql_version(ver)
@@ -2175,6 +2176,7 @@ class Shell(cmd.Cmd):
         self.query_out.flush()
 
     def printerr(self, text, color=RED, newline=True, shownum=None):
+        self.statement_error = True
         if shownum is None:
             shownum = self.show_line_nums
         if shownum:
@@ -2404,6 +2406,8 @@ def main(options, hostname, port):
 
     shell.cmdloop()
     save_history()
+    if options.file and shell.statement_error:
+        sys.exit(2)
 
 if __name__ == '__main__':
     main(*read_options(sys.argv[1:], os.environ))


[02/10] git commit: cqlsh should return a non-zero error code if a query fails

Posted by mi...@apache.org.
cqlsh should return a non-zero error code if a query fails

patch by Branden Visser and Mikhail Stepura; reviewed by Mikhail Stepura for CASSANDRA-6344


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

Branch: refs/heads/cassandra-2.0
Commit: 8abe9f6f522146dc478f006a8160b4db1c233169
Parents: d839350
Author: Mikhail Stepura <mi...@apache.org>
Authored: Thu May 8 13:20:35 2014 -0700
Committer: Mikhail Stepura <mi...@apache.org>
Committed: Thu May 8 13:27:41 2014 -0700

----------------------------------------------------------------------
 CHANGES.txt | 1 +
 bin/cqlsh   | 4 ++++
 2 files changed, 5 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/8abe9f6f/CHANGES.txt
----------------------------------------------------------------------
diff --git a/CHANGES.txt b/CHANGES.txt
index 312cf06..7021e7b 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -23,6 +23,7 @@
  * remove duplicate query for local tokens (CASSANDRA-7182)
  * raise streaming phi convict threshold level (CASSANDRA-7063)
  * reduce garbage creation in calculatePendingRanges (CASSANDRA-7191)
+ * exit CQLSH with error status code if script fails (CASSANDRA-6344)
 
 1.2.16
  * Add UNLOGGED, COUNTER options to BATCH documentation (CASSANDRA-6816)

http://git-wip-us.apache.org/repos/asf/cassandra/blob/8abe9f6f/bin/cqlsh
----------------------------------------------------------------------
diff --git a/bin/cqlsh b/bin/cqlsh
index 8e1e0e2..24cb3b8 100755
--- a/bin/cqlsh
+++ b/bin/cqlsh
@@ -548,6 +548,7 @@ class Shell(cmd.Cmd):
             self.show_line_nums = True
         self.stdin = stdin
         self.query_out = sys.stdout
+        self.statement_error = False
 
     def set_expanded_cql_version(self, ver):
         ver, vertuple = full_cql_version(ver)
@@ -2175,6 +2176,7 @@ class Shell(cmd.Cmd):
         self.query_out.flush()
 
     def printerr(self, text, color=RED, newline=True, shownum=None):
+        self.statement_error = True
         if shownum is None:
             shownum = self.show_line_nums
         if shownum:
@@ -2404,6 +2406,8 @@ def main(options, hostname, port):
 
     shell.cmdloop()
     save_history()
+    if options.file and shell.statement_error:
+        sys.exit(2)
 
 if __name__ == '__main__':
     main(*read_options(sys.argv[1:], os.environ))


[10/10] git commit: Merge branch 'cassandra-2.1' into trunk

Posted by mi...@apache.org.
Merge branch 'cassandra-2.1' into trunk


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

Branch: refs/heads/trunk
Commit: 310d6e4efba63a809fac6237660545aad4009a40
Parents: 28497fd a0d096b
Author: Mikhail Stepura <mi...@apache.org>
Authored: Thu May 8 13:33:00 2014 -0700
Committer: Mikhail Stepura <mi...@apache.org>
Committed: Thu May 8 13:33:00 2014 -0700

----------------------------------------------------------------------
 CHANGES.txt | 2 +-
 bin/cqlsh   | 4 ++++
 2 files changed, 5 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/310d6e4e/CHANGES.txt
----------------------------------------------------------------------


[05/10] git commit: Merge branch 'cassandra-1.2' into cassandra-2.0

Posted by mi...@apache.org.
Merge branch 'cassandra-1.2' into cassandra-2.0

Conflicts:
	bin/cqlsh


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

Branch: refs/heads/cassandra-2.1
Commit: 51f9e9804d6dc52d6c940c54ca43d1a2a8c1a952
Parents: d6f32e4 8abe9f6
Author: Mikhail Stepura <mi...@apache.org>
Authored: Thu May 8 13:31:03 2014 -0700
Committer: Mikhail Stepura <mi...@apache.org>
Committed: Thu May 8 13:31:03 2014 -0700

----------------------------------------------------------------------
 CHANGES.txt | 1 +
 bin/cqlsh   | 4 ++++
 2 files changed, 5 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/51f9e980/CHANGES.txt
----------------------------------------------------------------------
diff --cc CHANGES.txt
index a6cbc18,7021e7b..3f7d68e
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@@ -41,60 -22,10 +41,61 @@@ Merged from 1.2
   * remove duplicate query for local tokens (CASSANDRA-7182)
   * raise streaming phi convict threshold level (CASSANDRA-7063)
   * reduce garbage creation in calculatePendingRanges (CASSANDRA-7191)
+  * exit CQLSH with error status code if script fails (CASSANDRA-6344)
  
 -1.2.16
 +2.0.7
 + * Put nodes in hibernate when join_ring is false (CASSANDRA-6961)
 + * Avoid early loading of non-system keyspaces before compaction-leftovers 
 +   cleanup at startup (CASSANDRA-6913)
 + * Restrict Windows to parallel repairs (CASSANDRA-6907)
 + * (Hadoop) Allow manually specifying start/end tokens in CFIF (CASSANDRA-6436)
 + * Fix NPE in MeteredFlusher (CASSANDRA-6820)
 + * Fix race processing range scan responses (CASSANDRA-6820)
 + * Allow deleting snapshots from dropped keyspaces (CASSANDRA-6821)
 + * Add uuid() function (CASSANDRA-6473)
 + * Omit tombstones from schema digests (CASSANDRA-6862)
 + * Include correct consistencyLevel in LWT timeout (CASSANDRA-6884)
 + * Lower chances for losing new SSTables during nodetool refresh and
 +   ColumnFamilyStore.loadNewSSTables (CASSANDRA-6514)
 + * Add support for DELETE ... IF EXISTS to CQL3 (CASSANDRA-5708)
 + * Update hadoop_cql3_word_count example (CASSANDRA-6793)
 + * Fix handling of RejectedExecution in sync Thrift server (CASSANDRA-6788)
 + * Log more information when exceeding tombstone_warn_threshold (CASSANDRA-6865)
 + * Fix truncate to not abort due to unreachable fat clients (CASSANDRA-6864)
 + * Fix schema concurrency exceptions (CASSANDRA-6841)
 + * Fix leaking validator FH in StreamWriter (CASSANDRA-6832)
 + * Fix saving triggers to schema (CASSANDRA-6789)
 + * Fix trigger mutations when base mutation list is immutable (CASSANDRA-6790)
 + * Fix accounting in FileCacheService to allow re-using RAR (CASSANDRA-6838)
 + * Fix static counter columns (CASSANDRA-6827)
 + * Restore expiring->deleted (cell) compaction optimization (CASSANDRA-6844)
 + * Fix CompactionManager.needsCleanup (CASSANDRA-6845)
 + * Correctly compare BooleanType values other than 0 and 1 (CASSANDRA-6779)
 + * Read message id as string from earlier versions (CASSANDRA-6840)
 + * Properly use the Paxos consistency for (non-protocol) batch (CASSANDRA-6837)
 + * Add paranoid disk failure option (CASSANDRA-6646)
 + * Improve PerRowSecondaryIndex performance (CASSANDRA-6876)
 + * Extend triggers to support CAS updates (CASSANDRA-6882)
 + * Static columns with IF NOT EXISTS don't always work as expected (CASSANDRA-6873)
 + * Fix paging with SELECT DISTINCT (CASSANDRA-6857)
 + * Fix UnsupportedOperationException on CAS timeout (CASSANDRA-6923)
 + * Improve MeteredFlusher handling of MF-unaffected column families
 +   (CASSANDRA-6867)
 + * Add CqlRecordReader using native pagination (CASSANDRA-6311)
 + * Add QueryHandler interface (CASSANDRA-6659)
 + * Track liveRatio per-memtable, not per-CF (CASSANDRA-6945)
 + * Make sure upgradesstables keeps sstable level (CASSANDRA-6958)
 + * Fix LIMIT with static columns (CASSANDRA-6956)
 + * Fix clash with CQL column name in thrift validation (CASSANDRA-6892)
 + * Fix error with super columns in mixed 1.2-2.0 clusters (CASSANDRA-6966)
 + * Fix bad skip of sstables on slice query with composite start/finish (CASSANDRA-6825)
 + * Fix unintended update with conditional statement (CASSANDRA-6893)
 + * Fix map element access in IF (CASSANDRA-6914)
 + * Avoid costly range calculations for range queries on system keyspaces
 +   (CASSANDRA-6906)
 + * Fix SSTable not released if stream session fails (CASSANDRA-6818)
 + * Avoid build failure due to ANTLR timeout (CASSANDRA-6991)
 +Merged from 1.2:
   * Add UNLOGGED, COUNTER options to BATCH documentation (CASSANDRA-6816)
   * add extra SSL cipher suites (CASSANDRA-6613)
   * fix nodetool getsstables for blob PK (CASSANDRA-6803)

http://git-wip-us.apache.org/repos/asf/cassandra/blob/51f9e980/bin/cqlsh
----------------------------------------------------------------------
diff --cc bin/cqlsh
index 020bd2a,24cb3b8..ba02e83
--- a/bin/cqlsh
+++ b/bin/cqlsh
@@@ -519,7 -548,7 +519,8 @@@ class Shell(cmd.Cmd)
              self.show_line_nums = True
          self.stdin = stdin
          self.query_out = sys.stdout
 +        self.empty_lines = 0
+         self.statement_error = False
  
      def set_expanded_cql_version(self, ver):
          ver, vertuple = full_cql_version(ver)


[09/10] git commit: Merge branch 'cassandra-2.0' into cassandra-2.1

Posted by mi...@apache.org.
Merge branch 'cassandra-2.0' into cassandra-2.1

Conflicts:
	CHANGES.txt


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

Branch: refs/heads/trunk
Commit: a0d096b03639ec0824ed500af82550779e293b1e
Parents: 8dab582 51f9e98
Author: Mikhail Stepura <mi...@apache.org>
Authored: Thu May 8 13:32:40 2014 -0700
Committer: Mikhail Stepura <mi...@apache.org>
Committed: Thu May 8 13:32:40 2014 -0700

----------------------------------------------------------------------
 CHANGES.txt | 2 +-
 bin/cqlsh   | 4 ++++
 2 files changed, 5 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/a0d096b0/CHANGES.txt
----------------------------------------------------------------------
diff --cc CHANGES.txt
index 057fd34,3f7d68e..2d9ce55
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@@ -20,74 -26,24 +20,74 @@@ Merged from 1.2
   * Add Cloudstack snitch (CASSANDRA-7147)
   * Update system.peers correctly when relocating tokens (CASSANDRA-7126)
   * Add Google Compute Engine snitch (CASSANDRA-7132)
 - * Fix nodetool display with vnodes (CASSANDRA-7082)
 - * Fix schema concurrency exceptions (CASSANDRA-6841)
 - * Fix BatchlogManager#deleteBatch() use of millisecond timsestamps
 -   (CASSANDRA-6822)
 - * Fix batchlog to account for CF truncation records (CASSANDRA-6999)
 - * Fix CQLSH parsing of functions and BLOB literals (CASSANDRA-7018)
 - * Require nodetool rebuild_index to specify index names (CASSANDRA-7038)
 - * Ensure that batchlog and hint timeouts do not produce hints (CASSANDRA-7058)
 - * Always clean up references in SerializingCache (CASSANDRA-6994)
 - * Don't shut MessagingService down when replacing a node (CASSANDRA-6476)
 - * fix npe when doing -Dcassandra.fd_initial_value_ms (CASSANDRA-6751)
 - * Preserves CQL metadata when updating table from thrift (CASSANDRA-6831)
   * remove duplicate query for local tokens (CASSANDRA-7182)
- 
 - * raise streaming phi convict threshold level (CASSANDRA-7063)
 - * reduce garbage creation in calculatePendingRanges (CASSANDRA-7191)
+  * exit CQLSH with error status code if script fails (CASSANDRA-6344)
  
 -2.0.7
 +2.1.0-beta2
 + * Increase default CL space to 8GB (CASSANDRA-7031)
 + * Add range tombstones to read repair digests (CASSANDRA-6863)
 + * Fix BTree.clear for large updates (CASSANDRA-6943)
 + * Fail write instead of logging a warning when unable to append to CL
 +   (CASSANDRA-6764)
 + * Eliminate possibility of CL segment appearing twice in active list 
 +   (CASSANDRA-6557)
 + * Apply DONTNEED fadvise to commitlog segments (CASSANDRA-6759)
 + * Switch CRC component to Adler and include it for compressed sstables 
 +   (CASSANDRA-4165)
 + * Allow cassandra-stress to set compaction strategy options (CASSANDRA-6451)
 + * Add broadcast_rpc_address option to cassandra.yaml (CASSANDRA-5899)
 + * Auto reload GossipingPropertyFileSnitch config (CASSANDRA-5897)
 + * Fix overflow of memtable_total_space_in_mb (CASSANDRA-6573)
 + * Fix ABTC NPE and apply update function correctly (CASSANDRA-6692)
 + * Allow nodetool to use a file or prompt for password (CASSANDRA-6660)
 + * Fix AIOOBE when concurrently accessing ABSC (CASSANDRA-6742)
 + * Fix assertion error in ALTER TYPE RENAME (CASSANDRA-6705)
 + * Scrub should not always clear out repaired status (CASSANDRA-5351)
 + * Improve handling of range tombstone for wide partitions (CASSANDRA-6446)
 + * Fix ClassCastException for compact table with composites (CASSANDRA-6738)
 + * Fix potentially repairing with wrong nodes (CASSANDRA-6808)
 + * Change caching option syntax (CASSANDRA-6745)
 + * Fix stress to do proper counter reads (CASSANDRA-6835)
 + * Fix help message for stress counter_write (CASSANDRA-6824)
 + * Fix stress smart Thrift client to pick servers correctly (CASSANDRA-6848)
 + * Add logging levels (minimal, normal or verbose) to stress tool (CASSANDRA-6849)
 + * Fix race condition in Batch CLE (CASSANDRA-6860)
 + * Improve cleanup/scrub/upgradesstables failure handling (CASSANDRA-6774)
 + * ByteBuffer write() methods for serializing sstables (CASSANDRA-6781)
 + * Proper compare function for CollectionType (CASSANDRA-6783)
 + * Update native server to Netty 4 (CASSANDRA-6236)
 + * Fix off-by-one error in stress (CASSANDRA-6883)
 + * Make OpOrder AutoCloseable (CASSANDRA-6901)
 + * Remove sync repair JMX interface (CASSANDRA-6900)
 + * Add multiple memory allocation options for memtables (CASSANDRA-6689, 6694)
 + * Remove adjusted op rate from stress output (CASSANDRA-6921)
 + * Add optimized CF.hasColumns() implementations (CASSANDRA-6941)
 + * Serialize batchlog mutations with the version of the target node
 +   (CASSANDRA-6931)
 + * Optimize CounterColumn#reconcile() (CASSANDRA-6953)
 + * Properly remove 1.2 sstable support in 2.1 (CASSANDRA-6869)
 + * Lock counter cells, not partitions (CASSANDRA-6880)
 + * Track presence of legacy counter shards in sstables (CASSANDRA-6888)
 + * Ensure safe resource cleanup when replacing sstables (CASSANDRA-6912)
 + * Add failure handler to async callback (CASSANDRA-6747)
 + * Fix AE when closing SSTable without releasing reference (CASSANDRA-7000)
 + * Clean up IndexInfo on keyspace/table drops (CASSANDRA-6924)
 + * Only snapshot relative SSTables when sequential repair (CASSANDRA-7024)
 + * Require nodetool rebuild_index to specify index names (CASSANDRA-7038)
 + * fix cassandra stress errors on reads with native protocol (CASSANDRA-7033)
 + * Use OpOrder to guard sstable references for reads (CASSANDRA-6919)
 + * Preemptive opening of compaction result (CASSANDRA-6916)
 + * Multi-threaded scrub/cleanup/upgradesstables (CASSANDRA-5547)
 + * Optimize cellname comparison (CASSANDRA-6934)
 + * Native protocol v3 (CASSANDRA-6855)
 + * Optimize Cell liveness checks and clean up Cell (CASSANDRA-7119)
 + * Support consistent range movements (CASSANDRA-2434)
 +Merged from 2.0:
 + * Starting threads in OutboundTcpConnectionPool constructor causes race conditions (CASSANDRA-7177)
 + * Allow overriding cassandra-rackdc.properties file (CASSANDRA-7072)
 + * Set JMX RMI port to 7199 (CASSANDRA-7087)
 + * Use LOCAL_QUORUM for data reads at LOCAL_SERIAL (CASSANDRA-6939)
 + * Log a warning for large batches (CASSANDRA-6487)
   * Put nodes in hibernate when join_ring is false (CASSANDRA-6961)
   * Avoid early loading of non-system keyspaces before compaction-leftovers 
     cleanup at startup (CASSANDRA-6913)

http://git-wip-us.apache.org/repos/asf/cassandra/blob/a0d096b0/bin/cqlsh
----------------------------------------------------------------------
diff --cc bin/cqlsh
index 3f543da,ba02e83..ade2f21
--- a/bin/cqlsh
+++ b/bin/cqlsh
@@@ -515,11 -519,8 +515,12 @@@ class Shell(cmd.Cmd)
              self.show_line_nums = True
          self.stdin = stdin
          self.query_out = sys.stdout
 +        self.consistency_level = cassandra.ConsistencyLevel.ONE
 +        #Python driver returns BLOBs as string, but we expect them as buffer()
 +        cassandra.cqltypes.BytesType.deserialize = staticmethod(cassandra.cqltypes.BytesType.validate)
 +        cassandra.cqltypes.CassandraType.support_empty_values = True
          self.empty_lines = 0
+         self.statement_error = False
  
      def set_expanded_cql_version(self, ver):
          ver, vertuple = full_cql_version(ver)


[07/10] git commit: Merge branch 'cassandra-1.2' into cassandra-2.0

Posted by mi...@apache.org.
Merge branch 'cassandra-1.2' into cassandra-2.0

Conflicts:
	bin/cqlsh


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

Branch: refs/heads/trunk
Commit: 51f9e9804d6dc52d6c940c54ca43d1a2a8c1a952
Parents: d6f32e4 8abe9f6
Author: Mikhail Stepura <mi...@apache.org>
Authored: Thu May 8 13:31:03 2014 -0700
Committer: Mikhail Stepura <mi...@apache.org>
Committed: Thu May 8 13:31:03 2014 -0700

----------------------------------------------------------------------
 CHANGES.txt | 1 +
 bin/cqlsh   | 4 ++++
 2 files changed, 5 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/51f9e980/CHANGES.txt
----------------------------------------------------------------------
diff --cc CHANGES.txt
index a6cbc18,7021e7b..3f7d68e
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@@ -41,60 -22,10 +41,61 @@@ Merged from 1.2
   * remove duplicate query for local tokens (CASSANDRA-7182)
   * raise streaming phi convict threshold level (CASSANDRA-7063)
   * reduce garbage creation in calculatePendingRanges (CASSANDRA-7191)
+  * exit CQLSH with error status code if script fails (CASSANDRA-6344)
  
 -1.2.16
 +2.0.7
 + * Put nodes in hibernate when join_ring is false (CASSANDRA-6961)
 + * Avoid early loading of non-system keyspaces before compaction-leftovers 
 +   cleanup at startup (CASSANDRA-6913)
 + * Restrict Windows to parallel repairs (CASSANDRA-6907)
 + * (Hadoop) Allow manually specifying start/end tokens in CFIF (CASSANDRA-6436)
 + * Fix NPE in MeteredFlusher (CASSANDRA-6820)
 + * Fix race processing range scan responses (CASSANDRA-6820)
 + * Allow deleting snapshots from dropped keyspaces (CASSANDRA-6821)
 + * Add uuid() function (CASSANDRA-6473)
 + * Omit tombstones from schema digests (CASSANDRA-6862)
 + * Include correct consistencyLevel in LWT timeout (CASSANDRA-6884)
 + * Lower chances for losing new SSTables during nodetool refresh and
 +   ColumnFamilyStore.loadNewSSTables (CASSANDRA-6514)
 + * Add support for DELETE ... IF EXISTS to CQL3 (CASSANDRA-5708)
 + * Update hadoop_cql3_word_count example (CASSANDRA-6793)
 + * Fix handling of RejectedExecution in sync Thrift server (CASSANDRA-6788)
 + * Log more information when exceeding tombstone_warn_threshold (CASSANDRA-6865)
 + * Fix truncate to not abort due to unreachable fat clients (CASSANDRA-6864)
 + * Fix schema concurrency exceptions (CASSANDRA-6841)
 + * Fix leaking validator FH in StreamWriter (CASSANDRA-6832)
 + * Fix saving triggers to schema (CASSANDRA-6789)
 + * Fix trigger mutations when base mutation list is immutable (CASSANDRA-6790)
 + * Fix accounting in FileCacheService to allow re-using RAR (CASSANDRA-6838)
 + * Fix static counter columns (CASSANDRA-6827)
 + * Restore expiring->deleted (cell) compaction optimization (CASSANDRA-6844)
 + * Fix CompactionManager.needsCleanup (CASSANDRA-6845)
 + * Correctly compare BooleanType values other than 0 and 1 (CASSANDRA-6779)
 + * Read message id as string from earlier versions (CASSANDRA-6840)
 + * Properly use the Paxos consistency for (non-protocol) batch (CASSANDRA-6837)
 + * Add paranoid disk failure option (CASSANDRA-6646)
 + * Improve PerRowSecondaryIndex performance (CASSANDRA-6876)
 + * Extend triggers to support CAS updates (CASSANDRA-6882)
 + * Static columns with IF NOT EXISTS don't always work as expected (CASSANDRA-6873)
 + * Fix paging with SELECT DISTINCT (CASSANDRA-6857)
 + * Fix UnsupportedOperationException on CAS timeout (CASSANDRA-6923)
 + * Improve MeteredFlusher handling of MF-unaffected column families
 +   (CASSANDRA-6867)
 + * Add CqlRecordReader using native pagination (CASSANDRA-6311)
 + * Add QueryHandler interface (CASSANDRA-6659)
 + * Track liveRatio per-memtable, not per-CF (CASSANDRA-6945)
 + * Make sure upgradesstables keeps sstable level (CASSANDRA-6958)
 + * Fix LIMIT with static columns (CASSANDRA-6956)
 + * Fix clash with CQL column name in thrift validation (CASSANDRA-6892)
 + * Fix error with super columns in mixed 1.2-2.0 clusters (CASSANDRA-6966)
 + * Fix bad skip of sstables on slice query with composite start/finish (CASSANDRA-6825)
 + * Fix unintended update with conditional statement (CASSANDRA-6893)
 + * Fix map element access in IF (CASSANDRA-6914)
 + * Avoid costly range calculations for range queries on system keyspaces
 +   (CASSANDRA-6906)
 + * Fix SSTable not released if stream session fails (CASSANDRA-6818)
 + * Avoid build failure due to ANTLR timeout (CASSANDRA-6991)
 +Merged from 1.2:
   * Add UNLOGGED, COUNTER options to BATCH documentation (CASSANDRA-6816)
   * add extra SSL cipher suites (CASSANDRA-6613)
   * fix nodetool getsstables for blob PK (CASSANDRA-6803)

http://git-wip-us.apache.org/repos/asf/cassandra/blob/51f9e980/bin/cqlsh
----------------------------------------------------------------------
diff --cc bin/cqlsh
index 020bd2a,24cb3b8..ba02e83
--- a/bin/cqlsh
+++ b/bin/cqlsh
@@@ -519,7 -548,7 +519,8 @@@ class Shell(cmd.Cmd)
              self.show_line_nums = True
          self.stdin = stdin
          self.query_out = sys.stdout
 +        self.empty_lines = 0
+         self.statement_error = False
  
      def set_expanded_cql_version(self, ver):
          ver, vertuple = full_cql_version(ver)


[06/10] git commit: Merge branch 'cassandra-1.2' into cassandra-2.0

Posted by mi...@apache.org.
Merge branch 'cassandra-1.2' into cassandra-2.0

Conflicts:
	bin/cqlsh


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

Branch: refs/heads/cassandra-2.0
Commit: 51f9e9804d6dc52d6c940c54ca43d1a2a8c1a952
Parents: d6f32e4 8abe9f6
Author: Mikhail Stepura <mi...@apache.org>
Authored: Thu May 8 13:31:03 2014 -0700
Committer: Mikhail Stepura <mi...@apache.org>
Committed: Thu May 8 13:31:03 2014 -0700

----------------------------------------------------------------------
 CHANGES.txt | 1 +
 bin/cqlsh   | 4 ++++
 2 files changed, 5 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/51f9e980/CHANGES.txt
----------------------------------------------------------------------
diff --cc CHANGES.txt
index a6cbc18,7021e7b..3f7d68e
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@@ -41,60 -22,10 +41,61 @@@ Merged from 1.2
   * remove duplicate query for local tokens (CASSANDRA-7182)
   * raise streaming phi convict threshold level (CASSANDRA-7063)
   * reduce garbage creation in calculatePendingRanges (CASSANDRA-7191)
+  * exit CQLSH with error status code if script fails (CASSANDRA-6344)
  
 -1.2.16
 +2.0.7
 + * Put nodes in hibernate when join_ring is false (CASSANDRA-6961)
 + * Avoid early loading of non-system keyspaces before compaction-leftovers 
 +   cleanup at startup (CASSANDRA-6913)
 + * Restrict Windows to parallel repairs (CASSANDRA-6907)
 + * (Hadoop) Allow manually specifying start/end tokens in CFIF (CASSANDRA-6436)
 + * Fix NPE in MeteredFlusher (CASSANDRA-6820)
 + * Fix race processing range scan responses (CASSANDRA-6820)
 + * Allow deleting snapshots from dropped keyspaces (CASSANDRA-6821)
 + * Add uuid() function (CASSANDRA-6473)
 + * Omit tombstones from schema digests (CASSANDRA-6862)
 + * Include correct consistencyLevel in LWT timeout (CASSANDRA-6884)
 + * Lower chances for losing new SSTables during nodetool refresh and
 +   ColumnFamilyStore.loadNewSSTables (CASSANDRA-6514)
 + * Add support for DELETE ... IF EXISTS to CQL3 (CASSANDRA-5708)
 + * Update hadoop_cql3_word_count example (CASSANDRA-6793)
 + * Fix handling of RejectedExecution in sync Thrift server (CASSANDRA-6788)
 + * Log more information when exceeding tombstone_warn_threshold (CASSANDRA-6865)
 + * Fix truncate to not abort due to unreachable fat clients (CASSANDRA-6864)
 + * Fix schema concurrency exceptions (CASSANDRA-6841)
 + * Fix leaking validator FH in StreamWriter (CASSANDRA-6832)
 + * Fix saving triggers to schema (CASSANDRA-6789)
 + * Fix trigger mutations when base mutation list is immutable (CASSANDRA-6790)
 + * Fix accounting in FileCacheService to allow re-using RAR (CASSANDRA-6838)
 + * Fix static counter columns (CASSANDRA-6827)
 + * Restore expiring->deleted (cell) compaction optimization (CASSANDRA-6844)
 + * Fix CompactionManager.needsCleanup (CASSANDRA-6845)
 + * Correctly compare BooleanType values other than 0 and 1 (CASSANDRA-6779)
 + * Read message id as string from earlier versions (CASSANDRA-6840)
 + * Properly use the Paxos consistency for (non-protocol) batch (CASSANDRA-6837)
 + * Add paranoid disk failure option (CASSANDRA-6646)
 + * Improve PerRowSecondaryIndex performance (CASSANDRA-6876)
 + * Extend triggers to support CAS updates (CASSANDRA-6882)
 + * Static columns with IF NOT EXISTS don't always work as expected (CASSANDRA-6873)
 + * Fix paging with SELECT DISTINCT (CASSANDRA-6857)
 + * Fix UnsupportedOperationException on CAS timeout (CASSANDRA-6923)
 + * Improve MeteredFlusher handling of MF-unaffected column families
 +   (CASSANDRA-6867)
 + * Add CqlRecordReader using native pagination (CASSANDRA-6311)
 + * Add QueryHandler interface (CASSANDRA-6659)
 + * Track liveRatio per-memtable, not per-CF (CASSANDRA-6945)
 + * Make sure upgradesstables keeps sstable level (CASSANDRA-6958)
 + * Fix LIMIT with static columns (CASSANDRA-6956)
 + * Fix clash with CQL column name in thrift validation (CASSANDRA-6892)
 + * Fix error with super columns in mixed 1.2-2.0 clusters (CASSANDRA-6966)
 + * Fix bad skip of sstables on slice query with composite start/finish (CASSANDRA-6825)
 + * Fix unintended update with conditional statement (CASSANDRA-6893)
 + * Fix map element access in IF (CASSANDRA-6914)
 + * Avoid costly range calculations for range queries on system keyspaces
 +   (CASSANDRA-6906)
 + * Fix SSTable not released if stream session fails (CASSANDRA-6818)
 + * Avoid build failure due to ANTLR timeout (CASSANDRA-6991)
 +Merged from 1.2:
   * Add UNLOGGED, COUNTER options to BATCH documentation (CASSANDRA-6816)
   * add extra SSL cipher suites (CASSANDRA-6613)
   * fix nodetool getsstables for blob PK (CASSANDRA-6803)

http://git-wip-us.apache.org/repos/asf/cassandra/blob/51f9e980/bin/cqlsh
----------------------------------------------------------------------
diff --cc bin/cqlsh
index 020bd2a,24cb3b8..ba02e83
--- a/bin/cqlsh
+++ b/bin/cqlsh
@@@ -519,7 -548,7 +519,8 @@@ class Shell(cmd.Cmd)
              self.show_line_nums = True
          self.stdin = stdin
          self.query_out = sys.stdout
 +        self.empty_lines = 0
+         self.statement_error = False
  
      def set_expanded_cql_version(self, ver):
          ver, vertuple = full_cql_version(ver)


[04/10] git commit: cqlsh should return a non-zero error code if a query fails

Posted by mi...@apache.org.
cqlsh should return a non-zero error code if a query fails

patch by Branden Visser and Mikhail Stepura; reviewed by Mikhail Stepura for CASSANDRA-6344


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

Branch: refs/heads/trunk
Commit: 8abe9f6f522146dc478f006a8160b4db1c233169
Parents: d839350
Author: Mikhail Stepura <mi...@apache.org>
Authored: Thu May 8 13:20:35 2014 -0700
Committer: Mikhail Stepura <mi...@apache.org>
Committed: Thu May 8 13:27:41 2014 -0700

----------------------------------------------------------------------
 CHANGES.txt | 1 +
 bin/cqlsh   | 4 ++++
 2 files changed, 5 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/8abe9f6f/CHANGES.txt
----------------------------------------------------------------------
diff --git a/CHANGES.txt b/CHANGES.txt
index 312cf06..7021e7b 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -23,6 +23,7 @@
  * remove duplicate query for local tokens (CASSANDRA-7182)
  * raise streaming phi convict threshold level (CASSANDRA-7063)
  * reduce garbage creation in calculatePendingRanges (CASSANDRA-7191)
+ * exit CQLSH with error status code if script fails (CASSANDRA-6344)
 
 1.2.16
  * Add UNLOGGED, COUNTER options to BATCH documentation (CASSANDRA-6816)

http://git-wip-us.apache.org/repos/asf/cassandra/blob/8abe9f6f/bin/cqlsh
----------------------------------------------------------------------
diff --git a/bin/cqlsh b/bin/cqlsh
index 8e1e0e2..24cb3b8 100755
--- a/bin/cqlsh
+++ b/bin/cqlsh
@@ -548,6 +548,7 @@ class Shell(cmd.Cmd):
             self.show_line_nums = True
         self.stdin = stdin
         self.query_out = sys.stdout
+        self.statement_error = False
 
     def set_expanded_cql_version(self, ver):
         ver, vertuple = full_cql_version(ver)
@@ -2175,6 +2176,7 @@ class Shell(cmd.Cmd):
         self.query_out.flush()
 
     def printerr(self, text, color=RED, newline=True, shownum=None):
+        self.statement_error = True
         if shownum is None:
             shownum = self.show_line_nums
         if shownum:
@@ -2404,6 +2406,8 @@ def main(options, hostname, port):
 
     shell.cmdloop()
     save_history()
+    if options.file and shell.statement_error:
+        sys.exit(2)
 
 if __name__ == '__main__':
     main(*read_options(sys.argv[1:], os.environ))