Skip to content

Commit

Permalink
Fix Beeline with -i run sql faild
Browse files Browse the repository at this point in the history
  • Loading branch information
thomasg19930417 committed Mar 14, 2023
1 parent 042987a commit b0c4722
Showing 1 changed file with 7 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -523,15 +523,19 @@ public String handleMultiLineCmd(String line) throws IOException {
"Console reader not initialized. This could happen when there "
+ "is a multi-line command using -e option and which requires further reading from console");
}

if(beeLine.getOpts().getInitFiles() != null) {
beeLine.getConsoleReader().shutdown();
beeLine.setConsoleReader(new ConsoleReader(beeLine.getInputStream(), beeLine.getErrorStream()));
}

if (beeLine.getOpts().isSilent() && beeLine.getOpts().getScriptFile() != null) {
extra = beeLine.getConsoleReader().readLine(null, mask);
} else {
extra = beeLine.getConsoleReader().readLine(prompt.toString());
}

if(beeLine.getOpts().getInitFiles() != null) {
beeLine.setConsoleReader(new ConsoleReader(beeLine.getInputStream(), beeLine.getErrorStream()));
}

if (extra == null) { // it happens when using -f and the line of cmds does not end with ;
break;
}
Expand Down

0 comments on commit b0c4722

Please sign in to comment.