Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 71b1226

Browse files
committedAug 26, 2022
Collation fixes
1 parent 9c29c6a commit 71b1226

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

47 files changed

+2562
-196
lines changed
 

‎memory/table_editor.go

+10-7
Original file line numberDiff line numberDiff line change
@@ -33,18 +33,27 @@ type tableEditor struct {
3333
fkTable *Table
3434
}
3535

36+
var _ sql.Table = (*tableEditor)(nil)
37+
var _ sql.RowReplacer = (*tableEditor)(nil)
38+
var _ sql.RowUpdater = (*tableEditor)(nil)
39+
var _ sql.RowInserter = (*tableEditor)(nil)
40+
var _ sql.RowDeleter = (*tableEditor)(nil)
41+
var _ sql.ForeignKeyUpdater = (*tableEditor)(nil)
42+
3643
func (t *tableEditor) Name() string {
3744
return t.table.name
3845
}
3946

4047
func (t *tableEditor) String() string {
4148
return t.table.String()
42-
4349
}
4450

4551
func (t *tableEditor) Schema() sql.Schema {
4652
return t.table.Schema()
53+
}
4754

55+
func (t *tableEditor) Collation() sql.CollationID {
56+
return t.table.Collation()
4857
}
4958

5059
func (t *tableEditor) Partitions(ctx *sql.Context) (sql.PartitionIter, error) {
@@ -58,12 +67,6 @@ func (t *tableEditor) PartitionRows(ctx *sql.Context, part sql.Partition) (sql.R
5867
return t.table.PartitionRows(ctx, part)
5968
}
6069

61-
var _ sql.RowReplacer = (*tableEditor)(nil)
62-
var _ sql.RowUpdater = (*tableEditor)(nil)
63-
var _ sql.RowInserter = (*tableEditor)(nil)
64-
var _ sql.RowDeleter = (*tableEditor)(nil)
65-
var _ sql.ForeignKeyUpdater = (*tableEditor)(nil)
66-
6770
func (t *tableEditor) GetIndexes(ctx *sql.Context) ([]sql.Index, error) {
6871
return t.table.GetIndexes(ctx)
6972
}

‎sql/analyzer/join_search_test.go

+5-25
Original file line numberDiff line numberDiff line change
@@ -37,36 +37,16 @@ func TestBuildJoinTree(t *testing.T) {
3737
db := memory.NewDatabase("db")
3838
cat := map[string]*plan.ResolvedTable{
3939
"A": plan.NewResolvedTable(
40-
memory.NewTable(
41-
"A",
42-
sql.NewPrimaryKeySchema(sql.Schema{{Name: "col", Type: sql.Text, Nullable: true, Source: "A"}}),
43-
nil,
44-
), db, nil),
40+
memory.NewTable("A", sql.NewPrimaryKeySchema(sql.Schema{{Name: "col", Type: sql.Text, Nullable: true, Source: "A"}}), nil), db, nil),
4541

4642
"B": plan.NewResolvedTable(
47-
memory.NewTable(
48-
"A",
49-
sql.NewPrimaryKeySchema(sql.Schema{{Name: "col", Type: sql.Text, Nullable: true, Source: "B"}}),
50-
nil,
51-
), db, nil),
43+
memory.NewTable("A", sql.NewPrimaryKeySchema(sql.Schema{{Name: "col", Type: sql.Text, Nullable: true, Source: "B"}}), nil), db, nil),
5244
"C": plan.NewResolvedTable(
53-
memory.NewTable(
54-
"A",
55-
sql.NewPrimaryKeySchema(sql.Schema{{Name: "col", Type: sql.Text, Nullable: true, Source: "C"}}),
56-
nil,
57-
), db, nil),
45+
memory.NewTable("A", sql.NewPrimaryKeySchema(sql.Schema{{Name: "col", Type: sql.Text, Nullable: true, Source: "C"}}), nil), db, nil),
5846
"D": plan.NewResolvedTable(
59-
memory.NewTable(
60-
"A",
61-
sql.NewPrimaryKeySchema(sql.Schema{{Name: "col", Type: sql.Text, Nullable: true, Source: "D"}}),
62-
nil,
63-
), db, nil),
47+
memory.NewTable("A", sql.NewPrimaryKeySchema(sql.Schema{{Name: "col", Type: sql.Text, Nullable: true, Source: "D"}}), nil), db, nil),
6448
"E": plan.NewResolvedTable(
65-
memory.NewTable(
66-
"A",
67-
sql.NewPrimaryKeySchema(sql.Schema{{Name: "col", Type: sql.Text, Nullable: true, Source: "E"}}),
68-
nil,
69-
), db, nil),
49+
memory.NewTable("A", sql.NewPrimaryKeySchema(sql.Schema{{Name: "col", Type: sql.Text, Nullable: true, Source: "E"}}), nil), db, nil),
7050
}
7151

7252
// These tests are a little fragile: for many of these joins, there is more than one correct join tree.
There was a problem loading the remainder of the diff.

0 commit comments

Comments
 (0)
Failed to load comments.