mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-29 19:12:03 +00:00
Merge branch 'master' into storage-dictionary
This commit is contained in:
commit
b872751c5e
@ -240,6 +240,8 @@ void ColumnNullable::getPermutation(bool reverse, size_t limit, int null_directi
|
||||
|
||||
if (!limit)
|
||||
limit = end_idx;
|
||||
else
|
||||
limit = std::min(end_idx, limit);
|
||||
|
||||
while (read_idx < limit && !isNullAt(res[read_idx]))
|
||||
{
|
||||
@ -271,7 +273,7 @@ void ColumnNullable::getPermutation(bool reverse, size_t limit, int null_directi
|
||||
}
|
||||
else
|
||||
{
|
||||
/// Shift all NULL values to the begin.
|
||||
/// Shift all NULL values to the beginning.
|
||||
|
||||
ssize_t read_idx = res.size() - 1;
|
||||
ssize_t write_idx = res.size() - 1;
|
||||
|
@ -83,6 +83,11 @@ Block MergeSortingBlockInputStream::readImpl()
|
||||
removeConstantsFromSortDescription(sample_block, description);
|
||||
}
|
||||
|
||||
/// If there were only const columns in sort description, then there is no need to sort.
|
||||
/// Return the blocks as is.
|
||||
if (description.empty())
|
||||
return block;
|
||||
|
||||
removeConstantsFromBlock(block);
|
||||
|
||||
blocks.push_back(block);
|
||||
|
@ -114,3 +114,6 @@
|
||||
\N 3
|
||||
\N 6
|
||||
\N 9
|
||||
2
|
||||
1
|
||||
0
|
||||
|
@ -20,3 +20,5 @@ SET max_block_size = 5;
|
||||
|
||||
SELECT nullIf(number, number % 3 = 0 ? number : 0) AS x, number AS y FROM (SELECT * FROM system.numbers LIMIT 10) ORDER BY x, y;
|
||||
SELECT nullIf(number, number % 3 = 0 ? number : 0) AS x, number AS y FROM (SELECT * FROM system.numbers LIMIT 10) ORDER BY x DESC, y;
|
||||
|
||||
SELECT x FROM (SELECT toNullable(number) AS x FROM system.numbers LIMIT 3) ORDER BY x DESC LIMIT 10
|
||||
|
@ -51,7 +51,14 @@ check "$url$session&session_timeout=3600" "$select" "Exception" 0 "3600 second t
|
||||
check "$url$session&session_timeout=60" "$select" "Exception" 0 "60 second timeout not accepted."
|
||||
|
||||
check $url$session "$select" "7777777" 1 "Failed to reuse session."
|
||||
check "$url$session&user=readonly&session_check=1" "$select" "Exception.*Session not found" 1 "Session is accessable for another user."
|
||||
# Workaround here
|
||||
# TODO: move the test to integration test or add readonly user to test environment
|
||||
if [[ -z `request "$url?user=readonly" "SELECT ''"` ]]; then
|
||||
# We have readonly user
|
||||
check "$url$session&user=readonly&session_check=1" "$select" "Exception.*Session not found" 1 "Session is accessable for another user."
|
||||
else
|
||||
check "$url$session&user=readonly&session_check=1" "$select" "Exception.*Unknown user*" 1 "Session is accessable for unknown user."
|
||||
fi
|
||||
|
||||
create_temporary_table $url$session
|
||||
check $url$session "$select_from_temporary_table" "Hello" 1 "Failed to reuse a temporary table for session."
|
||||
|
@ -0,0 +1,4 @@
|
||||
1 2
|
||||
2
|
||||
2
|
||||
2
|
@ -0,0 +1,3 @@
|
||||
SELECT * FROM (SELECT 1 AS x, 2 AS y) ORDER BY x;
|
||||
|
||||
SELECT * FROM (SELECT x FROM (SELECT 2 AS x, arrayJoin([1,2,3]))) ORDER BY x;
|
Loading…
Reference in New Issue
Block a user