You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cassandra.apache.org by "Jose Martinez Poblete (JIRA)" <ji...@apache.org> on 2014/04/30 18:56:19 UTC

[jira] [Commented] (CASSANDRA-7117) cqlsh should return a non-zero error code if a query fails

    [ https://issues.apache.org/jira/browse/CASSANDRA-7117?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13985737#comment-13985737 ] 

Jose Martinez Poblete commented on CASSANDRA-7117:
--------------------------------------------------

This is an illustration of the described behavior

{noformat}
ubuntu@ip-10-182-163-57:~$ echo "select count(*) from word limit 1000000;" > /tmp/bad.sql
ubuntu@ip-10-182-163-57:~$ cqlsh -k Keyspace1 -f /tmp/bad.sql
/tmp/bad.sql:2:Bad Request: unconfigured columnfamily word
ubuntu@ip-10-182-163-57:~$ echo $?
0
ubuntu@ip-10-182-163-57:~$ echo "select count(*) from words limit 1000000;" > /tmp/good.sql
ubuntu@ip-10-182-163-57:~$ cqlsh -k Keyspace1 -f /tmp/good.sql

 count
--------
 650722

(1 rows)

ubuntu@ip-10-182-163-57:~$ echo $?
0
ubuntu@ip-10-182-163-57:~$ 
{noformat}

> cqlsh should return a non-zero error code if a query fails
> ----------------------------------------------------------
>
>                 Key: CASSANDRA-7117
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-7117
>             Project: Cassandra
>          Issue Type: Improvement
>            Reporter: J.B. Langston
>            Priority: Minor
>
> cqlsh should return a non-zero error code when a query in a file or piped stdin fails.  This is so that shell scripts to determine if a cql script failed or succeeded.



--
This message was sent by Atlassian JIRA
(v6.2#6252)