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 {
789
789
}
790
790
case * MergeJoin :
791
791
var ret sql.Schema
792
- for _ , e := range r .InnerScan .Table .Index ().Expressions () {
792
+ for _ , e := range r .InnerScan .Table .Index ().UnqualifiedExpressions () {
793
793
// 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
- }
801
794
ret = append (ret , & sql.Column {
802
- Name : strings .ToLower (name ),
795
+ Name : strings .ToLower (e ),
803
796
Source : strings .ToLower (r .InnerScan .Table .Name ()),
804
797
Nullable : true },
805
798
)
Original file line number Diff line number Diff line change @@ -2,6 +2,7 @@ package memo
2
2
3
3
import (
4
4
"fmt"
5
+ "strings"
5
6
"testing"
6
7
7
8
"github.com/stretchr/testify/require"
@@ -218,7 +219,11 @@ func (i dummyIndex) Expressions() []string {
218
219
}
219
220
220
221
func (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
222
227
}
223
228
224
229
func (dummyIndex ) IsUnique () bool {
You can’t perform that action at this time.
0 commit comments