File tree Expand file tree Collapse file tree 2 files changed +8
-10
lines changed Expand file tree Collapse file tree 2 files changed +8
-10
lines changed Original file line number Diff line number Diff line change @@ -789,17 +789,10 @@ func sortedColsForRel(rel RelExpr) sql.Schema {
789789 }
790790 case * MergeJoin :
791791 var ret sql.Schema
792- for _ , e := range r .InnerScan .Table .Index ().Expressions () {
792+ for _ , e := range r .InnerScan .Table .Index ().UnqualifiedExpressions () {
793793 // TODO columns can have "." characters, this will miss cases
794- parts := strings .Split (e , "." )
795- var name string
796- if len (parts ) == 2 {
797- name = parts [1 ]
798- } else {
799- return nil
800- }
801794 ret = append (ret , & sql.Column {
802- Name : strings .ToLower (name ),
795+ Name : strings .ToLower (e ),
803796 Source : strings .ToLower (r .InnerScan .Table .Name ()),
804797 Nullable : true },
805798 )
Original file line number Diff line number Diff line change @@ -2,6 +2,7 @@ package memo
22
33import (
44 "fmt"
5+ "strings"
56 "testing"
67
78 "github.com/stretchr/testify/require"
@@ -218,7 +219,11 @@ func (i dummyIndex) Expressions() []string {
218219}
219220
220221func (i dummyIndex ) UnqualifiedExpressions () []string {
221- return i .cols
222+ res := make ([]string , len (i .cols ))
223+ for idx , col := range i .cols {
224+ res [idx ] = col [strings .IndexByte (col , '.' )+ 1 :]
225+ }
226+ return res
222227}
223228
224229func (dummyIndex ) IsUnique () bool {
You can’t perform that action at this time.
0 commit comments