Skip to content

Logical error: 'Inconsistent AST formatting in Subquery: the query: (STID: 1941-1bfa) #91735

@maxknv

Description

@maxknv

Important: This issue was automatically created and is used by CI. Do not modify the issue title. Do not remove issue labels.

CI report: BuzzHouse (amd_debug)
CIDB statistics: cidb

Test output:

Error:
Logical error: 'Inconsistent AST formatting in Subquery: the query:
INSERT INTO TABLE FUNCTION file('/var/lib/clickhouse/user_files/query.data', 'CSV') SELECT * FROM (WITH `t1d0`.`c0`[0] AS `a3`, cte0d0 AS (SELECT `c0`, `c1`, `c2` FROM (((WITH cte0d3 AS (SELECT `c0`, ...
Formatted as:
INSERT INTO FUNCTION file('/var/lib/clickhouse/user_files/query.data', 'CSV') SETTINGS output_format_write_statistics = 0 SELECT * FROM (WITH t1d0.c0[0] AS a3, cte0d0 AS (SELECT c0, c1, c2 FROM (((WIT...
                    w0 AS (PARTITION BY NOT JSONAllPaths(t1d2.c0), (SELECT tupleMinus(CAST('6656362483621008671', 'Int256'), NULL) FROM t22 AS t0d3 FINAL) ORDER BY t1d2.c0 ASC, t1d2.c0 DESC NULLS LAST...
                    w1 AS (ORDER BY t0d2.c0.c0 ASC NULLS LAST))) (c0, c1, c2)) SELECT match('😂', CAST([CAST('(-3732493315392836667,-341125895)', 'Geometry'), CAST('3829507825574332400', 'Int128'), map...
Was parsed and formatted back as:
INSERT INTO FUNCTION file('/var/lib/clickhouse/user_files/query.data', 'CSV') SETTINGS output_format_write_statistics = 0 SELECT * FROM (WITH t1d0.c0[0] AS a3, cte0d0 AS (SELECT c0, c1, c2 FROM (((WIT...
                    w0 AS (PARTITION BY NOT JSONAllPaths(t1d2.c0), (SELECT tupleMinus(CAST('6656362483621008671', 'Int256'), NULL) FROM t22 AS t0d3 FINAL) ORDER BY t1d2.c0 ASC, t1d2.c0 DESC NULLS LAST...
                    w1 AS (ORDER BY t0d2.c0.c0 ASC NULLS LAST))) (c0, c1, c2)) SELECT match('😂', CAST([CAST('(-3732493315392836667,-341125895)', 'Geometry'), CAST('3829507825574332400', 'Int128'), map...
---

Failed query:
SELECT * FROM (WITH t1d0.c0[0] AS a3, cte0d0 AS (SELECT c0, c1, c2 FROM (((WITH cte0d3 AS (SELECT c0, c1, c2 FROM (SELECT extractTextFromHTML(a7 AS a8) AS a9, a7, [a8] AS a10 FROM (SELECT c0, c1 FROM ...
---

Stack trace:
__pthread_kill @ 0x00000000000969fd
gsignal @ 0x0000000000042476
__lgamma_r_finite@GLIBC_2.15 @ 0x00000000000287f3
src/Common/Exception.cpp:54: DB::abortOnFailedAssertion(String const&, std::basic_string_view<char, std::char_traits<char>>, void* const*, unsigned long, unsigned long) @ 0x00000000155c871a
src/Common/Exception.cpp:87: DB::handle_error_code(String const&, std::basic_string_view<char, std::char_traits<char>>, int, bool, std::vector<void*, std::allocator<void*>> const&) @ 0x00000000155c953...
src/Common/Exception.cpp:138: DB::Exception::Exception(DB::Exception::MessageMasked&&, int, bool) @ 0x00000000155c9865
src/Common/Exception.h:123: DB::Exception::Exception(String&&, int, String, bool) @ 0x000000000d30044e
src/Common/Exception.h:58: DB::Exception::Exception(PreformattedMessage&&, int) @ 0x000000000d2fff91
src/Common/Exception.h:141: DB::Exception::Exception<String, std::basic_string_view<char, std::char_traits<char>>&, String&, String&>(int, FormatStringHelperImpl<std::type_identity<String>::type, std:...
src/Interpreters/executeQuery.cpp:1284: DB::executeQueryImpl(char const*, char const*, std::shared_ptr<DB::Context>, DB::QueryFlags, DB::QueryProcessingStage::Enum, std::unique_ptr<DB::ReadBuffer, std...
src/Interpreters/executeQuery.cpp:1967: DB::executeQuery(String const&, std::shared_ptr<DB::Context>, DB::QueryFlags, DB::QueryProcessingStage::Enum) @ 0x000000001ba1d392
src/Server/TCPHandler.cpp:777: DB::TCPHandler::runImpl() @ 0x000000001ef0fd6a
src/Server/TCPHandler.cpp:2873: DB::TCPHandler::run() @ 0x000000001ef2a9e4
base/poco/Net/src/TCPServerConnection.cpp:40: Poco::Net::TCPServerConnection::start() @ 0x00000000251dfdc7
base/poco/Net/src/TCPServerDispatcher.cpp:115: Poco::Net::TCPServerDispatcher::run() @ 0x00000000251e03a5
base/poco/Foundation/src/ThreadPool.cpp:205: Poco::PooledThread::run() @ 0x000000002517da7f
base/poco/Foundation/src/Thread_POSIX.cpp:341: Poco::ThreadImpl::runnableEntry(void*) @ 0x000000002517b211
start_thread @ 0x0000000000094ac3
__clone3 @ 0x00000000001268c0

Metadata

Metadata

Assignees

No one assigned

    Labels

    fuzzProblem found by one of the fuzzerstestingSpecial issue with list of bugs found by CI

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions