Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[no-release-notes] Unique ids bump #7067

Merged
merged 2 commits into from
Dec 1, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion go/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ require (
github.com/cespare/xxhash v1.1.0
github.com/creasty/defaults v1.6.0
github.com/dolthub/flatbuffers/v23 v23.3.3-dh.2
github.com/dolthub/go-mysql-server v0.17.1-0.20231128212821-dcb38e62c6af
github.com/dolthub/go-mysql-server v0.17.1-0.20231201021351-97a2867b8225
github.com/dolthub/swiss v0.1.0
github.com/goccy/go-json v0.10.2
github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510
Expand Down
4 changes: 2 additions & 2 deletions go/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -181,8 +181,8 @@ github.com/dolthub/fslock v0.0.3 h1:iLMpUIvJKMKm92+N1fmHVdxJP5NdyDK5bK7z7Ba2s2U=
github.com/dolthub/fslock v0.0.3/go.mod h1:QWql+P17oAAMLnL4HGB5tiovtDuAjdDTPbuqx7bYfa0=
github.com/dolthub/go-icu-regex v0.0.0-20230524105445-af7e7991c97e h1:kPsT4a47cw1+y/N5SSCkma7FhAPw7KeGmD6c9PBZW9Y=
github.com/dolthub/go-icu-regex v0.0.0-20230524105445-af7e7991c97e/go.mod h1:KPUcpx070QOfJK1gNe0zx4pA5sicIK1GMikIGLKC168=
github.com/dolthub/go-mysql-server v0.17.1-0.20231128212821-dcb38e62c6af h1:HqF5xFLyLu3U2CZ2HvIv9sUqaJOwCN6EibSIQShQHEM=
github.com/dolthub/go-mysql-server v0.17.1-0.20231128212821-dcb38e62c6af/go.mod h1:vXlRKS39WHav9N51VsfYphKhmSA2t5FkhHmW3BtwH5I=
github.com/dolthub/go-mysql-server v0.17.1-0.20231201021351-97a2867b8225 h1:6+FqniHHZRWNfuXtIlvSLUWoZhJEixyWYcgSsPlT69U=
github.com/dolthub/go-mysql-server v0.17.1-0.20231201021351-97a2867b8225/go.mod h1:vXlRKS39WHav9N51VsfYphKhmSA2t5FkhHmW3BtwH5I=
github.com/dolthub/ishell v0.0.0-20221214210346-d7db0b066488 h1:0HHu0GWJH0N6a6keStrHhUAK5/o9LVfkh44pvsV4514=
github.com/dolthub/ishell v0.0.0-20221214210346-d7db0b066488/go.mod h1:ehexgi1mPxRTk0Mok/pADALuHbvATulTh6gzr7NzZto=
github.com/dolthub/jsonpath v0.0.2-0.20230525180605-8dc13778fd72 h1:NfWmngMi1CYUWU4Ix8wM+USEhjc+mhPlT9JUR/anvbQ=
Expand Down
22 changes: 22 additions & 0 deletions go/libraries/doltcore/sqle/dolt_diff_stat_table_function.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@ type DiffStatTableFunction struct {
dotCommitExpr sql.Expression
tableNameExpr sql.Expression
database sql.Database
tabId sql.TableId
colset sql.ColSet
}

var diffStatTableSchema = sql.Schema{
Expand Down Expand Up @@ -77,6 +79,26 @@ func (ds *DiffStatTableFunction) NewInstance(ctx *sql.Context, db sql.Database,
return node, nil
}

func (ds *DiffStatTableFunction) WithId(id sql.TableId) sql.TableIdNode {
ret := *ds
ret.tabId = id
return &ret
}

func (ds *DiffStatTableFunction) Id() sql.TableId {
return ds.tabId
}

func (ds *DiffStatTableFunction) WithColumns(set sql.ColSet) sql.TableIdNode {
ret := *ds
ds.colset = set
return &ret
}

func (ds *DiffStatTableFunction) Columns() sql.ColSet {
return ds.colset
}

func (ds *DiffStatTableFunction) DataLength(ctx *sql.Context) (uint64, error) {
numBytesPerRow := schema.SchemaAvgLength(ds.Schema())
numRows, _, err := ds.RowCount(ctx)
Expand Down
22 changes: 22 additions & 0 deletions go/libraries/doltcore/sqle/dolt_diff_summary_table_function.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@ type DiffSummaryTableFunction struct {
dotCommitExpr sql.Expression
tableNameExpr sql.Expression
database sql.Database
tabId sql.TableId
colset sql.ColSet
}

var diffSummaryTableSchema = sql.Schema{
Expand All @@ -67,6 +69,26 @@ func (ds *DiffSummaryTableFunction) NewInstance(ctx *sql.Context, db sql.Databas
return node, nil
}

func (ds *DiffSummaryTableFunction) WithId(id sql.TableId) sql.TableIdNode {
ret := *ds
ret.tabId = id
return &ret
}

func (ds *DiffSummaryTableFunction) Id() sql.TableId {
return ds.tabId
}

func (ds *DiffSummaryTableFunction) WithColumns(set sql.ColSet) sql.TableIdNode {
ret := *ds
ret.colset = set
return &ret
}

func (ds *DiffSummaryTableFunction) Columns() sql.ColSet {
return ds.colset
}

func (ds *DiffSummaryTableFunction) DataLength(ctx *sql.Context) (uint64, error) {
numBytesPerRow := schema.SchemaAvgLength(ds.Schema())
numRows, _, err := ds.RowCount(ctx)
Expand Down
23 changes: 23 additions & 0 deletions go/libraries/doltcore/sqle/dolt_diff_table_function.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,29 @@ type DiffTableFunction struct {
tableDelta diff.TableDelta
fromDate *types.Timestamp
toDate *types.Timestamp

tabId sql.TableId
colset sql.ColSet
}

func (dtf *DiffTableFunction) WithId(id sql.TableId) sql.TableIdNode {
ret := *dtf
ret.tabId = id
return &ret
}

func (dtf *DiffTableFunction) Id() sql.TableId {
return dtf.tabId
}

func (dtf *DiffTableFunction) WithColumns(set sql.ColSet) sql.TableIdNode {
ret := *dtf
ret.colset = set
return &ret
}

func (dtf *DiffTableFunction) Columns() sql.ColSet {
return dtf.colset
}

// NewInstance creates a new instance of TableFunction interface
Expand Down
23 changes: 23 additions & 0 deletions go/libraries/doltcore/sqle/dolt_log_table_function.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,9 @@ type LogTableFunction struct {
showParents bool
decoration string

tabId sql.TableId
colset sql.ColSet

database sql.Database
}

Expand All @@ -74,6 +77,26 @@ func (ltf *LogTableFunction) NewInstance(ctx *sql.Context, db sql.Database, expr
return node, nil
}

func (ltf *LogTableFunction) WithId(id sql.TableId) sql.TableIdNode {
ret := *ltf
ret.tabId = id
return &ret
}

func (ltf *LogTableFunction) Id() sql.TableId {
return ltf.tabId
}

func (ltf *LogTableFunction) WithColumns(set sql.ColSet) sql.TableIdNode {
ret := *ltf
ret.colset = set
return &ret
}

func (ltf *LogTableFunction) Columns() sql.ColSet {
return ltf.colset
}

// Database implements the sql.Databaser interface
func (ltf *LogTableFunction) Database() sql.Database {
return ltf.database
Expand Down
22 changes: 22 additions & 0 deletions go/libraries/doltcore/sqle/dolt_patch_table_function.go
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,28 @@ type PatchTableFunction struct {
dotCommitExpr sql.Expression
tableNameExpr sql.Expression
database sql.Database
tabId sql.TableId
colset sql.ColSet
}

func (p *PatchTableFunction) WithId(id sql.TableId) sql.TableIdNode {
ret := *p
ret.tabId = id
return &ret
}

func (p *PatchTableFunction) Id() sql.TableId {
return p.tabId
}

func (p *PatchTableFunction) WithColumns(set sql.ColSet) sql.TableIdNode {
ret := *p
ret.colset = set
return &ret
}

func (p *PatchTableFunction) Columns() sql.ColSet {
return p.colset
}

func (p *PatchTableFunction) DataLength(ctx *sql.Context) (uint64, error) {
Expand Down
23 changes: 23 additions & 0 deletions go/libraries/doltcore/sqle/dolt_query_diff_table_function.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,29 @@ type QueryDiffTableFunction struct {
rowIter2 sql.RowIter
schema1 sql.Schema
schema2 sql.Schema

tabId sql.TableId
colset sql.ColSet
}

func (tf *QueryDiffTableFunction) WithId(id sql.TableId) sql.TableIdNode {
ret := *tf
ret.tabId = id
return &ret
}

func (tf *QueryDiffTableFunction) Id() sql.TableId {
return tf.tabId
}

func (tf *QueryDiffTableFunction) WithColumns(set sql.ColSet) sql.TableIdNode {
ret := *tf
ret.colset = set
return &ret
}

func (tf *QueryDiffTableFunction) Columns() sql.ColSet {
return tf.colset
}

// NewInstance creates a new instance of TableFunction interface
Expand Down
22 changes: 22 additions & 0 deletions go/libraries/doltcore/sqle/dolt_schema_diff_table_function.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,9 @@ type SchemaDiffTableFunction struct {
tableNameExpr sql.Expression

database sql.Database

tabId sql.TableId
colset sql.ColSet
}

var schemaDiffTableSchema = sql.Schema{
Expand All @@ -84,6 +87,25 @@ func (ds *SchemaDiffTableFunction) NewInstance(ctx *sql.Context, db sql.Database
return node, nil
}

func (ds *SchemaDiffTableFunction) WithId(id sql.TableId) sql.TableIdNode {
//TODO implement me
panic("implement me")
}

func (ds *SchemaDiffTableFunction) Id() sql.TableId {
return ds.tabId
}

func (ds *SchemaDiffTableFunction) WithColumns(set sql.ColSet) sql.TableIdNode {
ret := *ds
ds.colset = set
return &ret
}

func (ds *SchemaDiffTableFunction) Columns() sql.ColSet {
return ds.colset
}

func (ds *SchemaDiffTableFunction) DataLength(ctx *sql.Context) (uint64, error) {
numBytesPerRow := schema.SchemaAvgLength(ds.Schema())
numRows, _, err := ds.RowCount(ctx)
Expand Down
2 changes: 1 addition & 1 deletion go/libraries/doltcore/sqle/enginetest/dolt_engine_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1984,7 +1984,7 @@ func TestBrokenSystemTableQueries(t *testing.T) {
}

func TestHistorySystemTable(t *testing.T) {
harness := newDoltHarness(t).WithParallelism(2)
harness := newDoltHarness(t).WithParallelism(1)
defer harness.Close()
harness.Setup(setup.MydbData)
for _, test := range HistorySystemTableScriptTests {
Expand Down
4 changes: 3 additions & 1 deletion go/libraries/doltcore/sqle/history_table.go
Original file line number Diff line number Diff line change
Expand Up @@ -419,6 +419,7 @@ func (ht *HistoryTable) Collation() sql.CollationID {

// Partitions returns a PartitionIter which will be used in getting partitions each of which is used to create RowIter.
func (ht *HistoryTable) Partitions(ctx *sql.Context) (sql.PartitionIter, error) {
// TODO reset ht.cmItr on close
iter, err := ht.filterIter(ctx, ht.cmItr)
if err != nil {
return nil, err
Expand Down Expand Up @@ -460,7 +461,8 @@ func (cp commitPartitioner) Next(ctx *sql.Context) (sql.Partition, error) {
}

// Close closes the partitioner
func (cp commitPartitioner) Close(*sql.Context) error {
func (cp commitPartitioner) Close(ctx *sql.Context) error {
cp.cmItr.Reset(ctx)
return nil
}

Expand Down
22 changes: 22 additions & 0 deletions go/libraries/doltcore/sqle/reflog_table_function.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ type ReflogTableFunction struct {
ctx *sql.Context
database sql.Database
refExpr sql.Expression
tabId sql.TableId
colset sql.ColSet
}

var _ sql.TableFunction = (*ReflogTableFunction)(nil)
Expand All @@ -58,6 +60,26 @@ func (rltf *ReflogTableFunction) NewInstance(ctx *sql.Context, database sql.Data
return node, nil
}

func (rltf *ReflogTableFunction) WithId(id sql.TableId) sql.TableIdNode {
ret := *rltf
ret.tabId = id
return &ret
}

func (rltf *ReflogTableFunction) Id() sql.TableId {
return rltf.tabId
}

func (rltf *ReflogTableFunction) WithColumns(set sql.ColSet) sql.TableIdNode {
ret := *rltf
ret.colset = set
return &ret
}

func (rltf *ReflogTableFunction) Columns() sql.ColSet {
return rltf.colset
}

func (rltf *ReflogTableFunction) RowIter(ctx *sql.Context, row sql.Row) (sql.RowIter, error) {
sqlDb, ok := rltf.database.(dsess.SqlDatabase)
if !ok {
Expand Down