Repository navigation
Closed
Labels
bugConfirmed user-visible misbehaviour in official release
Description
Version 18.16.1 rev 54412
Tested on CentOS 7.4.1708
DDL:
drop table persons;
drop table children;
create table persons (
id String,
name String
) engine MergeTree order by id;
create table children (
id String,
childName String
) engine MergeTree order by id;
Test data:
insert into persons (id, name)
values
('1', 'John'),
('2', 'Jack'),
('3', 'Daniel'),
('4', 'James'),
('5', 'Amanda');
insert into children (id, childName)
values
('1', 'Robert'),
('1', 'Susan'),
('3', 'Sarah'),
('4', 'David'),
('4', 'Joseph'),
('5', 'Robert');
Failed queries:
select *
from persons
all inner join children using id;
select *
from persons
all inner join (
select *
from children
) as j using id;
select *
from (
select *
from persons
) as s
all inner join (
select *
from children
) as j using id
But successful queries:
select *
from persons
all inner join (
select *
from children
) using id;
select *
from (
select *
from persons
)
all inner join (
select *
from children
) using id;
select *
from (
select *
from persons
) as s
all inner join (
select *
from children
) using id
Log:
2019.01.21 13:22:03.790646 [ 2 ] {} <Error> BaseDaemon: ########################################
2019.01.21 13:22:03.790700 [ 2 ] {} <Error> BaseDaemon: (from thread 31) Received signal Segmentation fault (11).
2019.01.21 13:22:03.790709 [ 2 ] {} <Error> BaseDaemon: Address: 0x7f6078600000
2019.01.21 13:22:03.790714 [ 2 ] {} <Error> BaseDaemon: Access: read.
2019.01.21 13:22:03.790719 [ 2 ] {} <Error> BaseDaemon: Address not mapped to object.
2019.01.21 13:22:03.814114 [ 2 ] {} <Error> BaseDaemon: 0. clickhouse-server(memcpy+0x103) [0x63480d3]
2019.01.21 13:22:03.814164 [ 2 ] {} <Error> BaseDaemon: 1. clickhouse-server(void DB::writeAnyEscapedString<(char)39>(char const*, char const*, DB::WriteBuffer&)+0x1df) [0x2cbb1af]
2019.01.21 13:22:03.814175 [ 2 ] {} <Error> BaseDaemon: 2. clickhouse-server(DB::BlockOutputStreamFromRowOutputStream::write(DB::Block const&)+0x94) [0x53cfb64]
2019.01.21 13:22:03.814184 [ 2 ] {} <Error> BaseDaemon: 3. clickhouse-server(DB::MaterializingBlockOutputStream::write(DB::Block const&)+0x5fd) [0x5134bcd]
2019.01.21 13:22:03.814197 [ 2 ] {} <Error> BaseDaemon: 4. clickhouse-server(DB::copyData(DB::IBlockInputStream&, DB::IBlockOutputStream&, std::atomic<bool>*)+0x91) [0x4c9df91]
2019.01.21 13:22:03.814213 [ 2 ] {} <Error> BaseDaemon: 5. clickhouse-server(DB::executeQuery(DB::ReadBuffer&, DB::WriteBuffer&, bool, DB::Context&, std::function<void (std::string const&)>)+0x4ee) [0x4eb040e]
2019.01.21 13:22:03.814229 [ 2 ] {} <Error> BaseDaemon: 6. clickhouse-server(DB::HTTPHandler::processQuery(Poco::Net::HTTPServerRequest&, HTMLForm&, Poco::Net::HTTPServerResponse&, DB::HTTPHandler::Output&)+0x321c) [0x2beaa3c]
2019.01.21 13:22:03.814244 [ 2 ] {} <Error> BaseDaemon: 7. clickhouse-server(DB::HTTPHandler::handleRequest(Poco::Net::HTTPServerRequest&, Poco::Net::HTTPServerResponse&)+0x42c) [0x2bed14c]
2019.01.21 13:22:03.814256 [ 2 ] {} <Error> BaseDaemon: 8. clickhouse-server(Poco::Net::HTTPServerConnection::run()+0x2af) [0x5fccf8f]
2019.01.21 13:22:03.814264 [ 2 ] {} <Error> BaseDaemon: 9. clickhouse-server(Poco::Net::TCPServerConnection::start()+0xf) [0x5fc3cef]
2019.01.21 13:22:03.814272 [ 2 ] {} <Error> BaseDaemon: 10. clickhouse-server(Poco::Net::TCPServerDispatcher::run()+0x166) [0x5fc40b6]
2019.01.21 13:22:03.814279 [ 2 ] {} <Error> BaseDaemon: 11. clickhouse-server(Poco::PooledThread::run()+0x77) [0x62755a7]
2019.01.21 13:22:03.814286 [ 2 ] {} <Error> BaseDaemon: 12. clickhouse-server(Poco::ThreadImpl::runnableEntry(void*)+0x38) [0x6271768]
2019.01.21 13:22:03.814293 [ 2 ] {} <Error> BaseDaemon: 13. clickhouse-server() [0x6a7fa8f]
2019.01.21 13:22:03.814299 [ 2 ] {} <Error> BaseDaemon: 14. /lib64/libpthread.so.0(+0x7dd5) [0x7f60910a9dd5]
Activity
KochetovNicolai commentedon Jan 21, 2019
Have reproduced on master.
4ertus2 commentedon Jan 24, 2019
Trying reproduce on master. The queries fail but without segfault:
If I remove one of duplicated ids - ('4', 'David'), ('4', 'Joseph'), all the queries are success. But with unexpected value in children.id for 'Susan'.
If I attach 'format PrettyCompact' to the queries it leads to an error
4ertus2 commentedon Jan 24, 2019
According to MySQL behaviour we should result only one column from using statement for asterisks. It'll probably solve the main issue.
4ertus2 commentedon Jan 24, 2019
It will hide an issue #4141
The main problem is not fixed:
Update: broken between 18.14.2 and 18.14.3. Last unaffected release - 18.12.17.
36c3fee 2018-10-07 | Merge pull request #3270 from yandex/left-join-right-keys-fix
4ertus2 commentedon Jan 29, 2019
fix for inner and left joins #4184
right & full are in progress
4ertus2 commentedon Jan 31, 2019
right & full appended to #4184
Complex RIGHT|FULL JOIN ON is not working yet:
Removed bug (already fixed) #4108