Skip to content

More inconsistent AST formatting #85075

@PedroTadim

Description

@PedroTadim

Describe the bug

Easy to reproduce, cc @alexey-milovidov

How to reproduce

Run:

SELECT position(1 = ANY(SELECT 1), 1);

Error message and/or stacktrace

Stack trace:

<Fatal> : Logical error: 'Inconsistent AST formatting: the query:
SELECT position(1 IN (SELECT 1), 1)
cannot parse query back from SELECT position(1 = ANY(SELECT 1), 1);'.
<Fatal> : Stack trace (when copying this message, always include the lines below):

0. contrib/llvm-project/libcxx/include/__exception/exception.h:113: Poco::Exception::Exception(String const&, int) @ 0x00000000265ff8f2
1. src/Common/Exception.cpp:116: DB::Exception::Exception(DB::Exception::MessageMasked&&, int, bool) @ 0x00000000140b8866
2. src/Common/Exception.h:119: DB::Exception::Exception(PreformattedMessage&&, int) @ 0x000000000cda15ac
3. src/Common/Exception.h:137: DB::Exception::Exception<String&, std::basic_string_view<char, std::char_traits<char>>>(int, FormatStringHelperImpl<std::type_identity<String&>::type, std::type_identity<std::basic_string_view<char, std::char_traits<char>>>::type>, String&, std::basic_string_view<char, std::char_traits<char>>&&) @ 0x000000001b33b276
4. src/Interpreters/executeQuery.cpp:1096: DB::executeQueryImpl(char const*, char const*, std::shared_ptr<DB::Context>, DB::QueryFlags, DB::QueryProcessingStage::Enum, std::unique_ptr<DB::ReadBuffer, std::default_delete<DB::ReadBuffer>>&, std::shared_ptr<DB::IAST>&, std::shared_ptr<DB::ImplicitTransactionControlExecutor>) @ 0x000000001b332daf
5. src/Interpreters/executeQuery.cpp:1770: DB::executeQuery(String const&, std::shared_ptr<DB::Context>, DB::QueryFlags, DB::QueryProcessingStage::Enum) @ 0x000000001b32a385
6. src/Server/TCPHandler.cpp:739: DB::TCPHandler::runImpl() @ 0x000000001e5c380f
7. src/Server/TCPHandler.cpp:2740: DB::TCPHandler::run() @ 0x000000001e5dd6a4
8. base/poco/Net/src/TCPServerConnection.cpp:40: Poco::Net::TCPServerConnection::start() @ 0x00000000266b61c7
9. base/poco/Net/src/TCPServerDispatcher.cpp:115: Poco::Net::TCPServerDispatcher::run() @ 0x00000000266b67a5
10. base/poco/Foundation/src/ThreadPool.cpp:205: Poco::PooledThread::run() @ 0x000000002665597f
11. base/poco/Foundation/src/Thread_POSIX.cpp:341: Poco::ThreadImpl::runnableEntry(void*) @ 0x0000000026653051
12. start_thread @ 0x00000000000a27f1
13. __clone3 @ 0x0000000000133c9c

Metadata

Metadata

Assignees

Labels

fuzzProblem found by one of the fuzzers

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions