mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-12-01 12:01:58 +00:00
Merge pull request #12522 from ClickHouse/aku/std-logic-error
Abort on std::logic_error in debug builds
This commit is contained in:
commit
232cd2648f
@ -47,6 +47,10 @@ void MarkTableIdentifiersMatcher::visit(const ASTFunction & func, ASTPtr &, Data
|
|||||||
// First argument of dictGet can be a dictionary name, perhaps with a database.
|
// First argument of dictGet can be a dictionary name, perhaps with a database.
|
||||||
if (functionIsJoinGet(func.name) || functionIsDictGet(func.name))
|
if (functionIsJoinGet(func.name) || functionIsDictGet(func.name))
|
||||||
{
|
{
|
||||||
|
if (func.arguments->children.empty())
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
auto & ast = func.arguments->children.at(0);
|
auto & ast = func.arguments->children.at(0);
|
||||||
auto opt_name = tryGetIdentifierName(ast);
|
auto opt_name = tryGetIdentifierName(ast);
|
||||||
if (opt_name && !data.aliases.count(*opt_name))
|
if (opt_name && !data.aliases.count(*opt_name))
|
||||||
|
@ -313,6 +313,18 @@ void TCPHandler::runImpl()
|
|||||||
state.io.onException();
|
state.io.onException();
|
||||||
exception.emplace(Exception::CreateFromPocoTag{}, e);
|
exception.emplace(Exception::CreateFromPocoTag{}, e);
|
||||||
}
|
}
|
||||||
|
// Server should die on std logic errors in debug, like with assert()
|
||||||
|
// or ErrorCodes::LOGICAL_ERROR. This helps catch these errors in
|
||||||
|
// tests.
|
||||||
|
#ifndef NDEBUG
|
||||||
|
catch (const std::logic_error & e)
|
||||||
|
{
|
||||||
|
state.io.onException();
|
||||||
|
exception.emplace(Exception::CreateFromSTDTag{}, e);
|
||||||
|
sendException(*exception, send_exception_with_stack_trace);
|
||||||
|
std::abort();
|
||||||
|
}
|
||||||
|
#endif
|
||||||
catch (const std::exception & e)
|
catch (const std::exception & e)
|
||||||
{
|
{
|
||||||
state.io.onException();
|
state.io.onException();
|
||||||
|
Loading…
Reference in New Issue
Block a user