-
Notifications
You must be signed in to change notification settings - Fork 8.3k
Case sensitive NOT scenario(Unknown function NOT) #12262
Copy link
Copy link
Closed
Labels
bugConfirmed user-visible misbehaviour in official releaseConfirmed user-visible misbehaviour in official releasecomp-sql-syntaxSQL/grammar parsing, AST nodes, syntax-level features.SQL/grammar parsing, AST nodes, syntax-level features.
Description
Describe the bug
Note that if I write query in CAPS it is not working, but when I write in lowercase it works and rewrites canonical query to CAPS with additional brackets. This query also works.
How to reproduce
qoega-qyp.sas.yp-c.yandex.net :) SELECT 1 WHERE 10 != NOT ( NOT 10);
SELECT 1
WHERE 10 != NOT(NOT 10)
Received exception from server (version 20.6.1):
Code: 46. DB::Exception: Received from localhost:9000. DB::Exception: Unknown function NOT. Maybe you meant: ['not','now'].
0 rows in set. Elapsed: 0.060 sec.
SELECT 1 WHERE 10 != not ( not 10);
SELECT 1
WHERE 10 != (NOT (NOT 10))
┌─1─┐
│ 1 │
└───┘
1 rows in set. Elapsed: 0.005 sec.
qoega-qyp.sas.yp-c.yandex.net :) SELECT 1 WHERE 10 != not ( not 10);
SELECT 1
WHERE 10 != (NOT (NOT 10))
┌─1─┐
│ 1 │
└───┘
qoega-qyp.sas.yp-c.yandex.net :) SELECT 1 WHERE 10 != (NOT ( NOT 10));
SELECT 1
WHERE 10 != (NOT (NOT 10))
┌─1─┐
│ 1 │
└───┘
1 rows in set. Elapsed: 0.004 sec.Error message and/or stacktrace
: ['not','now'] (version 20.6.1.1) (from [::1]:48482) (in query: SELECT 1 WHERE 10 != NOT(NOT 10)), Stack trace (when copying this message, always include the lines below):
0. /build/obj-x86_64-linux-gnu/../contrib/libcxx/include/exception:129: Poco::Exception::Exception(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, int) @ 0x21a1a799 in /home/qoega/docker-ch/output/binary/clickhouse
1. /build/obj-x86_64-linux-gnu/../src/Common/Exception.cpp:38: DB::Exception::Exception(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, int) @ 0xb49785e in /home/qoega/docker-ch/output/binary/clickhouse
2. /build/obj-x86_64-linux-gnu/../src/Functions/FunctionFactory.cpp:51: DB::FunctionFactory::getImpl(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, DB::Context const&) const @ 0x18edbf6e in /home/qoega/docker-ch/output/binary/clickhouse
3. /build/obj-x86_64-linux-gnu/../contrib/libcxx/include/new:253: DB::FunctionFactory::get(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, DB::Context const&) const @ 0x18edcac7 in /home/qoega/docker-ch/output/binary/clickhouse
4. /build/obj-x86_64-linux-gnu/../contrib/libcxx/include/memory:4081: DB::ActionsMatcher::visit(DB::ASTFunction const&, std::__1::shared_ptr<DB::IAST> const&, DB::ActionsMatcher::Data&) @ 0x1a33aa41 in /home/qoega/docker-ch/output/binary/clickhouse
5. /build/obj-x86_64-linux-gnu/../src/Interpreters/ActionsVisitor.cpp:310: DB::ActionsMatcher::visit(DB::ASTFunction const&, std::__1::shared_ptr<DB::IAST> const&, DB::ActionsMatcher::Data&) @ 0x1a33bbe4 in /home/qoega/docker-ch/output/binary/clickhouse
6. /build/obj-x86_64-linux-gnu/../contrib/libcxx/include/memory:3826: DB::InDepthNodeVisitor<DB::ActionsMatcher, true, std::__1::shared_ptr<DB::IAST> const>::visit(std::__1::shared_ptr<DB::IAST> const&) @ 0x1a31b49a in /home/qoega/docker-ch/output/binary/clickhouse
7. /build/obj-x86_64-linux-gnu/../src/Interpreters/ExpressionAnalyzer.cpp:0: DB::ExpressionAnalyzer::getRootActions(std::__1::shared_ptr<DB::IAST> const&, bool, std::__1::shared_ptr<DB::ExpressionActions>&, bool) @ 0x1a2fd01c in /home/qoega/docker-ch/output/binary/clickhouse
8. /build/obj-x86_64-linux-gnu/../contrib/libcxx/include/memory:4206: DB::SelectQueryExpressionAnalyzer::appendWhere(DB::ExpressionActionsChain&, bool) @ 0x1a306b04 in /home/qoega/docker-ch/output/binary/clickhouse
9. /build/obj-x86_64-linux-gnu/../src/Interpreters/ExpressionAnalyzer.cpp:0: DB::ExpressionAnalysisResult::ExpressionAnalysisResult(DB::SelectQueryExpressionAnalyzer&, std::__1::shared_ptr<DB::StorageInMemoryMetadata const> const&, bool, bool, bool, std::__1::shared_ptr<DB::FilterInfo> const&, DB::Block const&) @ 0x1a314443 in /home/qoega/docker-ch/output/binary/clickhouse
10. /build/obj-x86_64-linux-gnu/../src/Interpreters/InterpreterSelectQuery.cpp:505: DB::InterpreterSelectQuery::getSampleBlockImpl() @ 0x19f32c01 in /home/qoega/docker-ch/output/binary/clickhouse
11. /build/obj-x86_64-linux-gnu/../src/Interpreters/InterpreterSelectQuery.cpp:402: DB::InterpreterSelectQuery::InterpreterSelectQuery(std::__1::shared_ptr<DB::IAST> const&, DB::Context const&, std::__1::shared_ptr<DB::IBlockInputStream> const&, std::__1::optional<DB::Pipe>, std::__1::shared_ptr<DB::IStorage> const&, DB::SelectQueryOptions const&, std::__1::vector<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::allocator<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > > const&, std::__1::shared_ptr<DB::StorageInMemoryMetadata const> const&)::$_2::operator()(bool) const @ 0x19f27842 in /home/qoega/docker-ch/output/binary/clickhouse
12. /build/obj-x86_64-linux-gnu/../src/Interpreters/InterpreterSelectQuery.cpp:0: DB::InterpreterSelectQuery::InterpreterSelectQuery(std::__1::shared_ptr<DB::IAST> const&, DB::Context const&, std::__1::shared_ptr<DB::IBlockInputStream> const&, std::__1::optional<DB::Pipe>, std::__1::shared_ptr<DB::IStorage> const&, DB::SelectQueryOptions const&, std::__1::vector<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::allocator<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > > const&, std::__1::shared_ptr<DB::StorageInMemoryMetadata const> const&) @ 0x19f1c15d in /home/qoega/docker-ch/output/binary/clickhouse
13. /build/obj-x86_64-linux-gnu/../src/Interpreters/InterpreterSelectQuery.cpp:146: DB::InterpreterSelectQuery::InterpreterSelectQuery(std::__1::shared_ptr<DB::IAST> const&, DB::Context const&, DB::SelectQueryOptions const&, std::__1::vector<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::allocator<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > > const&) @ 0x19f189b6 in /home/qoega/docker-ch/output/binary/clickhouse
14. /build/obj-x86_64-linux-gnu/../contrib/libcxx/include/memory:0: DB::InterpreterSelectWithUnionQuery::InterpreterSelectWithUnionQuery(std::__1::shared_ptr<DB::IAST> const&, DB::Context const&, DB::SelectQueryOptions const&, std::__1::vector<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::allocator<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > > const&) @ 0x1a3734a2 in /home/qoega/docker-ch/output/binary/clickhouse
15. /build/obj-x86_64-linux-gnu/../contrib/libcxx/include/memory:3028: DB::InterpreterFactory::get(std::__1::shared_ptr<DB::IAST>&, DB::Context&, DB::QueryProcessingStage::Enum) @ 0x19e07e4f in /home/qoega/docker-ch/output/binary/clickhouse
16. /build/obj-x86_64-linux-gnu/../src/Interpreters/executeQuery.cpp:0: DB::executeQueryImpl(char const*, char const*, DB::Context&, bool, DB::QueryProcessingStage::Enum, bool, DB::ReadBuffer*) @ 0x1a67d40e in /home/qoega/docker-ch/output/binary/clickhouse
17. /build/obj-x86_64-linux-gnu/../src/Interpreters/executeQuery.cpp:644: DB::executeQuery(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, DB::Context&, bool, DB::QueryProcessingStage::Enum, bool) @ 0x1a67ab36 in /home/qoega/docker-ch/output/binary/clickhouse
18. /build/obj-x86_64-linux-gnu/../src/Server/TCPHandler.cpp:0: DB::TCPHandler::runImpl() @ 0x1b4b2a94 in /home/qoega/docker-ch/output/binary/clickhouse
19. /build/obj-x86_64-linux-gnu/../src/Server/TCPHandler.cpp:0: DB::TCPHandler::run() @ 0x1b4cf12b in /home/qoega/docker-ch/output/binary/clickhouse
20. /build/obj-x86_64-linux-gnu/../contrib/poco/Net/src/TCPServerConnection.cpp:57: Poco::Net::TCPServerConnection::start() @ 0x2187043f in /home/qoega/docker-ch/output/binary/clickhouse
21. /build/obj-x86_64-linux-gnu/../contrib/libcxx/include/atomic:1036: Poco::Net::TCPServerDispatcher::run() @ 0x21871142 in /home/qoega/docker-ch/output/binary/clickhouse
22. /build/obj-x86_64-linux-gnu/../contrib/poco/Foundation/src/ThreadPool.cpp:0: Poco::PooledThread::run() @ 0x21b3f496 in /home/qoega/docker-ch/output/binary/clickhouse
23. /build/obj-x86_64-linux-gnu/../contrib/poco/Foundation/src/Thread_POSIX.cpp:0: Poco::ThreadImpl::runnableEntry(void*) @ 0x21b3966e in /home/qoega/docker-ch/output/binary/clickhouse
24. start_thread @ 0x76db in /lib/x86_64-linux-gnu/libpthread-2.27.so
25. /build/glibc-OTsEL5/glibc-2.27/misc/../sysdeps/unix/sysv/linux/x86_64/clone.S:97: __GI___clone @ 0x12188f in /usr/lib/debug/lib/x86_64-linux-gnu/libc-2.27.so
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugConfirmed user-visible misbehaviour in official releaseConfirmed user-visible misbehaviour in official releasecomp-sql-syntaxSQL/grammar parsing, AST nodes, syntax-level features.SQL/grammar parsing, AST nodes, syntax-level features.