You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cassandra.apache.org by "Kaden Luke Nelson (Jira)" <ji...@apache.org> on 2020/05/04 20:47:00 UTC

[jira] [Updated] (CASSANDRA-15787) CQLSH doesn't exit with proper code with multiple SOURCE directives.

     [ https://issues.apache.org/jira/browse/CASSANDRA-15787?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Kaden Luke Nelson updated CASSANDRA-15787:
------------------------------------------
    Description: 
When I have the following files;

 
{code:java}
# master.sql

CREATE TABLE asdf (  id text,  primary key (id));{code}
{code:java}
# a.sql

SOURCE './master.sql';

CREATE TABLE asdf (  id text,  primary key (id));{code}
{code:java}
# b.sql

SOURCE './a.sql';{code}
 
 and execute
{code:java}
cqlsh --keyspace example --file ./b.sql{code}
 

I don't get returned the proper status code. This happens because when multiple SOURCE commands are chained together like in the example above, the error doesn't get passed through to the final 'shell'. 

 

Subshell that needs to pass the statement error value to the parent shell: https://github.com/apache/cassandra/blob/trunk/bin/cqlsh.py#L1776
 final statement error check which returns the parent shell statement error: [https://github.com/apache/cassandra/blob/trunk/bin/cqlsh.py#L2474]

  was:
When I have the following files;

 
{code:java}
# master.sql

CREATE TABLE asdf (  id text,  primary key (id));{code}
{code:java}
# a.sql

SOURCE './master.sql';

CREATE TABLE asdf (  id text,  primary key (id));{code}
{code:java}
# b.sql

SOURCE './a.sql';{code}
 
and execute


{code:java}
cqlsh --keyspace example --file ./b.sql{code}
 

I don't get returned the proper status code. This happens because when multiple SOURCE commands are chained together like in the example above, the error doesn't get passed through to the final 'shell'. 

 

Subshell that needs to pass the statement error value to the parent shell: [https://github.com/apache/cassandra/blob/trunk/bin/cqlsh.py#L1776
]
final statement error check which returns the parent shell statement error: [https://github.com/apache/cassandra/blob/trunk/bin/cqlsh.py#L2474]


> CQLSH doesn't exit with proper code with multiple SOURCE directives.
> --------------------------------------------------------------------
>
>                 Key: CASSANDRA-15787
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-15787
>             Project: Cassandra
>          Issue Type: Bug
>          Components: Tool/cqlsh
>            Reporter: Kaden Luke Nelson
>            Assignee: Kaden Luke Nelson
>            Priority: Normal
>
> When I have the following files;
>  
> {code:java}
> # master.sql
> CREATE TABLE asdf (  id text,  primary key (id));{code}
> {code:java}
> # a.sql
> SOURCE './master.sql';
> CREATE TABLE asdf (  id text,  primary key (id));{code}
> {code:java}
> # b.sql
> SOURCE './a.sql';{code}
>  
>  and execute
> {code:java}
> cqlsh --keyspace example --file ./b.sql{code}
>  
> I don't get returned the proper status code. This happens because when multiple SOURCE commands are chained together like in the example above, the error doesn't get passed through to the final 'shell'. 
>  
> Subshell that needs to pass the statement error value to the parent shell: https://github.com/apache/cassandra/blob/trunk/bin/cqlsh.py#L1776
>  final statement error check which returns the parent shell statement error: [https://github.com/apache/cassandra/blob/trunk/bin/cqlsh.py#L2474]



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

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