mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-28 02:21:59 +00:00
Merge branch 'master' into new-nav
This commit is contained in:
commit
76f0461917
@ -14,7 +14,7 @@ curl https://clickhouse.com/ | sh
|
||||
* [Tutorial](https://clickhouse.com/docs/en/getting_started/tutorial/) shows how to set up and query a small ClickHouse cluster.
|
||||
* [Documentation](https://clickhouse.com/docs/en/) provides more in-depth information.
|
||||
* [YouTube channel](https://www.youtube.com/c/ClickHouseDB) has a lot of content about ClickHouse in video format.
|
||||
* [Slack](https://join.slack.com/t/clickhousedb/shared_invite/zt-1gh9ds7f4-PgDhJAaF8ad5RbWBAAjzFg) and [Telegram](https://telegram.me/clickhouse_en) allow chatting with ClickHouse users in real-time.
|
||||
* [Slack](https://clickhouse.com/slack) and [Telegram](https://telegram.me/clickhouse_en) allow chatting with ClickHouse users in real-time.
|
||||
* [Blog](https://clickhouse.com/blog/) contains various ClickHouse-related articles, as well as announcements and reports about events.
|
||||
* [Code Browser (Woboq)](https://clickhouse.com/codebrowser/ClickHouse/index.html) with syntax highlight and navigation.
|
||||
* [Code Browser (github.dev)](https://github.dev/ClickHouse/ClickHouse) with syntax highlight, powered by github.dev.
|
||||
|
@ -60,6 +60,13 @@ install_packages previous_release_package_folder
|
||||
export USE_S3_STORAGE_FOR_MERGE_TREE=1
|
||||
# Previous version may not be ready for fault injections
|
||||
export ZOOKEEPER_FAULT_INJECTION=0
|
||||
|
||||
# force_sync=false doesn't work correctly on some older versions
|
||||
sudo cat /etc/clickhouse-server/config.d/keeper_port.xml \
|
||||
| sed "s|<force_sync>false</force_sync>|<force_sync>true</force_sync>|" \
|
||||
> /etc/clickhouse-server/config.d/keeper_port.xml.tmp
|
||||
sudo mv /etc/clickhouse-server/config.d/keeper_port.xml.tmp /etc/clickhouse-server/config.d/keeper_port.xml
|
||||
|
||||
configure
|
||||
|
||||
# But we still need default disk because some tables loaded only into it
|
||||
|
@ -1834,7 +1834,7 @@ bool ClientBase::executeMultiQuery(const String & all_queries_text)
|
||||
{
|
||||
/// disable logs if expects errors
|
||||
TestHint test_hint(all_queries_text);
|
||||
if (test_hint.clientError() || test_hint.serverError())
|
||||
if (test_hint.hasClientErrors() || test_hint.hasServerErrors())
|
||||
processTextAsSingleQuery("SET send_logs_level = 'fatal'");
|
||||
}
|
||||
|
||||
@ -1876,17 +1876,17 @@ bool ClientBase::executeMultiQuery(const String & all_queries_text)
|
||||
// the query ends because we failed to parse it, so we consume
|
||||
// the entire line.
|
||||
TestHint hint(String(this_query_begin, this_query_end - this_query_begin));
|
||||
if (hint.serverError())
|
||||
if (hint.hasServerErrors())
|
||||
{
|
||||
// Syntax errors are considered as client errors
|
||||
current_exception->addMessage("\nExpected server error '{}'.", hint.serverError());
|
||||
current_exception->addMessage("\nExpected server error: {}.", hint.serverErrors());
|
||||
current_exception->rethrow();
|
||||
}
|
||||
|
||||
if (hint.clientError() != current_exception->code())
|
||||
if (!hint.hasExpectedClientError(current_exception->code()))
|
||||
{
|
||||
if (hint.clientError())
|
||||
current_exception->addMessage("\nExpected client error: " + std::to_string(hint.clientError()));
|
||||
if (hint.hasClientErrors())
|
||||
current_exception->addMessage("\nExpected client error: {}.", hint.clientErrors());
|
||||
|
||||
current_exception->rethrow();
|
||||
}
|
||||
@ -1935,37 +1935,37 @@ bool ClientBase::executeMultiQuery(const String & all_queries_text)
|
||||
bool error_matches_hint = true;
|
||||
if (have_error)
|
||||
{
|
||||
if (test_hint.serverError())
|
||||
if (test_hint.hasServerErrors())
|
||||
{
|
||||
if (!server_exception)
|
||||
{
|
||||
error_matches_hint = false;
|
||||
fmt::print(stderr, "Expected server error code '{}' but got no server error (query: {}).\n",
|
||||
test_hint.serverError(), full_query);
|
||||
test_hint.serverErrors(), full_query);
|
||||
}
|
||||
else if (server_exception->code() != test_hint.serverError())
|
||||
else if (!test_hint.hasExpectedServerError(server_exception->code()))
|
||||
{
|
||||
error_matches_hint = false;
|
||||
fmt::print(stderr, "Expected server error code: {} but got: {} (query: {}).\n",
|
||||
test_hint.serverError(), server_exception->code(), full_query);
|
||||
test_hint.serverErrors(), server_exception->code(), full_query);
|
||||
}
|
||||
}
|
||||
if (test_hint.clientError())
|
||||
if (test_hint.hasClientErrors())
|
||||
{
|
||||
if (!client_exception)
|
||||
{
|
||||
error_matches_hint = false;
|
||||
fmt::print(stderr, "Expected client error code '{}' but got no client error (query: {}).\n",
|
||||
test_hint.clientError(), full_query);
|
||||
test_hint.clientErrors(), full_query);
|
||||
}
|
||||
else if (client_exception->code() != test_hint.clientError())
|
||||
else if (!test_hint.hasExpectedClientError(client_exception->code()))
|
||||
{
|
||||
error_matches_hint = false;
|
||||
fmt::print(stderr, "Expected client error code '{}' but got '{}' (query: {}).\n",
|
||||
test_hint.clientError(), client_exception->code(), full_query);
|
||||
test_hint.clientErrors(), client_exception->code(), full_query);
|
||||
}
|
||||
}
|
||||
if (!test_hint.clientError() && !test_hint.serverError())
|
||||
if (!test_hint.hasClientErrors() && !test_hint.hasServerErrors())
|
||||
{
|
||||
// No error was expected but it still occurred. This is the
|
||||
// default case without test hint, doesn't need additional
|
||||
@ -1975,19 +1975,19 @@ bool ClientBase::executeMultiQuery(const String & all_queries_text)
|
||||
}
|
||||
else
|
||||
{
|
||||
if (test_hint.clientError())
|
||||
if (test_hint.hasClientErrors())
|
||||
{
|
||||
error_matches_hint = false;
|
||||
fmt::print(stderr,
|
||||
"The query succeeded but the client error '{}' was expected (query: {}).\n",
|
||||
test_hint.clientError(), full_query);
|
||||
test_hint.clientErrors(), full_query);
|
||||
}
|
||||
if (test_hint.serverError())
|
||||
if (test_hint.hasServerErrors())
|
||||
{
|
||||
error_matches_hint = false;
|
||||
fmt::print(stderr,
|
||||
"The query succeeded but the server error '{}' was expected (query: {}).\n",
|
||||
test_hint.serverError(), full_query);
|
||||
test_hint.serverErrors(), full_query);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1,32 +1,15 @@
|
||||
#include "TestHint.h"
|
||||
#include <charconv>
|
||||
#include <string_view>
|
||||
|
||||
#include <Client/TestHint.h>
|
||||
|
||||
#include <Common/Exception.h>
|
||||
#include <Common/ErrorCodes.h>
|
||||
#include <IO/ReadBufferFromString.h>
|
||||
#include <IO/ReadHelpers.h>
|
||||
#include <Parsers/Lexer.h>
|
||||
#include <Common/ErrorCodes.h>
|
||||
#include <Common/Exception.h>
|
||||
|
||||
namespace
|
||||
namespace DB::ErrorCodes
|
||||
{
|
||||
|
||||
/// Parse error as number or as a string (name of the error code const)
|
||||
int parseErrorCode(DB::ReadBufferFromString & in)
|
||||
{
|
||||
int code = -1;
|
||||
String code_name;
|
||||
|
||||
auto * pos = in.position();
|
||||
tryReadText(code, in);
|
||||
if (pos != in.position())
|
||||
{
|
||||
return code;
|
||||
}
|
||||
|
||||
/// Try parse as string
|
||||
readStringUntilWhitespace(code_name, in);
|
||||
return DB::ErrorCodes::getErrorCodeByName(code_name);
|
||||
}
|
||||
|
||||
extern const int CANNOT_PARSE_TEXT;
|
||||
}
|
||||
|
||||
namespace DB
|
||||
@ -60,8 +43,8 @@ TestHint::TestHint(const String & query_)
|
||||
size_t pos_end = comment.find('}', pos_start);
|
||||
if (pos_end != String::npos)
|
||||
{
|
||||
String hint(comment.begin() + pos_start + 1, comment.begin() + pos_end);
|
||||
parse(hint, is_leading_hint);
|
||||
Lexer comment_lexer(comment.c_str() + pos_start + 1, comment.c_str() + pos_end, 0);
|
||||
parse(comment_lexer, is_leading_hint);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -69,33 +52,86 @@ TestHint::TestHint(const String & query_)
|
||||
}
|
||||
}
|
||||
|
||||
void TestHint::parse(const String & hint, bool is_leading_hint)
|
||||
bool TestHint::hasExpectedClientError(int error)
|
||||
{
|
||||
ReadBufferFromString in(hint);
|
||||
String item;
|
||||
return std::find(client_errors.begin(), client_errors.end(), error) != client_errors.end();
|
||||
}
|
||||
|
||||
while (!in.eof())
|
||||
bool TestHint::hasExpectedServerError(int error)
|
||||
{
|
||||
return std::find(server_errors.begin(), server_errors.end(), error) != server_errors.end();
|
||||
}
|
||||
|
||||
void TestHint::parse(Lexer & comment_lexer, bool is_leading_hint)
|
||||
{
|
||||
std::unordered_set<std::string_view> commands{"echo", "echoOn", "echoOff"};
|
||||
|
||||
std::unordered_set<std::string_view> command_errors{
|
||||
"serverError",
|
||||
"clientError",
|
||||
};
|
||||
|
||||
for (Token token = comment_lexer.nextToken(); !token.isEnd(); token = comment_lexer.nextToken())
|
||||
{
|
||||
readStringUntilWhitespace(item, in);
|
||||
if (in.eof())
|
||||
break;
|
||||
|
||||
skipWhitespaceIfAny(in);
|
||||
|
||||
if (!is_leading_hint)
|
||||
String item = String(token.begin, token.end);
|
||||
if (token.type == TokenType::BareWord && commands.contains(item))
|
||||
{
|
||||
if (item == "serverError")
|
||||
server_error = parseErrorCode(in);
|
||||
else if (item == "clientError")
|
||||
client_error = parseErrorCode(in);
|
||||
if (item == "echo")
|
||||
echo.emplace(true);
|
||||
if (item == "echoOn")
|
||||
echo.emplace(true);
|
||||
if (item == "echoOff")
|
||||
echo.emplace(false);
|
||||
}
|
||||
else if (!is_leading_hint && token.type == TokenType::BareWord && command_errors.contains(item))
|
||||
{
|
||||
/// Everything after this must be a list of errors separated by comma
|
||||
ErrorVector error_codes;
|
||||
while (!token.isEnd())
|
||||
{
|
||||
token = comment_lexer.nextToken();
|
||||
if (token.type == TokenType::Whitespace)
|
||||
continue;
|
||||
if (token.type == TokenType::Number)
|
||||
{
|
||||
int code;
|
||||
auto [p, ec] = std::from_chars(token.begin, token.end, code);
|
||||
if (p == token.begin)
|
||||
throw DB::Exception(
|
||||
DB::ErrorCodes::CANNOT_PARSE_TEXT,
|
||||
"Could not parse integer number for errorcode: {}",
|
||||
std::string_view(token.begin, token.end));
|
||||
error_codes.push_back(code);
|
||||
}
|
||||
else if (token.type == TokenType::BareWord)
|
||||
{
|
||||
int code = DB::ErrorCodes::getErrorCodeByName(std::string_view(token.begin, token.end));
|
||||
error_codes.push_back(code);
|
||||
}
|
||||
else
|
||||
throw DB::Exception(
|
||||
DB::ErrorCodes::CANNOT_PARSE_TEXT,
|
||||
"Could not parse error code in {}: {}",
|
||||
getTokenName(token.type),
|
||||
std::string_view(token.begin, token.end));
|
||||
do
|
||||
{
|
||||
token = comment_lexer.nextToken();
|
||||
} while (!token.isEnd() && token.type == TokenType::Whitespace);
|
||||
|
||||
if (item == "echo")
|
||||
echo.emplace(true);
|
||||
if (item == "echoOn")
|
||||
echo.emplace(true);
|
||||
if (item == "echoOff")
|
||||
echo.emplace(false);
|
||||
if (!token.isEnd() && token.type != TokenType::Comma)
|
||||
throw DB::Exception(
|
||||
DB::ErrorCodes::CANNOT_PARSE_TEXT,
|
||||
"Could not parse error code. Expected ','. Got '{}'",
|
||||
std::string_view(token.begin, token.end));
|
||||
}
|
||||
|
||||
if (item == "serverError")
|
||||
server_errors = error_codes;
|
||||
else
|
||||
client_errors = error_codes;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1,21 +1,30 @@
|
||||
#pragma once
|
||||
|
||||
#include <optional>
|
||||
#include <vector>
|
||||
|
||||
#include <fmt/format.h>
|
||||
|
||||
#include <Core/Types.h>
|
||||
|
||||
|
||||
namespace DB
|
||||
{
|
||||
|
||||
class Lexer;
|
||||
|
||||
/// Checks expected server and client error codes.
|
||||
///
|
||||
/// The following comment hints are supported:
|
||||
///
|
||||
/// - "-- { serverError 60 }" -- in case of you are expecting server error.
|
||||
/// - "-- { serverError 16, 36 }" -- in case of you are expecting one of the 2 errors.
|
||||
///
|
||||
/// - "-- { clientError 20 }" -- in case of you are expecting client error.
|
||||
/// - "-- { clientError 20, 60, 92 }" -- It's expected that the client will return one of the 3 errors.
|
||||
///
|
||||
/// - "-- { serverError FUNCTION_THROW_IF_VALUE_IS_NON_ZERO }" -- by error name.
|
||||
/// - "-- { serverError NO_SUCH_COLUMN_IN_TABLE, BAD_ARGUMENTS }" -- by error name.
|
||||
///
|
||||
/// - "-- { clientError FUNCTION_THROW_IF_VALUE_IS_NON_ZERO }" -- by error name.
|
||||
///
|
||||
@ -43,29 +52,73 @@ namespace DB
|
||||
class TestHint
|
||||
{
|
||||
public:
|
||||
using ErrorVector = std::vector<int>;
|
||||
TestHint(const String & query_);
|
||||
|
||||
int serverError() const { return server_error; }
|
||||
int clientError() const { return client_error; }
|
||||
const auto & serverErrors() const { return server_errors; }
|
||||
const auto & clientErrors() const { return client_errors; }
|
||||
std::optional<bool> echoQueries() const { return echo; }
|
||||
|
||||
bool hasClientErrors() { return !client_errors.empty(); }
|
||||
bool hasServerErrors() { return !server_errors.empty(); }
|
||||
|
||||
bool hasExpectedClientError(int error);
|
||||
bool hasExpectedServerError(int error);
|
||||
|
||||
private:
|
||||
const String & query;
|
||||
int server_error = 0;
|
||||
int client_error = 0;
|
||||
ErrorVector server_errors{};
|
||||
ErrorVector client_errors{};
|
||||
std::optional<bool> echo;
|
||||
|
||||
void parse(const String & hint, bool is_leading_hint);
|
||||
void parse(Lexer & comment_lexer, bool is_leading_hint);
|
||||
|
||||
bool allErrorsExpected(int actual_server_error, int actual_client_error) const
|
||||
{
|
||||
return (server_error || client_error) && (server_error == actual_server_error) && (client_error == actual_client_error);
|
||||
if (actual_server_error && std::find(server_errors.begin(), server_errors.end(), actual_server_error) == server_errors.end())
|
||||
return false;
|
||||
if (!actual_server_error && server_errors.size())
|
||||
return false;
|
||||
|
||||
if (actual_client_error && std::find(client_errors.begin(), client_errors.end(), actual_client_error) == client_errors.end())
|
||||
return false;
|
||||
if (!actual_client_error && client_errors.size())
|
||||
return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool lostExpectedError(int actual_server_error, int actual_client_error) const
|
||||
{
|
||||
return (server_error && !actual_server_error) || (client_error && !actual_client_error);
|
||||
return (server_errors.size() && !actual_server_error) || (client_errors.size() && !actual_client_error);
|
||||
}
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
template <>
|
||||
struct fmt::formatter<DB::TestHint::ErrorVector>
|
||||
{
|
||||
static constexpr auto parse(format_parse_context & ctx)
|
||||
{
|
||||
const auto * it = ctx.begin();
|
||||
const auto * end = ctx.end();
|
||||
|
||||
/// Only support {}.
|
||||
if (it != end && *it != '}')
|
||||
throw format_error("Invalid format");
|
||||
|
||||
return it;
|
||||
}
|
||||
|
||||
template <typename FormatContext>
|
||||
auto format(const DB::TestHint::ErrorVector & ErrorVector, FormatContext & ctx)
|
||||
{
|
||||
if (ErrorVector.empty())
|
||||
return format_to(ctx.out(), "{}", 0);
|
||||
else if (ErrorVector.size() == 1)
|
||||
return format_to(ctx.out(), "{}", ErrorVector[0]);
|
||||
else
|
||||
return format_to(ctx.out(), "[{}]", fmt::join(ErrorVector, ", "));
|
||||
}
|
||||
};
|
||||
|
@ -211,9 +211,14 @@ public:
|
||||
void flush()
|
||||
{
|
||||
auto * file_buffer = tryGetFileBuffer();
|
||||
/// Fsync file system if needed
|
||||
if (file_buffer && log_file_settings.force_sync)
|
||||
file_buffer->sync();
|
||||
if (file_buffer)
|
||||
{
|
||||
/// Fsync file system if needed
|
||||
if (log_file_settings.force_sync)
|
||||
file_buffer->sync();
|
||||
else
|
||||
file_buffer->next();
|
||||
}
|
||||
}
|
||||
|
||||
uint64_t getStartIndex() const
|
||||
|
@ -91,6 +91,8 @@ ColumnPtr FunctionArrayReverse::executeImpl(const ColumnsWithTypeAndName & argum
|
||||
|| executeFixedString(*src_inner_col, offsets, *res_inner_col)
|
||||
|| executeGeneric(*src_inner_col, offsets, *res_inner_col);
|
||||
|
||||
chassert(bool(src_nullable_col) == bool(res_nullable_col));
|
||||
|
||||
if (src_nullable_col)
|
||||
if (!executeNumber<UInt8>(src_nullable_col->getNullMapColumn(), offsets, res_nullable_col->getNullMapColumn()))
|
||||
throw Exception(ErrorCodes::ILLEGAL_COLUMN, "Illegal column {} of null map of the first argument of function {}",
|
||||
|
@ -1089,6 +1089,7 @@ static std::shared_ptr<IJoin> chooseJoinAlgorithm(
|
||||
|
||||
if (MergeJoin::isSupported(analyzed_join))
|
||||
return std::make_shared<JoinSwitcher>(analyzed_join, right_sample_block);
|
||||
return std::make_shared<HashJoin>(analyzed_join, right_sample_block);
|
||||
}
|
||||
|
||||
throw Exception(ErrorCodes::NOT_IMPLEMENTED,
|
||||
|
@ -64,6 +64,7 @@ ASTs OptimizeIfChainsVisitor::ifChain(const ASTPtr & child)
|
||||
throw Exception(ErrorCodes::UNEXPECTED_AST_STRUCTURE, "Unexpected AST for function 'if'");
|
||||
|
||||
const auto * function_args = function_node->arguments->as<ASTExpressionList>();
|
||||
chassert(function_args);
|
||||
|
||||
if (!function_args || function_args->children.size() != 3)
|
||||
throw Exception(ErrorCodes::NUMBER_OF_ARGUMENTS_DOESNT_MATCH,
|
||||
|
@ -655,7 +655,7 @@ std::shared_ptr<IJoin> chooseJoinAlgorithm(std::shared_ptr<TableJoin> & table_jo
|
||||
return std::make_shared<HashJoin>(table_join, right_table_expression_header);
|
||||
}
|
||||
|
||||
if (!table_join->oneDisjunct() && !table_join->isEnabledAlgorithm(JoinAlgorithm::HASH))
|
||||
if (!table_join->oneDisjunct() && !table_join->isEnabledAlgorithm(JoinAlgorithm::HASH) && !table_join->isEnabledAlgorithm(JoinAlgorithm::AUTO))
|
||||
throw Exception(ErrorCodes::NOT_IMPLEMENTED, "Only `hash` join supports multiple ORs for keys in JOIN ON section");
|
||||
|
||||
/// Direct JOIN with special storages that support key value access. For example JOIN with Dictionary
|
||||
@ -708,7 +708,11 @@ std::shared_ptr<IJoin> chooseJoinAlgorithm(std::shared_ptr<TableJoin> & table_jo
|
||||
}
|
||||
|
||||
if (table_join->isEnabledAlgorithm(JoinAlgorithm::AUTO))
|
||||
return std::make_shared<JoinSwitcher>(table_join, right_table_expression_header);
|
||||
{
|
||||
if (MergeJoin::isSupported(table_join))
|
||||
return std::make_shared<JoinSwitcher>(table_join, right_table_expression_header);
|
||||
return std::make_shared<HashJoin>(table_join, right_table_expression_header);
|
||||
}
|
||||
|
||||
throw Exception(ErrorCodes::NOT_IMPLEMENTED,
|
||||
"Can't execute any of specified algorithms for specified strictness/kind and right storage type");
|
||||
|
@ -9,8 +9,7 @@
|
||||
<operation_timeout_ms>10000</operation_timeout_ms>
|
||||
<session_timeout_ms>100000</session_timeout_ms>
|
||||
<min_session_timeout_ms>10000</min_session_timeout_ms>
|
||||
<!-- FIXME enable force_sync because of suspicious rollback without it -->
|
||||
<force_sync>true</force_sync>
|
||||
<force_sync>false</force_sync>
|
||||
<startup_timeout>240000</startup_timeout>
|
||||
<!-- we want all logs for complex problems investigation -->
|
||||
<reserved_log_items>1000000000000000</reserved_log_items>
|
||||
|
@ -6,7 +6,7 @@ SELECT number FROM system.numbers WHERE number >= 5 LIMIT 2;
|
||||
SELECT * FROM system.numbers WHERE number == 7 LIMIT 1;
|
||||
SELECT number AS n FROM system.numbers WHERE number IN(8, 9) LIMIT 2;
|
||||
select number from system.numbers limit 0;
|
||||
select x from system.numbers limit 1; -- { clientError 0 serverError 47 }
|
||||
select x from system.numbers limit 1; -- { serverError UNKNOWN_IDENTIFIER }
|
||||
SELECT x, number FROM system.numbers LIMIT 1; -- { serverError 47 }
|
||||
SELECT * FROM system.number LIMIT 1; -- { serverError 60 }
|
||||
SELECT * FROM system LIMIT 1; -- { serverError 60 }
|
||||
|
@ -13,3 +13,33 @@
|
||||
2 2
|
||||
2 3
|
||||
2 4
|
||||
0 0
|
||||
0 1
|
||||
0 2
|
||||
0 3
|
||||
0 4
|
||||
1 0
|
||||
1 1
|
||||
1 2
|
||||
1 3
|
||||
1 4
|
||||
2 0
|
||||
2 1
|
||||
2 2
|
||||
2 3
|
||||
2 4
|
||||
0 0
|
||||
0 1
|
||||
0 2
|
||||
0 3
|
||||
0 4
|
||||
1 0
|
||||
1 1
|
||||
1 2
|
||||
1 3
|
||||
1 4
|
||||
2 0
|
||||
2 1
|
||||
2 2
|
||||
2 3
|
||||
2 4
|
||||
|
@ -1 +1,7 @@
|
||||
SELECT x, y FROM (SELECT number AS x FROM system.numbers LIMIT 3) js1 CROSS JOIN (SELECT number AS y FROM system.numbers LIMIT 5) js2;
|
||||
|
||||
SET join_algorithm = 'auto';
|
||||
SELECT x, y FROM (SELECT number AS x FROM system.numbers LIMIT 3) js1 CROSS JOIN (SELECT number AS y FROM system.numbers LIMIT 5) js2;
|
||||
|
||||
SET allow_experimental_analyzer = 1;
|
||||
SELECT x, y FROM (SELECT number AS x FROM system.numbers LIMIT 3) js1 CROSS JOIN (SELECT number AS y FROM system.numbers LIMIT 5) js2;
|
||||
|
@ -21,11 +21,11 @@ SELECT hasColumnInTable('localhost', currentDatabase(), 'has_column_in_table', '
|
||||
SELECT hasColumnInTable('system', 'one', '');
|
||||
|
||||
/* bad queries */
|
||||
SELECT hasColumnInTable('', '', ''); -- { serverError 60; }
|
||||
SELECT hasColumnInTable('', 't', 'c'); -- { serverError 81; }
|
||||
SELECT hasColumnInTable(currentDatabase(), '', 'c'); -- { serverError 60; }
|
||||
SELECT hasColumnInTable('d', 't', 's'); -- { serverError 81; }
|
||||
SELECT hasColumnInTable(currentDatabase(), 't', 's'); -- { serverError 60; }
|
||||
SELECT hasColumnInTable('', '', ''); -- { serverError 60 }
|
||||
SELECT hasColumnInTable('', 't', 'c'); -- { serverError 81 }
|
||||
SELECT hasColumnInTable(currentDatabase(), '', 'c'); -- { serverError 60 }
|
||||
SELECT hasColumnInTable('d', 't', 's'); -- { serverError 81 }
|
||||
SELECT hasColumnInTable(currentDatabase(), 't', 's'); -- { serverError 60 }
|
||||
|
||||
|
||||
DROP TABLE has_column_in_table;
|
||||
|
@ -1,14 +1,14 @@
|
||||
SET send_logs_level = 'fatal';
|
||||
|
||||
SELECT formatDateTime(); -- { serverError NUMBER_OF_ARGUMENTS_DOESNT_MATCH (42) }
|
||||
SELECT formatDateTime('not a datetime', 'IGNORED'); -- { serverError ILLEGAL_TYPE_OF_ARGUMENT (43) }
|
||||
SELECT formatDateTime(now(), now()); -- { serverError ILLEGAL_TYPE_OF_ARGUMENT (43) }
|
||||
SELECT formatDateTime(now(), 'good format pattern', now()); -- { serverError ILLEGAL_TYPE_OF_ARGUMENT (43) }
|
||||
SELECT formatDateTime(now(), 'unescaped %'); -- { serverError BAD_ARGUMENTS (36) }
|
||||
SELECT formatDateTime(toDateTime('2018-01-02 22:33:44'), '%U'); -- { serverError NOT_IMPLEMENTED (48) }
|
||||
SELECT formatDateTime(toDateTime('2018-01-02 22:33:44'), '%v'); -- { serverError NOT_IMPLEMENTED (48) }
|
||||
SELECT formatDateTime(toDateTime('2018-01-02 22:33:44'), '%x'); -- { serverError NOT_IMPLEMENTED (48) }
|
||||
SELECT formatDateTime(toDateTime('2018-01-02 22:33:44'), '%X'); -- { serverError NOT_IMPLEMENTED (48) }
|
||||
SELECT formatDateTime(); -- { serverError NUMBER_OF_ARGUMENTS_DOESNT_MATCH }
|
||||
SELECT formatDateTime('not a datetime', 'IGNORED'); -- { serverError ILLEGAL_TYPE_OF_ARGUMENT }
|
||||
SELECT formatDateTime(now(), now()); -- { serverError ILLEGAL_TYPE_OF_ARGUMENT }
|
||||
SELECT formatDateTime(now(), 'good format pattern', now()); -- { serverError ILLEGAL_TYPE_OF_ARGUMENT }
|
||||
SELECT formatDateTime(now(), 'unescaped %'); -- { serverError BAD_ARGUMENTS }
|
||||
SELECT formatDateTime(toDateTime('2018-01-02 22:33:44'), '%U'); -- { serverError NOT_IMPLEMENTED }
|
||||
SELECT formatDateTime(toDateTime('2018-01-02 22:33:44'), '%v'); -- { serverError NOT_IMPLEMENTED }
|
||||
SELECT formatDateTime(toDateTime('2018-01-02 22:33:44'), '%x'); -- { serverError NOT_IMPLEMENTED }
|
||||
SELECT formatDateTime(toDateTime('2018-01-02 22:33:44'), '%X'); -- { serverError NOT_IMPLEMENTED }
|
||||
|
||||
SELECT formatDateTime(toDateTime('2018-01-02 22:33:44'), '%a'), formatDateTime(toDate32('2018-01-02'), '%a');
|
||||
SELECT formatDateTime(toDateTime('2018-01-02 22:33:44'), '%b'), formatDateTime(toDate32('2018-01-02'), '%b');
|
||||
|
@ -12,8 +12,8 @@ SELECT * FROM VALUES('n UInt64, s String, ss String', (1 + 22, '23', toString(23
|
||||
|
||||
SELECT * FROM VALUES('a Decimal(4, 4), b String, c String', (divide(toDecimal32(5, 3), 3), 'a', 'b'));
|
||||
|
||||
SELECT * FROM VALUES('x Float64', toUInt64(-1)); -- { serverError 69; }
|
||||
SELECT * FROM VALUES('x Float64', NULL); -- { serverError 53; }
|
||||
SELECT * FROM VALUES('x Float64', toUInt64(-1)); -- { serverError 69 }
|
||||
SELECT * FROM VALUES('x Float64', NULL); -- { serverError 53 }
|
||||
SELECT * FROM VALUES('x Nullable(Float64)', NULL);
|
||||
|
||||
DROP TABLE values_list;
|
||||
|
@ -19,12 +19,12 @@ DROP TABLE t3;
|
||||
-- live view
|
||||
SET allow_experimental_live_view=1;
|
||||
CREATE LIVE VIEW lv AS SELECT * FROM t1;
|
||||
CREATE TABLE t3 AS lv; -- { serverError 80; }
|
||||
CREATE TABLE t3 AS lv; -- { serverError 80 }
|
||||
DROP TABLE lv;
|
||||
|
||||
-- view
|
||||
CREATE VIEW v AS SELECT * FROM t1;
|
||||
CREATE TABLE t3 AS v; -- { serverError 80; }
|
||||
CREATE TABLE t3 AS v; -- { serverError 80 }
|
||||
DROP TABLE v;
|
||||
|
||||
-- dictionary
|
||||
@ -43,7 +43,7 @@ SOURCE(CLICKHOUSE(
|
||||
TABLE 'dict_data' DB 'test_01056_dict_data' USER 'default' PASSWORD ''))
|
||||
LIFETIME(MIN 0 MAX 0)
|
||||
LAYOUT(SPARSE_HASHED());
|
||||
CREATE TABLE t3 AS dict; -- { serverError 80; }
|
||||
CREATE TABLE t3 AS dict; -- { serverError 80 }
|
||||
|
||||
DROP TABLE IF EXISTS t1;
|
||||
DROP TABLE IF EXISTS t3;
|
||||
|
@ -16,16 +16,16 @@ select * from dist_01072 where key=toInt32OrZero(toString(xxHash64(0)));
|
||||
select * from dist_01072 where key=toInt32(xxHash32(0));
|
||||
select * from dist_01072 where key=toInt32(toInt32(xxHash32(0)));
|
||||
select * from dist_01072 where key=toInt32(toInt32(toInt32(xxHash32(0))));
|
||||
select * from dist_01072 where key=value; -- { serverError 507; }
|
||||
select * from dist_01072 where key=toInt32(value); -- { serverError 507; }
|
||||
select * from dist_01072 where key=value; -- { serverError 507 }
|
||||
select * from dist_01072 where key=toInt32(value); -- { serverError 507 }
|
||||
select * from dist_01072 where key=value settings force_optimize_skip_unused_shards=0;
|
||||
select * from dist_01072 where key=toInt32(value) settings force_optimize_skip_unused_shards=0;
|
||||
|
||||
drop table dist_01072;
|
||||
create table dist_01072 (key Int, value Nullable(Int), str String) Engine=Distributed(test_cluster_two_shards, currentDatabase(), data_01072, key%2);
|
||||
select * from dist_01072 where key=toInt32(xxHash32(0));
|
||||
select * from dist_01072 where key=value; -- { serverError 507; }
|
||||
select * from dist_01072 where key=toInt32(value); -- { serverError 507; }
|
||||
select * from dist_01072 where key=value; -- { serverError 507 }
|
||||
select * from dist_01072 where key=toInt32(value); -- { serverError 507 }
|
||||
select * from dist_01072 where key=value settings force_optimize_skip_unused_shards=0;
|
||||
select * from dist_01072 where key=toInt32(value) settings force_optimize_skip_unused_shards=0;
|
||||
|
||||
@ -34,16 +34,16 @@ set allow_suspicious_low_cardinality_types=1;
|
||||
drop table dist_01072;
|
||||
create table dist_01072 (key Int, value LowCardinality(Int), str String) Engine=Distributed(test_cluster_two_shards, currentDatabase(), data_01072, key%2);
|
||||
select * from dist_01072 where key=toInt32(xxHash32(0));
|
||||
select * from dist_01072 where key=value; -- { serverError 507; }
|
||||
select * from dist_01072 where key=toInt32(value); -- { serverError 507; }
|
||||
select * from dist_01072 where key=value; -- { serverError 507 }
|
||||
select * from dist_01072 where key=toInt32(value); -- { serverError 507 }
|
||||
select * from dist_01072 where key=value settings force_optimize_skip_unused_shards=0;
|
||||
select * from dist_01072 where key=toInt32(value) settings force_optimize_skip_unused_shards=0;
|
||||
|
||||
drop table dist_01072;
|
||||
create table dist_01072 (key Int, value LowCardinality(Nullable(Int)), str String) Engine=Distributed(test_cluster_two_shards, currentDatabase(), data_01072, key%2);
|
||||
select * from dist_01072 where key=toInt32(xxHash32(0));
|
||||
select * from dist_01072 where key=value; -- { serverError 507; }
|
||||
select * from dist_01072 where key=toInt32(value); -- { serverError 507; }
|
||||
select * from dist_01072 where key=value; -- { serverError 507 }
|
||||
select * from dist_01072 where key=toInt32(value); -- { serverError 507 }
|
||||
select * from dist_01072 where key=value settings force_optimize_skip_unused_shards=0;
|
||||
select * from dist_01072 where key=toInt32(value) settings force_optimize_skip_unused_shards=0;
|
||||
|
||||
|
@ -9,7 +9,7 @@ create table data_02000 (key Int) Engine=Null();
|
||||
create table dist_02000 as data_02000 Engine=Distributed(test_cluster_two_shards, currentDatabase(), data_02000, key);
|
||||
|
||||
select * from data_02000 where key = 0xdeadbeafdeadbeaf;
|
||||
select * from dist_02000 where key = 0xdeadbeafdeadbeaf settings force_optimize_skip_unused_shards=2; -- { serverError 507; }
|
||||
select * from dist_02000 where key = 0xdeadbeafdeadbeaf settings force_optimize_skip_unused_shards=2; -- { serverError 507 }
|
||||
select * from dist_02000 where key = 0xdeadbeafdeadbeaf;
|
||||
|
||||
drop table data_02000;
|
||||
|
@ -16,7 +16,7 @@ LAYOUT(FLAT());
|
||||
|
||||
SYSTEM RELOAD DICTIONARY dict_db_01225.dict;
|
||||
|
||||
DROP TABLE dict_db_01225.dict; -- { serverError 520; }
|
||||
DROP TABLE dict_db_01225.dict; -- { serverError 520 }
|
||||
DROP DICTIONARY dict_db_01225.dict;
|
||||
|
||||
DROP DATABASE dict_db_01225;
|
||||
|
@ -18,7 +18,7 @@ LIFETIME(MIN 0 MAX 0)
|
||||
LAYOUT(FLAT());
|
||||
|
||||
SHOW CREATE TABLE dict_db_01225_dictionary.`dict_db_01225.dict` FORMAT TSVRaw;
|
||||
SHOW CREATE TABLE dict_db_01225_dictionary.`dict_db_01225.no_such_dict`; -- { serverError 487; }
|
||||
SHOW CREATE TABLE dict_db_01225_dictionary.`dict_db_01225.no_such_dict`; -- { serverError 487 }
|
||||
|
||||
DROP DATABASE dict_db_01225;
|
||||
DROP DATABASE dict_db_01225_dictionary;
|
||||
|
@ -15,7 +15,7 @@ select count() from system.query_log where current_database = currentDatabase()
|
||||
|
||||
set max_rows_to_read='100K';
|
||||
set log_queries_min_type='EXCEPTION_WHILE_PROCESSING';
|
||||
select '01231_log_queries_min_type/EXCEPTION_WHILE_PROCESSING', max(number) from system.numbers limit 1e6; -- { serverError 158; }
|
||||
select '01231_log_queries_min_type/EXCEPTION_WHILE_PROCESSING', max(number) from system.numbers limit 1e6; -- { serverError 158 }
|
||||
set max_rows_to_read=0;
|
||||
system flush logs;
|
||||
select count() from system.query_log where current_database = currentDatabase()
|
||||
@ -23,7 +23,7 @@ select count() from system.query_log where current_database = currentDatabase()
|
||||
and event_date >= yesterday() and type = 'ExceptionWhileProcessing';
|
||||
|
||||
set max_rows_to_read='100K';
|
||||
select '01231_log_queries_min_type w/ Settings/EXCEPTION_WHILE_PROCESSING', max(number) from system.numbers limit 1e6; -- { serverError 158; }
|
||||
select '01231_log_queries_min_type w/ Settings/EXCEPTION_WHILE_PROCESSING', max(number) from system.numbers limit 1e6; -- { serverError 158 }
|
||||
system flush logs;
|
||||
set max_rows_to_read=0;
|
||||
select count() from system.query_log where
|
||||
|
@ -76,7 +76,7 @@ insert into data_01278 select
|
||||
reinterpretAsString(number), // s6
|
||||
reinterpretAsString(number), // s7
|
||||
reinterpretAsString(number) // s8
|
||||
from numbers(100000); -- { serverError 241; }" > /dev/null 2>&1
|
||||
from numbers(100000); -- { serverError 241 }" > /dev/null 2>&1
|
||||
local ret_code=$?
|
||||
if [[ $ret_code -eq 0 ]];
|
||||
then
|
||||
|
@ -19,9 +19,9 @@ select port{{ suffix }}('http://127.0.0.1/', toUInt16(80));
|
||||
select port{{ suffix }}('http://foobar.com/', toUInt16(80));
|
||||
|
||||
-- unsupported
|
||||
/* ILLEGAL_TYPE_OF_ARGUMENT */ select port(toFixedString('', 1)); -- { serverError 43; }
|
||||
/* ILLEGAL_TYPE_OF_ARGUMENT */ select port{{ suffix }}('', 1); -- { serverError 43; }
|
||||
/* NUMBER_OF_ARGUMENTS_DOESNT_MATCH */ select port{{ suffix }}('', 1, 1); -- { serverError 42; }
|
||||
/* ILLEGAL_TYPE_OF_ARGUMENT */ select port(toFixedString('', 1)); -- { serverError 43 }
|
||||
/* ILLEGAL_TYPE_OF_ARGUMENT */ select port{{ suffix }}('', 1); -- { serverError 43 }
|
||||
/* NUMBER_OF_ARGUMENTS_DOESNT_MATCH */ select port{{ suffix }}('', 1, 1); -- { serverError 42 }
|
||||
|
||||
--
|
||||
-- Known limitations of domain() (getURLHost())
|
||||
|
@ -1 +1 @@
|
||||
SELECT dictGetString(concat('default', '.countryId'), 'country', toUInt64(number)) AS country FROM numbers(2) GROUP BY country; -- { serverError 36; }
|
||||
SELECT dictGetString(concat('default', '.countryId'), 'country', toUInt64(number)) AS country FROM numbers(2) GROUP BY country; -- { serverError 36 }
|
||||
|
@ -1,7 +1,7 @@
|
||||
-- Tags: no-parallel
|
||||
|
||||
-- https://github.com/ClickHouse/ClickHouse/issues/11469
|
||||
SELECT dictGet('default.countryId', 'country', toUInt64(number)) AS country FROM numbers(2) GROUP BY country; -- { serverError 36; }
|
||||
SELECT dictGet('default.countryId', 'country', toUInt64(number)) AS country FROM numbers(2) GROUP BY country; -- { serverError 36 }
|
||||
|
||||
|
||||
-- with real dictionary
|
||||
|
@ -5,9 +5,9 @@ SELECT CAST(CAST(NULL AS Nullable(String)) AS Nullable(Enum8('Hello' = 1)));
|
||||
SELECT CAST(CAST(NULL AS Nullable(FixedString(1))) AS Nullable(Enum8('Hello' = 1)));
|
||||
|
||||
-- empty string still not acceptable
|
||||
SELECT CAST(CAST('' AS Nullable(String)) AS Nullable(Enum8('Hello' = 1))); -- { serverError 36; }
|
||||
SELECT CAST(CAST('' AS Nullable(FixedString(1))) AS Nullable(Enum8('Hello' = 1))); -- { serverError 36; }
|
||||
SELECT CAST(CAST('' AS Nullable(String)) AS Nullable(Enum8('Hello' = 1))); -- { serverError 36 }
|
||||
SELECT CAST(CAST('' AS Nullable(FixedString(1))) AS Nullable(Enum8('Hello' = 1))); -- { serverError 36 }
|
||||
|
||||
-- non-Nullable Enum() still not acceptable
|
||||
SELECT CAST(CAST(NULL AS Nullable(String)) AS Enum8('Hello' = 1)); -- { serverError 349; }
|
||||
SELECT CAST(CAST(NULL AS Nullable(FixedString(1))) AS Enum8('Hello' = 1)); -- { serverError 349; }
|
||||
SELECT CAST(CAST(NULL AS Nullable(String)) AS Enum8('Hello' = 1)); -- { serverError 349 }
|
||||
SELECT CAST(CAST(NULL AS Nullable(FixedString(1))) AS Enum8('Hello' = 1)); -- { serverError 349 }
|
||||
|
@ -1,4 +1,4 @@
|
||||
-- repeat() with this length and this number of rows will allocation huge enough region (MSB set),
|
||||
-- which will cause roundUpToPowerOfTwoOrZero() returns 0 for such allocation (before the fix),
|
||||
-- and later repeat() will try to use this memory and will got SIGSEGV.
|
||||
SELECT repeat('0.0001048576', number * (number * (number * 255))) FROM numbers(65535); -- { serverError 131; }
|
||||
SELECT repeat('0.0001048576', number * (number * (number * 255))) FROM numbers(65535); -- { serverError 131 }
|
||||
|
@ -1,5 +1,5 @@
|
||||
SELECT arrayFilter((a) -> ((a, arrayJoin([])) IN (Null, [Null])), []);
|
||||
SELECT arrayFilter((a) -> ((a, arrayJoin([[]])) IN (Null, [Null])), []);
|
||||
|
||||
SELECT * FROM system.one ARRAY JOIN arrayFilter((a) -> ((a, arrayJoin([])) IN (NULL)), []) AS arr_x; -- { serverError 43; }
|
||||
SELECT * FROM system.one ARRAY JOIN arrayFilter((a) -> ((a, arrayJoin([])) IN (NULL)), []) AS arr_x; -- { serverError 43 }
|
||||
SELECT * FROM numbers(1) LEFT ARRAY JOIN arrayFilter((x_0, x_1) -> (arrayJoin([]) IN (NULL)), [], []) AS arr_x;
|
||||
|
@ -1,7 +1,7 @@
|
||||
-- executeGeneric()
|
||||
SELECT range(1025, 1048576 + 9223372036854775807, 9223372036854775807);
|
||||
SELECT range(1025, 1048576 + (9223372036854775807 AS i), i);
|
||||
SELECT range(1025, 18446744073709551615, 1); -- { serverError 69; }
|
||||
SELECT range(1025, 18446744073709551615, 1); -- { serverError 69 }
|
||||
|
||||
-- executeConstStep()
|
||||
SELECT range(number, 1048576 + 9223372036854775807, 9223372036854775807) FROM system.numbers LIMIT 1 OFFSET 1025;
|
||||
|
@ -1,5 +1,3 @@
|
||||
SET allow_experimental_analyzer = 1;
|
||||
|
||||
DROP TABLE IF EXISTS columns_transformers;
|
||||
|
||||
CREATE TABLE columns_transformers (i Int64, j Int16, k Int64) Engine=TinyLog;
|
||||
@ -19,15 +17,15 @@ SELECT a.* APPLY(toDate) EXCEPT(i, j) APPLY(any) from columns_transformers a;
|
||||
SELECT * EXCEPT STRICT i from columns_transformers;
|
||||
SELECT * EXCEPT STRICT (i, j) from columns_transformers;
|
||||
SELECT * EXCEPT STRICT i, j1 from columns_transformers; -- { serverError 47 }
|
||||
SELECT * EXCEPT STRICT(i, j1) from columns_transformers; -- { serverError 36 }
|
||||
SELECT * EXCEPT STRICT(i, j1) from columns_transformers; -- { serverError NO_SUCH_COLUMN_IN_TABLE , BAD_ARGUMENTS }
|
||||
SELECT * REPLACE STRICT i + 1 AS i from columns_transformers;
|
||||
SELECT * REPLACE STRICT(i + 1 AS col) from columns_transformers; -- { serverError 36 }
|
||||
SELECT * REPLACE STRICT(i + 1 AS col) from columns_transformers; -- { serverError NO_SUCH_COLUMN_IN_TABLE, BAD_ARGUMENTS }
|
||||
SELECT * REPLACE(i + 1 AS i) APPLY(sum) from columns_transformers;
|
||||
SELECT columns_transformers.* REPLACE(j + 2 AS j, i + 1 AS i) APPLY(avg) from columns_transformers;
|
||||
SELECT columns_transformers.* REPLACE(j + 1 AS j, j + 2 AS j) APPLY(avg) from columns_transformers; -- { serverError 43 }
|
||||
-- REPLACE after APPLY will not match anything
|
||||
SELECT a.* APPLY(toDate) REPLACE(i + 1 AS i) APPLY(any) from columns_transformers a;
|
||||
SELECT a.* APPLY(toDate) REPLACE STRICT(i + 1 AS i) APPLY(any) from columns_transformers a; -- { serverError 36 }
|
||||
SELECT a.* APPLY(toDate) REPLACE STRICT(i + 1 AS i) APPLY(any) from columns_transformers a; -- { serverError NO_SUCH_COLUMN_IN_TABLE, BAD_ARGUMENTS }
|
||||
|
||||
EXPLAIN SYNTAX SELECT * APPLY(sum) from columns_transformers;
|
||||
EXPLAIN SYNTAX SELECT columns_transformers.* APPLY(avg) from columns_transformers;
|
||||
|
@ -7,16 +7,16 @@ insert into test1 values ('2020-09-01 00:01:02', 1), ('2020-09-01 20:01:03', 2),
|
||||
|
||||
set max_rows_to_read = 1;
|
||||
-- non-optimized
|
||||
select count() from test1 settings max_parallel_replicas = 3; -- { serverError 158; }
|
||||
select count() from test1 settings max_parallel_replicas = 3; -- { serverError 158 }
|
||||
-- optimized (toYear is monotonic and we provide the partition expr as is)
|
||||
select count() from test1 where toYear(toDate(p)) = 1999;
|
||||
-- non-optimized (toDate(DateTime) is always monotonic, but we cannot relaxing the predicates to do trivial count())
|
||||
select count() from test1 where p > toDateTime('2020-09-01 10:00:00'); -- { serverError 158; }
|
||||
select count() from test1 where p > toDateTime('2020-09-01 10:00:00'); -- { serverError 158 }
|
||||
-- optimized (partition expr wrapped with non-monotonic functions)
|
||||
select count() FROM test1 where toDate(p) = '2020-09-01' and sipHash64(toString(toDate(p))) % 2 = 1;
|
||||
select count() FROM test1 where toDate(p) = '2020-09-01' and sipHash64(toString(toDate(p))) % 2 = 0;
|
||||
-- non-optimized (some predicate depends on non-partition_expr columns)
|
||||
select count() FROM test1 where toDate(p) = '2020-09-01' and k = 2; -- { serverError 158; }
|
||||
select count() FROM test1 where toDate(p) = '2020-09-01' and k = 2; -- { serverError 158 }
|
||||
-- optimized
|
||||
select count() from test1 where toDate(p) > '2020-09-01';
|
||||
-- non-optimized
|
||||
@ -35,10 +35,10 @@ select count() from test_tuple where i > 2;
|
||||
-- optimized
|
||||
select count() from test_tuple where i < 1;
|
||||
-- non-optimized
|
||||
select count() from test_tuple array join [p,p] as c where toDate(p) = '2020-09-01'; -- { serverError 158; }
|
||||
select count() from test_tuple array join [p,p] as c where toDate(p) = '2020-09-01'; -- { serverError 158 }
|
||||
select count() from test_tuple array join [1,2] as c where toDate(p) = '2020-09-01' settings max_rows_to_read = 4;
|
||||
-- non-optimized
|
||||
select count() from test_tuple array join [1,2,3] as c where toDate(p) = '2020-09-01'; -- { serverError 158; }
|
||||
select count() from test_tuple array join [1,2,3] as c where toDate(p) = '2020-09-01'; -- { serverError 158 }
|
||||
select count() from test_tuple array join [1,2,3] as c where toDate(p) = '2020-09-01' settings max_rows_to_read = 6;
|
||||
|
||||
create table test_two_args(i int, j int, k int) engine MergeTree partition by i + j order by k settings index_granularity = 1;
|
||||
@ -48,7 +48,7 @@ insert into test_two_args values (1, 2, 3), (2, 1, 3), (0, 3, 4);
|
||||
-- optimized
|
||||
select count() from test_two_args where i + j = 3;
|
||||
-- non-optimized
|
||||
select count() from test_two_args where i = 1; -- { serverError 158; }
|
||||
select count() from test_two_args where i = 1; -- { serverError 158 }
|
||||
|
||||
drop table test1;
|
||||
drop table test_tuple;
|
||||
|
@ -13,9 +13,9 @@ set max_memory_usage='500M';
|
||||
set max_threads=1;
|
||||
set max_block_size=500;
|
||||
|
||||
select key, groupArray(repeat('a', 200)), count() from data_01513 group by key format Null settings optimize_aggregation_in_order=0; -- { serverError 241; }
|
||||
select key, groupArray(repeat('a', 200)), count() from data_01513 group by key format Null settings optimize_aggregation_in_order=0; -- { serverError 241 }
|
||||
select key, groupArray(repeat('a', 200)), count() from data_01513 group by key format Null settings optimize_aggregation_in_order=1;
|
||||
-- for WITH TOTALS previous groups should be kept.
|
||||
select key, groupArray(repeat('a', 200)), count() from data_01513 group by key with totals format Null settings optimize_aggregation_in_order=1; -- { serverError 241; }
|
||||
select key, groupArray(repeat('a', 200)), count() from data_01513 group by key with totals format Null settings optimize_aggregation_in_order=1; -- { serverError 241 }
|
||||
|
||||
drop table data_01513;
|
||||
|
@ -35,7 +35,7 @@ ATTACH TABLE primary_key_test(v1 Int32, v2 Int32) ENGINE=ReplacingMergeTree ORDE
|
||||
SELECT * FROM primary_key_test FINAL;
|
||||
DROP TABLE primary_key_test;
|
||||
|
||||
CREATE TABLE primary_key_test(v1 Int64, v2 Int32, v3 String, PRIMARY KEY(v1, gcd(v1, v2))) ENGINE=ReplacingMergeTree ORDER BY v1; -- { serverError 36; }
|
||||
CREATE TABLE primary_key_test(v1 Int64, v2 Int32, v3 String, PRIMARY KEY(v1, gcd(v1, v2))) ENGINE=ReplacingMergeTree ORDER BY v1; -- { serverError 36 }
|
||||
|
||||
CREATE TABLE primary_key_test(v1 Int64, v2 Int32, v3 String, PRIMARY KEY(v1, gcd(v1, v2))) ENGINE=ReplacingMergeTree ORDER BY (v1, gcd(v1, v2));
|
||||
|
||||
|
@ -5,7 +5,7 @@ create table dist_01528 as system.one engine=Distributed('test_cluster_two_shard
|
||||
|
||||
set optimize_skip_unused_shards=1;
|
||||
set force_optimize_skip_unused_shards=1;
|
||||
select * from dist_01528 where dummy = 2; -- { serverError 507; }
|
||||
select * from dist_01528 where dummy = 2; -- { serverError 507 }
|
||||
select * from dist_01528 where dummy = 2 settings allow_nondeterministic_optimize_skip_unused_shards=1;
|
||||
|
||||
drop table dist_01528;
|
||||
|
@ -30,7 +30,7 @@ create table db_01530_atomic.data (key Int) Engine=ReplicatedMergeTree('/clickho
|
||||
drop database db_01530_atomic;
|
||||
|
||||
create database db_01530_atomic Engine=Atomic;
|
||||
create table db_01530_atomic.data (key Int) Engine=ReplicatedMergeTree('/clickhouse/tables/{database}/db_01530_atomic/data', 'test') order by key; -- { serverError 253; }
|
||||
create table db_01530_atomic.data (key Int) Engine=ReplicatedMergeTree('/clickhouse/tables/{database}/db_01530_atomic/data', 'test') order by key; -- { serverError 253 }
|
||||
|
||||
set database_atomic_wait_for_drop_and_detach_synchronously=1;
|
||||
|
||||
|
@ -17,7 +17,7 @@ create table dist_01555 (key Int) Engine=Distributed(test_cluster_with_incorrect
|
||||
|
||||
insert into dist_01555 values (1)(2);
|
||||
-- since test_cluster_with_incorrect_pw contains incorrect password ignore error
|
||||
system flush distributed dist_01555; -- { serverError 516; }
|
||||
system flush distributed dist_01555; -- { serverError 516 }
|
||||
select length(splitByChar('*', data_path)), replaceRegexpOne(data_path, '^.*/([^/]*)/' , '\\1'), extract(last_exception, 'AUTHENTICATION_FAILED'), dateDiff('s', last_exception_time, now()) < 5 from system.distribution_queue where database = currentDatabase() and table = 'dist_01555' format CSV;
|
||||
|
||||
drop table dist_01555;
|
||||
|
@ -1 +1 @@
|
||||
select toUnixTimestamp(today()); -- { serverError 44; }
|
||||
select toUnixTimestamp(today()); -- { serverError 44 }
|
||||
|
@ -25,5 +25,5 @@ select countMatchesCaseInsensitive('foo.com BAR.COM baz.com bam.com', '([^. ]+)\
|
||||
select countMatchesCaseInsensitive('foo.com@foo.com bar.com@foo.com BAZ.com@foo.com bam.com@foo.com', '([^. ]+)\.([^. ]+)@([^. ]+)\.([^. ]+)');
|
||||
|
||||
select 'errors';
|
||||
select countMatches(1, 'foo') from numbers(1); -- { serverError 43; }
|
||||
select countMatches('foobarfoo', toString(number)) from numbers(1); -- { serverError 44; }
|
||||
select countMatches(1, 'foo') from numbers(1); -- { serverError 43 }
|
||||
select countMatches('foobarfoo', toString(number)) from numbers(1); -- { serverError 44 }
|
||||
|
@ -7,6 +7,6 @@ insert into data_01709 values (2);
|
||||
|
||||
optimize table data_01709 final;
|
||||
|
||||
insert into data_01709 values (3); -- { serverError 252; }
|
||||
insert into data_01709 values (3); -- { serverError 252 }
|
||||
|
||||
drop table data_01709;
|
||||
|
@ -4,6 +4,6 @@ create table t (x UInt32) engine = MergeTree order by tuple() settings index_gra
|
||||
insert into t select number from numbers(100);
|
||||
alter table t add projection p (select uniqHLL12(x));
|
||||
insert into t select number + 100 from numbers(100);
|
||||
select uniqHLL12(x) from t settings allow_experimental_projection_optimization = 1, max_bytes_to_read=400, max_block_size=8; -- { serverError 307; }
|
||||
select uniqHLL12(x) from t settings allow_experimental_projection_optimization = 1, max_bytes_to_read=400, max_block_size=8; -- { serverError 307 }
|
||||
|
||||
drop table if exists t;
|
||||
|
@ -1,10 +1,10 @@
|
||||
select toInt64('--1'); -- { serverError 72; }
|
||||
select toInt64('+-1'); -- { serverError 72; }
|
||||
select toInt64('++1'); -- { serverError 72; }
|
||||
select toInt64('++'); -- { serverError 72; }
|
||||
select toInt64('+'); -- { serverError 72; }
|
||||
select toInt64('1+1'); -- { serverError 6; }
|
||||
select toInt64('1-1'); -- { serverError 6; }
|
||||
select toInt64(''); -- { serverError 32; }
|
||||
select toInt64('--1'); -- { serverError 72 }
|
||||
select toInt64('+-1'); -- { serverError 72 }
|
||||
select toInt64('++1'); -- { serverError 72 }
|
||||
select toInt64('++'); -- { serverError 72 }
|
||||
select toInt64('+'); -- { serverError 72 }
|
||||
select toInt64('1+1'); -- { serverError 6 }
|
||||
select toInt64('1-1'); -- { serverError 6 }
|
||||
select toInt64(''); -- { serverError 32 }
|
||||
select toInt64('1');
|
||||
select toInt64('-1');
|
||||
|
@ -19,7 +19,7 @@ INSERT INTO test02008 VALUES (tuple(3.3, 5.5, 6.6));
|
||||
SELECT untuple(arrayJoin(tupleToNameValuePairs(col))) from test02008;
|
||||
|
||||
DROP TABLE IF EXISTS test02008;
|
||||
SELECT tupleToNameValuePairs(tuple(1, 1.3)); -- { serverError 43; }
|
||||
SELECT tupleToNameValuePairs(tuple(1, [1,2])); -- { serverError 43; }
|
||||
SELECT tupleToNameValuePairs(tuple(1, 'a')); -- { serverError 43; }
|
||||
SELECT tupleToNameValuePairs(33); -- { serverError 43; }
|
||||
SELECT tupleToNameValuePairs(tuple(1, 1.3)); -- { serverError 43 }
|
||||
SELECT tupleToNameValuePairs(tuple(1, [1,2])); -- { serverError 43 }
|
||||
SELECT tupleToNameValuePairs(tuple(1, 'a')); -- { serverError 43 }
|
||||
SELECT tupleToNameValuePairs(33); -- { serverError 43 }
|
||||
|
@ -1,10 +1,21 @@
|
||||
-- {echo}
|
||||
SELECT sqrt(-1) as x, not(x), not(not(x)), (not(x)) IS NULL SETTINGS allow_experimental_analyzer=1;
|
||||
nan 0 1 0
|
||||
SELECT sqrt(-1) as x, not(x), not(not(x)), (not(x)) IS NULL SETTINGS allow_experimental_analyzer=0;
|
||||
nan 0 1 0
|
||||
SELECT -inf as x, not(x), not(not(x)), (not(x)) IS NULL SETTINGS allow_experimental_analyzer=1;
|
||||
-inf 0 1 0
|
||||
SELECT -inf as x, not(x), not(not(x)), (not(x)) IS NULL SETTINGS allow_experimental_analyzer=0;
|
||||
-inf 0 1 0
|
||||
SELECT NULL as x, not(x), not(not(x)), (not(x)) IS NULL SETTINGS allow_experimental_analyzer=1;
|
||||
\N \N \N 1
|
||||
SELECT NULL as x, not(x), not(not(x)), (not(x)) IS NULL SETTINGS allow_experimental_analyzer=0;
|
||||
\N \N \N 1
|
||||
SELECT inf as x, not(x), not(not(x)), (not(x)) IS NULL SETTINGS allow_experimental_analyzer=1;
|
||||
inf 0 1 0
|
||||
SELECT inf as x, not(x), not(not(x)), (not(x)) IS NULL SETTINGS allow_experimental_analyzer=0;
|
||||
inf 0 1 0
|
||||
SELECT nan as x, not(x), not(not(x)), (not(x)) IS NULL SETTINGS allow_experimental_analyzer=1;
|
||||
nan 0 1 0
|
||||
SELECT nan as x, not(x), not(not(x)), (not(x)) IS NULL SETTINGS allow_experimental_analyzer=0;
|
||||
nan 0 1 0
|
||||
|
Loading…
Reference in New Issue
Block a user