From b1c48ebc08ac8d2434fa45b2a50a7aa911693b45 Mon Sep 17 00:00:00 2001 From: Alexey Milovidov Date: Sun, 8 Mar 2015 00:03:54 +0300 Subject: [PATCH] dbms: added test [#METR-15352]. --- ...memory_tracker_and_exception_safety.reference | 1 + .../00133_memory_tracker_and_exception_safety.sh | 16 ++++++++++++++++ 2 files changed, 17 insertions(+) create mode 100644 dbms/tests/queries/0_stateless/00133_memory_tracker_and_exception_safety.reference create mode 100755 dbms/tests/queries/0_stateless/00133_memory_tracker_and_exception_safety.sh diff --git a/dbms/tests/queries/0_stateless/00133_memory_tracker_and_exception_safety.reference b/dbms/tests/queries/0_stateless/00133_memory_tracker_and_exception_safety.reference new file mode 100644 index 00000000000..e76299ca0ed --- /dev/null +++ b/dbms/tests/queries/0_stateless/00133_memory_tracker_and_exception_safety.reference @@ -0,0 +1 @@ +0 4 diff --git a/dbms/tests/queries/0_stateless/00133_memory_tracker_and_exception_safety.sh b/dbms/tests/queries/0_stateless/00133_memory_tracker_and_exception_safety.sh new file mode 100755 index 00000000000..37f3711249b --- /dev/null +++ b/dbms/tests/queries/0_stateless/00133_memory_tracker_and_exception_safety.sh @@ -0,0 +1,16 @@ +#!/bin/bash + +clickhouse-client -n --query=" + DROP TABLE IF EXISTS test.numbers_100k; + CREATE VIEW test.numbers_100k AS SELECT * FROM system.numbers LIMIT 100000; +"; + +for i in $(seq 1000000 20000 10000000 && seq 10100000 100000 20000000); do + clickhouse-client --max_memory_usage=$i --query=" + SELECT intDiv(number, 5) AS k, max(toString(number)) FROM remote('127.0.0.{1,2}', test.numbers_100k) GROUP BY k ORDER BY k LIMIT 1; + " 2> /dev/null; + CODE=$?; + [ "$CODE" -ne "241" ] && [ "$CODE" -ne "0" ] && echo "Fail" && break; +done | uniq + +clickhouse-client --query="DROP TABLE test.numbers_100k;";