ISSUES-863 fix test failure #2015 #2840

This commit is contained in:
zhang2014 2018-08-15 12:13:22 +08:00
parent 5410f73ba7
commit 1549baa4e9
5 changed files with 33 additions and 24 deletions

View File

@ -268,7 +268,7 @@ struct Settings
M(SettingUInt64, enable_conditional_computation, 0, "Enable conditional computations") \
\
M(SettingDateTimeInputFormat, date_time_input_format, FormatSettings::DateTimeInputFormat::Basic, "Method to read DateTime from text input formats. Possible values: 'basic' and 'best_effort'.") \
M(SettingBool, enable_optimize_predicate_expression, 0, "") \
M(SettingBool, enable_optimize_predicate_expression, 0, "If it is set to true, optimize predicates to subqueries.") \
\
M(SettingUInt64, low_cardinality_max_dictionary_size, 8192, "Maximum size (in rows) of shared global dictionary for LowCardinality type.") \
M(SettingBool, low_cardinality_use_single_dictionary_for_part, false, "LowCardinality type serialization setting. If is true, than will use additional keys when global dictionary overflows. Otherwise, will create several shared dictionaries.") \

View File

@ -10,8 +10,8 @@
2000-01-01 1
2000-01-01 1 test string 1 1
2000-01-01 1 test string 1 1
1 test string 1
1 test string 1
1 test string 1 1 test string 1
1 test string 1 1 test string 1
test string 1 1 1
test string 1 1 1
1

View File

@ -0,0 +1,28 @@
#!/usr/bin/env bash
CURDIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)
. $CURDIR/../shell_config.sh
${CLICKHOUSE_CLIENT} --query "DROP TABLE IF EXISTS test.test;"
${CLICKHOUSE_CLIENT} --query "CREATE TABLE test.test(val Int64) engine = Memory;"
${CLICKHOUSE_CLIENT} --query "INSERT INTO test.test VALUES (1);"
${CLICKHOUSE_CLIENT} --query "INSERT INTO test.test VALUES (2);"
${CLICKHOUSE_CLIENT} --query "INSERT INTO test.test VALUES (3);"
${CLICKHOUSE_CLIENT} --query "INSERT INTO test.test VALUES (4);"
${CLICKHOUSE_CLIENT} --query "INSERT INTO test.test VALUES (5);"
${CLICKHOUSE_CLIENT} --query "INSERT INTO test.test VALUES (6);"
${CLICKHOUSE_CLIENT} --query "INSERT INTO test.test VALUES (7);"
${CLICKHOUSE_CLIENT} --query "INSERT INTO test.test VALUES (8);"
${CLICKHOUSE_CLIENT} --query "INSERT INTO test.test VALUES (9);"
${CLICKHOUSE_CLIENT} --query "SELECT TOP 2 * FROM test.test ORDER BY val;"
${CLICKHOUSE_CLIENT} --query "SELECT TOP (2) * FROM test.test ORDER BY val;"
${CLICKHOUSE_CLIENT} --query "SELECT * FROM test.test ORDER BY val LIMIT 2 OFFSET 2;"
echo `${CLICKHOUSE_CLIENT} --query "SELECT TOP 2 * FROM test.test ORDER BY val LIMIT 2;" 2>&1 | grep -c "Code: 406"`
echo `${CLICKHOUSE_CLIENT} --query "SELECT * FROM test.test ORDER BY val LIMIT 2,3 OFFSET 2;" 2>&1 | grep -c "Code: 62"`
${CLICKHOUSE_CLIENT} --query "DROP TABLE test.test;"

View File

@ -1,21 +0,0 @@
DROP TABLE IF EXISTS test.test;
CREATE TABLE test.test(val Int64) engine = Memory;
INSERT INTO test.test VALUES (1);
INSERT INTO test.test VALUES (2);
INSERT INTO test.test VALUES (3);
INSERT INTO test.test VALUES (4);
INSERT INTO test.test VALUES (5);
INSERT INTO test.test VALUES (6);
INSERT INTO test.test VALUES (7);
INSERT INTO test.test VALUES (8);
INSERT INTO test.test VALUES (9);
SELECT TOP 2 * FROM test.test ORDER BY val;
SELECT TOP (2) * FROM test.test ORDER BY val;
SELECT * FROM test.test ORDER BY val LIMIT 2 OFFSET 2;
SELECT TOP 2 * FROM test.test ORDER BY val LIMIT 2; -- { clientError 406 }
SELECT * FROM test.test ORDER BY val LIMIT 2,3 OFFSET 2; -- { clientError 62 }
DROP TABLE test.test;