Skip to content

Commit

Permalink
fix: use correct field type for left outer semi joins additional column
Browse files Browse the repository at this point in the history
  • Loading branch information
Willendless committed Jul 29, 2022
1 parent f0a99c3 commit c492177
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions dbms/src/Debug/astToExecutor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1670,10 +1670,14 @@ static void buildRightSideJoinSchema(DAGSchema & schema, const DAGSchema & right
/// indicating whether right table has matching row(s), see comment in ASTTableJoin::Kind for details.
if (tp == tipb::JoinType::TypeLeftOuterSemiJoin || tp == tipb::JoinType::TypeAntiLeftOuterSemiJoin)
{
// Note: the type columnInfo here will not affect later processing, it only serves as a
// placeholder so that this additional output column will not be neglected when translated to DAGRequest
ColumnInfo ci{};
schema.push_back(toNullableDAGColumnInfo(std::make_pair("", ci)));
tipb::FieldType field_type{};
field_type.set_tp(TiDB::TypeTiny);
field_type.set_charset("binary");
field_type.set_collate(TiDB::ITiDBCollator::BINARY);
field_type.set_flag(0);
field_type.set_flen(-1);
field_type.set_decimal(-1);
schema.push_back(std::make_pair("", TiDB::fieldTypeToColumnInfo(field_type)));
}
else if (tp != tipb::JoinType::TypeSemiJoin && tp != tipb::JoinType::TypeAntiSemiJoin)
{
Expand Down

0 comments on commit c492177

Please sign in to comment.