Merge pull request #3147 from VadimPE/CLICKHOUSE-3993

CLICKHOUSE-3993 add default type of JOIN in query
This commit is contained in:
alexey-milovidov 2018-09-17 16:33:48 +03:00 committed by GitHub
commit c62b640595
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 13 additions and 2 deletions

View File

@ -151,8 +151,8 @@ bool ParserTablesInSelectQueryElement::parseImpl(Pos & pos, ASTPtr & node, Expec
table_join->kind = ASTTableJoin::Kind::Cross; table_join->kind = ASTTableJoin::Kind::Cross;
else else
{ {
/// Maybe need use INNER by default as in another DBMS. /// Use INNER by default as in another DBMS.
return false; table_join->kind = ASTTableJoin::Kind::Inner;
} }
if (table_join->strictness != ASTTableJoin::Strictness::Unspecified if (table_join->strictness != ASTTableJoin::Strictness::Unspecified

View File

@ -0,0 +1 @@
3 3

View File

@ -0,0 +1,10 @@
DROP TABLE IF EXISTS test.default_join1;
DROP TABLE IF EXISTS test.default_join2;
CREATE TABLE test.default_join1(a Int64, b Int64) ENGINE=Memory;
CREATE TABLE test.default_join2(a Int64, b Int64) ENGINE=Memory;
INSERT INTO test.default_join1 VALUES(1, 1), (2, 2), (3, 3);
INSERT INTO test.default_join2 VALUES(3, 3), (4, 4);
SELECT a, b FROM test.default_join1 JOIN (SELECT a, b FROM test.default_join2) USING a ORDER BY b SETTINGS join_default_strictness='ANY';