mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-21 15:12:02 +00:00
Merge pull request #17565 from ClickHouse/fix-multiline-queries-with-comments
Fix multiline queries with comments in interactive mode
This commit is contained in:
commit
46e685e1b8
@ -127,7 +127,7 @@ String LineReader::readLine(const String & first_prompt, const String & second_p
|
||||
}
|
||||
#endif
|
||||
|
||||
line += (line.empty() ? "" : " ") + input;
|
||||
line += (line.empty() ? "" : "\n") + input;
|
||||
|
||||
if (!need_next_line)
|
||||
break;
|
||||
|
25
tests/queries/0_stateless/01599_multiline_input_and_singleline_comments.sh
Executable file
25
tests/queries/0_stateless/01599_multiline_input_and_singleline_comments.sh
Executable file
@ -0,0 +1,25 @@
|
||||
#!/usr/bin/expect -f
|
||||
|
||||
log_user 0
|
||||
set timeout 5
|
||||
match_max 100000
|
||||
|
||||
if ![info exists env(CLICKHOUSE_PORT_TCP)] {set env(CLICKHOUSE_PORT_TCP) 9000}
|
||||
|
||||
spawn clickhouse-client --multiline --port "$env(CLICKHOUSE_PORT_TCP)"
|
||||
expect ":) "
|
||||
|
||||
# Make a query
|
||||
send -- "SELECT 1\r"
|
||||
expect ":-] "
|
||||
send -- "-- xxx\r"
|
||||
expect ":-] "
|
||||
send -- ", 2\r"
|
||||
expect ":-] "
|
||||
send -- ";\r"
|
||||
|
||||
expect "│ 1 │ 2 │"
|
||||
expect ":) "
|
||||
|
||||
send -- "\4"
|
||||
expect eof
|
Loading…
Reference in New Issue
Block a user