Skip to content

Logical error: 'Table function 'values' must have arguments'. #43331

@Algunenano

Description

@Algunenano

Sending an incorrect query (missing the table types):

$ clickhouse client --query "SELECT * FROM VALUES    (1)
    (2)
    (3)"
Received exception from server (version 22.10.2):
Code: 49. DB::Exception: Received from localhost:9000. DB::Exception: Table function 'values' must have arguments. (LOGICAL_ERROR)
(query: SELECT * FROM VALUES    (1)
    (2)
    (3))
2022.11.17 16:04:23.000709 [ 247143 ] {22b0298f-51eb-49c9-8100-d2e1cd9c4bfa} <Error> executeQuery: Code: 49. DB::Exception: Table function 'values' must have arguments. (LOGICAL_ERROR) (version 22.10.2.11 (official build)) (from [::ffff:127.0.0.1]:49124) (in query: SELECT * FROM VALUES (1) (2) (3)), Stack trace (when copying this message, always include the lines below):

0. DB::Exception::Exception(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, int, bool) @ 0xce3f77a in /mnt/ch/official_binaries/clickhouse-common-static-22.10.2.11/usr/bin/clickhouse
1. DB::TableFunctionValues::parseArguments(std::__1::shared_ptr<DB::IAST> const&, std::__1::shared_ptr<DB::Context const>) @ 0x111ad823 in /mnt/ch/official_binaries/clickhouse-common-static-22.10.2.11/usr/bin/clickhouse
2. DB::TableFunctionFactory::get(std::__1::shared_ptr<DB::IAST> const&, std::__1::shared_ptr<DB::Context const>) const @ 0x11494e47 in /mnt/ch/official_binaries/clickhouse-common-static-22.10.2.11/usr/bin/clickhouse
3. DB::Context::executeTableFunction(std::__1::shared_ptr<DB::IAST> const&) @ 0x11f01bc0 in /mnt/ch/official_binaries/clickhouse-common-static-22.10.2.11/usr/bin/clickhouse
4. DB::JoinedTables::getLeftTableStorage() @ 0x126aae90 in /mnt/ch/official_binaries/clickhouse-common-static-22.10.2.11/usr/bin/clickhouse
5. DB::InterpreterSelectQuery::InterpreterSelectQuery(std::__1::shared_ptr<DB::IAST> const&, std::__1::shared_ptr<DB::Context> 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&, std::__1::shared_ptr<DB::PreparedSets>) @ 0x125d5a32 in /mnt/ch/official_binaries/clickhouse-common-static-22.10.2.11/usr/bin/clickhouse
6. DB::InterpreterSelectWithUnionQuery::buildCurrentChildInterpreter(std::__1::shared_ptr<DB::IAST> 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&) @ 0x126715c2 in /mnt/ch/official_binaries/clickhouse-common-static-22.10.2.11/usr/bin/clickhouse
7. DB::InterpreterSelectWithUnionQuery::InterpreterSelectWithUnionQuery(std::__1::shared_ptr<DB::IAST> const&, std::__1::shared_ptr<DB::Context>, 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&) @ 0x1266f340 in /mnt/ch/official_binaries/clickhouse-common-static-22.10.2.11/usr/bin/clickhouse
8. DB::InterpreterFactory::get(std::__1::shared_ptr<DB::IAST>&, std::__1::shared_ptr<DB::Context>, DB::SelectQueryOptions const&) @ 0x125969fe in /mnt/ch/official_binaries/clickhouse-common-static-22.10.2.11/usr/bin/clickhouse
9. ? @ 0x12979320 in /mnt/ch/official_binaries/clickhouse-common-static-22.10.2.11/usr/bin/clickhouse
10. DB::executeQuery(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::shared_ptr<DB::Context>, bool, DB::QueryProcessingStage::Enum) @ 0x12976c0d in /mnt/ch/official_binaries/clickhouse-common-static-22.10.2.11/usr/bin/clickhouse
11. DB::TCPHandler::runImpl() @ 0x1353dd04 in /mnt/ch/official_binaries/clickhouse-common-static-22.10.2.11/usr/bin/clickhouse
12. DB::TCPHandler::run() @ 0x13551cf9 in /mnt/ch/official_binaries/clickhouse-common-static-22.10.2.11/usr/bin/clickhouse
13. Poco::Net::TCPServerConnection::start() @ 0x1636274f in /mnt/ch/official_binaries/clickhouse-common-static-22.10.2.11/usr/bin/clickhouse
14. Poco::Net::TCPServerDispatcher::run() @ 0x16364adb in /mnt/ch/official_binaries/clickhouse-common-static-22.10.2.11/usr/bin/clickhouse
15. Poco::PooledThread::run() @ 0x16520372 in /mnt/ch/official_binaries/clickhouse-common-static-22.10.2.11/usr/bin/clickhouse
16. Poco::ThreadImpl::runnableEntry(void*) @ 0x1651dafd in /mnt/ch/official_binaries/clickhouse-common-static-22.10.2.11/usr/bin/clickhouse
17. ? @ 0x7f1b3b5f38fd in ?
18. ? @ 0x7f1b3b675a60 in ?

This needs a better error.

Metadata

Metadata

Assignees

No one assigned

    Labels

    fuzzProblem found by one of the fuzzers

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions