Add test for _table index in storage Merge. [#CLICKHOUSE-2758]

This commit is contained in:
Vitaliy Lyudvichenko 2017-02-03 15:03:01 +03:00 committed by alexey-milovidov
parent 98af273cbc
commit d6385af19b
2 changed files with 20 additions and 0 deletions

View File

@ -0,0 +1,5 @@
merge_item_10 10
merge_item_12 12
merge_item_14 14
merge_item_16 16
merge_item_18 18

View File

@ -0,0 +1,15 @@
#!/bin/bash
set -e
for i in `seq -w 0 2 20`; do
clickhouse-client -q "DROP TABLE IF EXISTS test.merge_item_$i"
clickhouse-client -q "CREATE TABLE test.merge_item_$i (d Int8) ENGINE = Memory"
clickhouse-client -q "INSERT INTO test.merge_item_$i VALUES ($i)"
done
clickhouse-client -q "DROP TABLE IF EXISTS test.merge_storage"
clickhouse-client -q "CREATE TABLE test.merge_storage (d Int8) ENGINE = Merge('test', '^merge_item_')"
clickhouse-client --max_threads=1 -q "SELECT _table, d FROM test.merge_storage WHERE _table LIKE 'merge_item_1%' ORDER BY _table"
clickhouse-client -q "DROP TABLE IF EXISTS test.merge_storage"
for i in `seq -w 0 2 20`; do clickhouse-client -q "DROP TABLE IF EXISTS test.merge_item_$i"; done