mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-09-20 08:40:50 +00:00
Add test to prevent error in future
This commit is contained in:
parent
662ea9d024
commit
84565cf464
@ -0,0 +1 @@
|
||||
Ok
|
31
tests/queries/0_stateless/02187_test_final_and_limit_modifier.sh
Executable file
31
tests/queries/0_stateless/02187_test_final_and_limit_modifier.sh
Executable file
@ -0,0 +1,31 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
CURDIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)
|
||||
# shellcheck source=../shell_config.sh
|
||||
. "$CURDIR"/../shell_config.sh
|
||||
|
||||
# Create table and fill it
|
||||
$CLICKHOUSE_CLIENT -nm <<EOF
|
||||
DROP TABLE IF EXISTS test_02187;
|
||||
CREATE TABLE test_02187 (
|
||||
id String,
|
||||
num Int32,
|
||||
finalDate DateTime DEFAULT now()
|
||||
)
|
||||
ENGINE = ReplacingMergeTree(finalDate)
|
||||
ORDER BY id;
|
||||
INSERT INTO TABLE test_02187(id, num) VALUES ('1', 0);
|
||||
INSERT INTO TABLE test_02187(id, num) VALUES ('1', 1);
|
||||
EOF
|
||||
|
||||
# Get answers for queries
|
||||
answer_first=`$CLICKHOUSE_CLIENT -q "SELECT * FROM test_02187 FINAL"`
|
||||
answer_second=`$CLICKHOUSE_CLIENT -q "SELECT * FROM test_02187 FINAL LIMIT 1"`
|
||||
|
||||
# Check that they are equal and not empty.
|
||||
if [[ "$answer_first" = "$answer_second" && -n "$answer_first" ]]
|
||||
then
|
||||
echo "Ok"
|
||||
else
|
||||
echo "Fail"
|
||||
fi
|
Loading…
Reference in New Issue
Block a user