ClickHouse/tests/queries/0_stateless/01180_client_syntax_errors.expect

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

43 lines
1.4 KiB
Plaintext
Raw Normal View History

2021-01-31 23:10:41 +00:00
#!/usr/bin/expect -f
set basedir [file dirname $argv0]
set basename [file tail $argv0]
if {[info exists env(CLICKHOUSE_TMP)]} {
set CLICKHOUSE_TMP $env(CLICKHOUSE_TMP)
} else {
set CLICKHOUSE_TMP "."
}
exp_internal -f $CLICKHOUSE_TMP/$basename.debuglog 0
set history_file $CLICKHOUSE_TMP/$basename.history
2021-01-31 23:10:41 +00:00
log_user 0
set timeout 60
2021-01-31 23:10:41 +00:00
match_max 100000
expect_after {
# Do not ignore eof from expect
-i $any_spawn_id eof { exp_continue }
# A default timeout action is to do nothing, change it to fail
-i $any_spawn_id timeout { exit 1 }
2021-01-31 23:10:41 +00:00
}
2024-09-17 06:06:39 +00:00
spawn bash -c "source $basedir/../shell_config.sh ; \$CLICKHOUSE_CLIENT_BINARY \$CLICKHOUSE_CLIENT_OPT --disable_suggestion --enable-progress-table-toggle=0 --history_file=$history_file"
2021-01-31 23:10:41 +00:00
expect ":) "
# Make a query with syntax error
send -- "select \r"
expect "Syntax error: failed at position 7 (end of query):"
expect "Expected one of: "
# Make another query with syntax error
send -- "CREATE TABLE t4 UUID '57f27aa5-141c-47c5-888a-9563681717f5' AS t1 (`rowNumberInAllBlocks()` UInt64, `toLowCardinality(arrayJoin(\['exchange', 'tables'\]))` LowCardinality(String)) ENGINE = MergeTree \r"
expect "Syntax error: failed at position 93 ('UInt64'):*"
# Make a query with unmatched parentheses
send -- "select (1, 2\r"
expect "Syntax error: failed at position 8 ('('):"
expect "Unmatched parentheses: ("
expect ":) "
2021-01-31 23:10:41 +00:00
send -- "\4"
expect eof