Merge branch 'master' of github.com:yandex/ClickHouse

This commit is contained in:
Alexey Milovidov 2018-06-19 00:14:42 +03:00
commit ff3f4aea52
6 changed files with 24 additions and 11 deletions

View File

@ -26,7 +26,7 @@ if (ENABLE_EMBEDDED_COMPILER)
if (LLVM_FOUND)
# Remove dynamically-linked zlib and libedit from LLVM's dependencies:
set_target_properties(LLVMSupport PROPERTIES INTERFACE_LINK_LIBRARIES "-lpthread;LLVMDemangle")
set_target_properties(LLVMSupport PROPERTIES INTERFACE_LINK_LIBRARIES "-lpthread;LLVMDemangle;${ZLIB_LIBRARIES}")
set_target_properties(LLVMLineEditor PROPERTIES INTERFACE_LINK_LIBRARIES "LLVMSupport")
option(LLVM_HAS_RTTI "Enable if LLVM was build with RTTI enabled" ON)
@ -65,6 +65,6 @@ function(llvm_libs_all REQUIRED_LLVM_LIBRARIES)
if (TERMCAP_LIBRARY)
list (APPEND result ${TERMCAP_LIBRARY})
endif ()
list (APPEND result ${CMAKE_DL_LIBS})
list (APPEND result ${CMAKE_DL_LIBS} ${ZLIB_LIBRARIES})
set (${REQUIRED_LLVM_LIBRARIES} ${result} PARENT_SCOPE)
endfunction()

View File

@ -77,6 +77,8 @@ def main(args):
os.environ.setdefault("CLICKHOUSE_BINARY", args.binary)
os.environ.setdefault("CLICKHOUSE_CLIENT", args.client)
os.environ.setdefault("CLICKHOUSE_CONFIG", args.configserver)
if args.configclient:
os.environ.setdefault("CLICKHOUSE_CONFIG_CLIENT", args.configclient)
os.environ.setdefault("CLICKHOUSE_TMP", tmp_dir)
# TODO ! use clickhouse-extract-from-config here:
@ -101,6 +103,9 @@ def main(args):
skipped_total = 0
failures_total = 0
clickhouse_proc_create = Popen(shlex.split(args.client), stdin=PIPE, stdout=PIPE, stderr=PIPE)
clickhouse_proc_create.communicate("CREATE DATABASE IF NOT EXISTS test")
for suite in sorted(os.listdir(base_dir)):
if SERVER_DIED:
break

View File

@ -1,6 +1,6 @@
#!/usr/bin/env bash
#set -x
# set -x
CURDIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)
. $CURDIR/../shell_config.sh
@ -9,7 +9,7 @@ CURDIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)
if [ -n $CLICKHOUSE_CONFIG_CLIENT ]; then
USE_CONFIG="--config $CLICKHOUSE_CONFIG_CLIENT"
USE_CONFIG="--config-file $CLICKHOUSE_CONFIG_CLIENT"
fi
@ -19,13 +19,13 @@ if [ -z $tcp_port_secure ]; then
cat $CURDIR/00505_secure.reference
else
CLICKHOUSE_CLIENT_BINARY=${CLICKHOUSE_CLIENT_BINARY:="${CLICKHOUSE_BINARY}-client"}
if [[ $CLICKHOUSE_CLIENT != *"--port"* ]]; then
CLICKHOUSE_CLIENT_SECURE=${CLICKHOUSE_CLIENT_SECURE:="$CLICKHOUSE_CLIENT $USE_CONFIG --secure --port=$CLICKHOUSE_PORT_TCP_SECURE"}
CLICKHOUSE_CLIENT_SECURE=${CLICKHOUSE_CLIENT_SECURE:="$CLICKHOUSE_CLIENT_BINARY $USE_CONFIG --secure --port=$CLICKHOUSE_PORT_TCP_SECURE"}
# Auto port detect. Cant test with re-definedvia command line ports
$CLICKHOUSE_CLIENT $USE_CONFIG --secure -q "SELECT 1";
$CLICKHOUSE_CLIENT_BINARY $USE_CONFIG --secure -q "SELECT 1";
else
CLICKHOUSE_CLIENT_BINARY=${CLICKHOUSE_CLIENT_BINARY:="${CLICKHOUSE_BINARY}-client"}
CLICKHOUSE_CLIENT_SECURE=${CLICKHOUSE_CLIENT_SECURE:="$CLICKHOUSE_CLIENT_BINARY $USE_CONFIG --secure --port=$CLICKHOUSE_PORT_TCP_SECURE"}
echo 1
fi

View File

@ -10,10 +10,14 @@ url="${CLICKHOUSE_PORT_HTTP_PROTO}://$address:$port/"
# Port is arbitary
# nc does not support -w option with -l and will wait forever for first packet
nc -l -p 61845 -q 0 > /dev/null &
${CLICKHOUSE_CURL} -sS $url --data-binary "SELECT * FROM remote('localhost:61845', system.one, 'user', 'password')" > /dev/null 2>&1
# Send packet to close listening nc (if clickhouse fails to send).
( echo -e "Finish him\n" | nc localhost 61845 ) 2>/dev/null || true
wait
nc -l -p 61846 -q 0 > /dev/null &
@ -21,4 +25,6 @@ nc -l -p 61846 -q 0 > /dev/null &
${CLICKHOUSE_CURL} -sS $url --data-binary "SELECT * FROM remote('localhost:61846', system.one, 'user', 'passw
ord')" 2>&1 | grep -o 'must not contain ASCII control characters'
( echo -e "Finish him\n" | nc localhost 61846 ) 2>/dev/null || true
wait

View File

@ -1 +0,0 @@
CREATE DATABASE IF NOT EXISTS test;

View File

@ -44,16 +44,19 @@ if [ "${TEST_CONNECT}" ]; then
[ "${TEST_PORT_RANDOM}" ] && echo "<yandex><http_port>${CLICKHOUSE_PORT_HTTP}</http_port><tcp_port>${CLICKHOUSE_PORT_TCP}</tcp_port><interserver_http_port>${CLICKHOUSE_PORT_INTERSERVER}</interserver_http_port></yandex>" > /etc/clickhouse-server/config.d/port.xml
if [ "${TEST_SSL}" ]; then
[ "${TEST_PORT_RANDOM}" ] && echo "<yandex><https_port>${CLICKHOUSE_PORT_HTTPS}</https_port><tcp_port_secure>${CLICKHOUSE_PORT_TCP_SECURE}</tcp_port_secure></yandex>" > /etc/clickhouse-server/config.d/ssl.xml
echo "<yandex><openSSL><client><verificationMode>none</verificationMode><invalidCertificateHandler><name>AcceptCertificateHandler</name></invalidCertificateHandler></client></openSSL></yandex>" > /etc/clickhouse-client/config.d/ssl.xml
echo "<yandex><https_port>${CLICKHOUSE_PORT_HTTPS}</https_port><tcp_port_secure>${CLICKHOUSE_PORT_TCP_SECURE}</tcp_port_secure></yandex>" > /etc/clickhouse-server/config.d/ssl.xml
echo "<yandex><tcp_port_secure>${CLICKHOUSE_PORT_TCP_SECURE}</tcp_port_secure><tcp_port>${CLICKHOUSE_PORT_TCP}</tcp_port><openSSL><client><verificationMode>none</verificationMode><invalidCertificateHandler><name>AcceptCertificateHandler</name></invalidCertificateHandler></client></openSSL></yandex>" > /etc/clickhouse-client/config.xml
openssl dhparam -out /etc/clickhouse-server/dhparam.pem 256
openssl req -subj "/CN=localhost" -new -newkey rsa:2048 -days 365 -nodes -x509 -keyout /etc/clickhouse-server/server.key -out /etc/clickhouse-server/server.crt
chmod a+r /etc/clickhouse-server/*
chmod a+r /etc/clickhouse-server/* /etc/clickhouse-client/*
CLIENT_ADD+="--secure --port $CLICKHOUSE_PORT_TCP_SECURE"
else
CLIENT_ADD+="--port $CLICKHOUSE_PORT_TCP"
fi
# For debug
# tail -n +1 -- /etc/clickhouse-server/*.xml /etc/clickhouse-server/config.d/*.xml || true
function finish {
service clickhouse-server stop
tail -n 100 /var/log/clickhouse-server/*.log /var/log/clickhouse-server/stderr || true