mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-10-23 00:40:51 +00:00
280025d5b4
Ctrl-C is pressed during WATCH query execution instead of going to the client prompt.
24 lines
578 B
Python
24 lines
578 B
Python
import os
|
|
import sys
|
|
|
|
CURDIR = os.path.dirname(os.path.realpath(__file__))
|
|
|
|
sys.path.insert(0, os.path.join(CURDIR))
|
|
|
|
import uexpect
|
|
|
|
prompt = ':\) '
|
|
end_of_block = r'.*\r\n.*\r\n'
|
|
|
|
def client(command=None, name='', log=None):
|
|
client = uexpect.spawn(['/bin/bash','--noediting'])
|
|
if command is None:
|
|
command = os.environ.get('CLICKHOUSE_BINARY', 'clickhouse') + '-client'
|
|
client.command = command
|
|
client.eol('\r')
|
|
client.logger(log, prefix=name)
|
|
client.timeout(20)
|
|
client.expect('[#\$] ', timeout=2)
|
|
client.send(command)
|
|
return client
|