Skip to content

Commit

Permalink
Backport 12634 (#12680)
Browse files Browse the repository at this point in the history
Signed-off-by: Florent Poinsard <[email protected]>
  • Loading branch information
frouioui authored Mar 23, 2023
1 parent d8c5160 commit 0fbe50f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
3 changes: 1 addition & 2 deletions go/vt/vtgate/planbuilder/physical/operator_funcs.go
Original file line number Diff line number Diff line change
Expand Up @@ -231,11 +231,10 @@ func PushOutputColumns(ctx *plancontext.PlanningContext, op abstract.PhysicalOpe
var pos int
op.ColumnsOffset, pos = addToIntSlice(op.ColumnsOffset, i)
offsets = append(offsets, pos)
// skip adding to columns as it exists already.
op.Columns = append(op.Columns, col)
if i > -1 {
continue
}
op.Columns = append(op.Columns, col)
noQualifierNames = append(noQualifierNames, sqlparser.NewColName(col.Name.String()))
}
if len(noQualifierNames) > 0 {
Expand Down
6 changes: 3 additions & 3 deletions go/vt/vtgate/planbuilder/testdata/systemtables_cases57.json
Original file line number Diff line number Diff line change
Expand Up @@ -1287,7 +1287,7 @@
"Instructions": {
"OperatorType": "Join",
"Variant": "Join",
"JoinColumnIndexes": "L:0",
"JoinColumnIndexes": "L:1",
"JoinVars": {
"x_COLUMN_NAME": 0
},
Expand All @@ -1300,8 +1300,8 @@
"Name": "main",
"Sharded": false
},
"FieldQuery": "select x.table_name from (select a.CONSTRAINT_CATALOG, a.CONSTRAINT_SCHEMA, a.CONSTRAINT_NAME, a.TABLE_CATALOG, a.TABLE_SCHEMA, a.TABLE_NAME, a.COLUMN_NAME, a.ORDINAL_POSITION, a.POSITION_IN_UNIQUE_CONSTRAINT, a.REFERENCED_TABLE_SCHEMA, a.REFERENCED_TABLE_NAME, a.REFERENCED_COLUMN_NAME from information_schema.key_column_usage as a where 1 != 1) as x where 1 != 1",
"Query": "select x.table_name from (select a.CONSTRAINT_CATALOG, a.CONSTRAINT_SCHEMA, a.CONSTRAINT_NAME, a.TABLE_CATALOG, a.TABLE_SCHEMA, a.TABLE_NAME, a.COLUMN_NAME, a.ORDINAL_POSITION, a.POSITION_IN_UNIQUE_CONSTRAINT, a.REFERENCED_TABLE_SCHEMA, a.REFERENCED_TABLE_NAME, a.REFERENCED_COLUMN_NAME from information_schema.key_column_usage as a) as x",
"FieldQuery": "select x.COLUMN_NAME, x.table_name from (select a.CONSTRAINT_CATALOG, a.CONSTRAINT_SCHEMA, a.CONSTRAINT_NAME, a.TABLE_CATALOG, a.TABLE_SCHEMA, a.TABLE_NAME, a.COLUMN_NAME, a.ORDINAL_POSITION, a.POSITION_IN_UNIQUE_CONSTRAINT, a.REFERENCED_TABLE_SCHEMA, a.REFERENCED_TABLE_NAME, a.REFERENCED_COLUMN_NAME from information_schema.key_column_usage as a where 1 != 1) as x where 1 != 1",
"Query": "select x.COLUMN_NAME, x.table_name from (select a.CONSTRAINT_CATALOG, a.CONSTRAINT_SCHEMA, a.CONSTRAINT_NAME, a.TABLE_CATALOG, a.TABLE_SCHEMA, a.TABLE_NAME, a.COLUMN_NAME, a.ORDINAL_POSITION, a.POSITION_IN_UNIQUE_CONSTRAINT, a.REFERENCED_TABLE_SCHEMA, a.REFERENCED_TABLE_NAME, a.REFERENCED_COLUMN_NAME from information_schema.key_column_usage as a) as x",
"Table": "information_schema.key_column_usage"
},
{
Expand Down

0 comments on commit 0fbe50f

Please sign in to comment.