Details
-
Bug
-
Status: Triage Needed
-
Normal
-
Resolution: Unresolved
-
None
-
None
-
All
-
None
Description
When I have the following files;
# master.sql CREATE TABLE asdf ( id text, primary key (id));
# a.sql
SOURCE './master.sql';
CREATE TABLE asdf ( id text, primary key (id));
# b.sql
SOURCE './a.sql';
and execute
cqlsh --keyspace example --file ./b.sql
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