2016-12-21 20:43:35 +00:00
#!/usr/bin/env bash
2021-09-12 12:35:27 +00:00
# Tags: race
2016-12-21 20:43:35 +00:00
2017-12-15 19:34:19 +00:00
CURDIR = $( cd " $( dirname " ${ BASH_SOURCE [0] } " ) " && pwd )
2020-12-28 11:46:53 +00:00
# shellcheck source=../shell_config.sh
2020-08-01 00:51:12 +00:00
. " $CURDIR " /../shell_config.sh
2017-12-15 19:34:19 +00:00
2016-12-21 20:43:35 +00:00
set -o errexit
set -o pipefail
2014-11-30 12:01:46 +00:00
echo "
2019-04-16 14:13:13 +00:00
DROP TABLE IF EXISTS two_blocks;
2022-06-23 19:19:07 +00:00
set allow_deprecated_syntax_for_merge_tree = 1;
2019-04-16 14:13:13 +00:00
CREATE TABLE two_blocks ( d Date) ENGINE = MergeTree( d, d, 1) ;
INSERT INTO two_blocks VALUES ( '2000-01-01' ) ;
INSERT INTO two_blocks VALUES ( '2000-01-02' ) ;
2017-12-15 19:34:19 +00:00
" | $CLICKHOUSE_CLIENT -n
2014-11-30 12:01:46 +00:00
2020-08-01 00:40:56 +00:00
for _ in { 1..10} ; do seq 1 100 | sed 's/.*/SELECT count() FROM (SELECT * FROM two_blocks);/' | $CLICKHOUSE_CLIENT -n | grep -vE '^2$' && echo 'Fail!' && break; echo -n '.' ; done ; echo
2014-11-30 12:01:46 +00:00
2019-04-16 14:13:13 +00:00
echo "DROP TABLE two_blocks;" | $CLICKHOUSE_CLIENT -n