Uploaded image for project: 'Cassandra'
  1. Cassandra
  2. CASSANDRA-15787

CQLSH doesn't exit with proper code with multiple SOURCE directives.

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Triage Needed
    • Normal
    • Resolution: Unresolved
    • None
    • Tool/cqlsh
    • 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

      Attachments

        Activity

          People

            kadenlnelson Kaden Luke Nelson
            kadenlnelson Kaden Luke Nelson
            Kaden Luke Nelson
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated: