diff --git a/dbms/src/Parsers/ParserTablesInSelectQuery.cpp b/dbms/src/Parsers/ParserTablesInSelectQuery.cpp index 5eb00858e7c..088cd567fba 100644 --- a/dbms/src/Parsers/ParserTablesInSelectQuery.cpp +++ b/dbms/src/Parsers/ParserTablesInSelectQuery.cpp @@ -151,8 +151,8 @@ bool ParserTablesInSelectQueryElement::parseImpl(Pos & pos, ASTPtr & node, Expec table_join->kind = ASTTableJoin::Kind::Cross; else { - /// Maybe need use INNER by default as in another DBMS. - return false; + /// Use INNER by default as in another DBMS. + table_join->kind = ASTTableJoin::Kind::Inner; } if (table_join->strictness != ASTTableJoin::Strictness::Unspecified diff --git a/dbms/tests/queries/0_stateless/00717_default_join_type.reference b/dbms/tests/queries/0_stateless/00717_default_join_type.reference new file mode 100644 index 00000000000..7f6efad4038 --- /dev/null +++ b/dbms/tests/queries/0_stateless/00717_default_join_type.reference @@ -0,0 +1 @@ +3 3 diff --git a/dbms/tests/queries/0_stateless/00717_default_join_type.sql b/dbms/tests/queries/0_stateless/00717_default_join_type.sql new file mode 100644 index 00000000000..4249790747c --- /dev/null +++ b/dbms/tests/queries/0_stateless/00717_default_join_type.sql @@ -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';