replace types.Format_7_18 with types.Format_Default throughout /go/libraries/doltcore

This commit is contained in:
Andy Arthur
2021-03-31 14:28:34 -07:00
parent 4c87f120f0
commit 4451ee3183
33 changed files with 213 additions and 213 deletions

View File

@@ -54,7 +54,7 @@ func TestCreateFileDB(t *testing.T) {
func TestCreateMemDB(t *testing.T) {
ctx := context.Background()
db, err := CreateDB(ctx, types.Format_7_18, "mem://", nil)
db, err := CreateDB(ctx, types.Format_Default, "mem://", nil)
assert.NoError(t, err)
assert.NotNil(t, db)

View File

@@ -30,7 +30,7 @@ import (
func TestDocDiff(t *testing.T) {
ctx := context.Background()
ddb, _ := doltdb.LoadDoltDB(ctx, types.Format_7_18, doltdb.InMemDoltDB)
ddb, _ := doltdb.LoadDoltDB(ctx, types.Format_Default, doltdb.InMemDoltDB)
ddb.WriteEmptyRepo(ctx, "billy bob", "bigbillieb@fake.horse")
cs, _ := doltdb.NewCommitSpec("master")
@@ -146,7 +146,7 @@ func createTestDocsSchema() schema.Schema {
}
func makeDocRow(t *testing.T, sch schema.Schema, pk string, rowVal types.Value) row.Row {
row, err := row.New(types.Format_7_18, sch, row.TaggedValues{
row, err := row.New(types.Format_Default, sch, row.TaggedValues{
schema.DocNameTag: types.String(pk),
schema.DocTextTag: rowVal,
})

View File

@@ -25,7 +25,7 @@ import (
func TestCommitMetaToAndFromNomsStruct(t *testing.T) {
cm, _ := NewCommitMeta("Bill Billerson", "bigbillieb@fake.horse", "This is a test commit")
cmSt, err := cm.toNomsStruct(types.Format_7_18)
cmSt, err := cm.toNomsStruct(types.Format_Default)
assert.NoError(t, err)
result, err := commitMetaFromNomsSt(cmSt)

View File

@@ -108,7 +108,7 @@ func createTestRowDataFromTaggedValues(t *testing.T, vrw types.ValueReadWriter,
ed := m.Edit()
for i, val := range vals {
r, err := row.New(types.Format_7_18, sch, val)
r, err := row.New(types.Format_Default, sch, val)
require.NoError(t, err)
rows[i] = r
ed = ed.Set(r.NomsMapKey(sch), r.NomsMapValue(sch))
@@ -177,7 +177,7 @@ func TestSystemTableTags(t *testing.T) {
}
func TestEmptyInMemoryRepoCreation(t *testing.T) {
ddb, err := LoadDoltDB(context.Background(), types.Format_7_18, InMemDoltDB)
ddb, err := LoadDoltDB(context.Background(), types.Format_Default, InMemDoltDB)
if err != nil {
t.Fatal("Failed to load db")
@@ -213,7 +213,7 @@ func TestLoadNonExistentLocalFSRepo(t *testing.T) {
panic("Couldn't change the working directory to the test directory.")
}
ddb, err := LoadDoltDB(context.Background(), types.Format_7_18, LocalDirDoltDB)
ddb, err := LoadDoltDB(context.Background(), types.Format_Default, LocalDirDoltDB)
assert.Nil(t, ddb, "Should return nil when loading a non-existent data dir")
assert.Error(t, err, "Should see an error here")
}
@@ -228,7 +228,7 @@ func TestLoadBadLocalFSRepo(t *testing.T) {
contents := []byte("not a directory")
ioutil.WriteFile(filepath.Join(testDir, dbfactory.DoltDataDir), contents, 0644)
ddb, err := LoadDoltDB(context.Background(), types.Format_7_18, LocalDirDoltDB)
ddb, err := LoadDoltDB(context.Background(), types.Format_Default, LocalDirDoltDB)
assert.Nil(t, ddb, "Should return nil when loading a non-directory data dir file")
assert.Error(t, err, "Should see an error here")
}
@@ -251,7 +251,7 @@ func TestLDNoms(t *testing.T) {
t.Fatal("Failed to create noms directory")
}
ddb, _ := LoadDoltDB(context.Background(), types.Format_7_18, LocalDirDoltDB)
ddb, _ := LoadDoltDB(context.Background(), types.Format_Default, LocalDirDoltDB)
err = ddb.WriteEmptyRepo(context.Background(), committerName, committerEmail)
if err != nil {
@@ -263,7 +263,7 @@ func TestLDNoms(t *testing.T) {
var valHash hash.Hash
var tbl *Table
{
ddb, _ := LoadDoltDB(context.Background(), types.Format_7_18, LocalDirDoltDB)
ddb, _ := LoadDoltDB(context.Background(), types.Format_Default, LocalDirDoltDB)
cs, _ := NewCommitSpec("master")
commit, err := ddb.Resolve(context.Background(), cs, nil)
@@ -305,7 +305,7 @@ func TestLDNoms(t *testing.T) {
// reopen the db and commit the value. Perform a couple checks for
{
ddb, _ := LoadDoltDB(context.Background(), types.Format_7_18, LocalDirDoltDB)
ddb, _ := LoadDoltDB(context.Background(), types.Format_Default, LocalDirDoltDB)
meta, err := NewCommitMeta(committerName, committerEmail, "Sample data")
if err != nil {
t.Error("Failed to commit")

View File

@@ -25,7 +25,7 @@ import (
func TestTagMetaToAndFromNomsStruct(t *testing.T) {
tm := NewTagMeta("Bill Billerson", "bigbillieb@fake.horse", "This is a test commit")
cmSt, err := tm.toNomsStruct(types.Format_7_18)
cmSt, err := tm.toNomsStruct(types.Format_Default)
assert.NoError(t, err)
result, err := tagMetaFromNomsSt(cmSt)

View File

@@ -60,7 +60,7 @@ func updateDocsTable(ctx context.Context, docTbl *doltdb.Table, docs Docs) (*dol
schema.DocNameTag: types.String(doc.DocPk),
schema.DocTextTag: types.String(doc.Text),
}
docRow, err = row.New(types.Format_7_18, sch, docTaggedVals)
docRow, err = row.New(types.Format_Default, sch, docTaggedVals)
if err != nil {
return nil, err
}
@@ -94,7 +94,7 @@ func createDocsTable(ctx context.Context, vrw types.ValueReadWriter, docs Docs)
schema.DocTextTag: types.String(doc.Text),
}
docRow, err := row.New(types.Format_7_18, Schema, docTaggedVals)
docRow, err := row.New(types.Format_Default, Schema, docTaggedVals)
if err != nil {
return nil, err
}

View File

@@ -30,7 +30,7 @@ import (
func TestAddNewerTextAndValueFromTable(t *testing.T) {
ctx := context.Background()
ddb, _ := doltdb.LoadDoltDB(ctx, types.Format_7_18, doltdb.InMemDoltDB)
ddb, _ := doltdb.LoadDoltDB(ctx, types.Format_Default, doltdb.InMemDoltDB)
ddb.WriteEmptyRepo(ctx, "billy bob", "bigbillieb@fake.horse")
// If no tbl/schema is provided, doc Text and Value should be nil.
@@ -84,12 +84,12 @@ func TestAddNewerTextAndValueFromTable(t *testing.T) {
func TestAddNewerTextAndDocPkFromRow(t *testing.T) {
ctx := context.Background()
ddb, _ := doltdb.LoadDoltDB(ctx, types.Format_7_18, doltdb.InMemDoltDB)
ddb, _ := doltdb.LoadDoltDB(ctx, types.Format_Default, doltdb.InMemDoltDB)
ddb.WriteEmptyRepo(ctx, "billy bob", "bigbillieb@fake.horse")
sch := createTestDocsSchema()
emptyRow, err := row.New(types.Format_7_18, sch, row.TaggedValues{})
emptyRow, err := row.New(types.Format_Default, sch, row.TaggedValues{})
require.NoError(t, err)
// Text and DocName should be nil from an empty row
@@ -102,7 +102,7 @@ func TestAddNewerTextAndDocPkFromRow(t *testing.T) {
doc1.DocPk = docPk
assert.Equal(t, "", doc1.DocPk)
licenseRow, err := row.New(types.Format_7_18, sch, row.TaggedValues{
licenseRow, err := row.New(types.Format_Default, sch, row.TaggedValues{
schema.DocNameTag: types.String(LicenseDoc),
schema.DocTextTag: types.String("license!"),
})
@@ -171,7 +171,7 @@ func getDocRows(t *testing.T, sch schema.Schema, rowVal types.Value) []row.Row {
}
func makeDocRow(t *testing.T, sch schema.Schema, pk string, rowVal types.Value) row.Row {
row, err := row.New(types.Format_7_18, sch, row.TaggedValues{
row, err := row.New(types.Format_Default, sch, row.TaggedValues{
schema.DocNameTag: types.String(pk),
schema.DocTextTag: rowVal,
})

View File

@@ -78,7 +78,7 @@ func init() {
IsMarriedTag: types.Bool(MaritalStatus[i]),
}
r, err := row.New(types.Format_7_18, TypedSchema, taggedVals)
r, err := row.New(types.Format_Default, TypedSchema, taggedVals)
if err != nil {
panic(err)
@@ -94,7 +94,7 @@ func init() {
IsMarriedTag: types.Bool(MaritalStatus[i]),
}
r, err = row.New(types.Format_7_18, TypedSchema, taggedVals)
r, err = row.New(types.Format_Default, TypedSchema, taggedVals)
if err != nil {
panic(err)
@@ -127,7 +127,7 @@ func NewTypedRow(id uuid.UUID, name string, age uint, isMarried bool, title *str
TitleTag: titleVal,
}
r, err := row.New(types.Format_7_18, TypedSchema, taggedVals)
r, err := row.New(types.Format_Default, TypedSchema, taggedVals)
if err != nil {
panic(err)
@@ -191,7 +191,7 @@ func ConvertToSchema(sch schema.Schema, rs ...row.Row) []row.Row {
panic(err)
}
newRows[i], err = row.New(types.Format_7_18, sch, taggedVals)
newRows[i], err = row.New(types.Format_Default, sch, taggedVals)
if err != nil {
panic(err)

View File

@@ -45,7 +45,7 @@ func NewRow(sch schema.Schema, values ...types.Value) row.Row {
for i := range values {
taggedVals[uint64(i)] = values[i]
}
r, err := row.New(types.Format_7_18, sch, taggedVals)
r, err := row.New(types.Format_Default, sch, taggedVals)
if err != nil {
panic(err)

View File

@@ -158,7 +158,7 @@ func TestRepoDirNoLocal(t *testing.T) {
func TestInitRepo(t *testing.T) {
dEnv := createTestEnv(false, false)
err := dEnv.InitRepo(context.Background(), types.Format_7_18, "aoeu aoeu", "aoeu@aoeu.org")
err := dEnv.InitRepo(context.Background(), types.Format_Default, "aoeu aoeu", "aoeu@aoeu.org")
if err != nil {
t.Error("Failed to init repo.", err.Error())

View File

@@ -89,7 +89,7 @@ func initRepoWithRelativePath(t *testing.T, envPath string, hdp HomeDirProvider)
UserEmailKey: email,
})
err = dEnv.InitRepo(context.Background(), types.Format_7_18, name, email)
err = dEnv.InitRepo(context.Background(), types.Format_Default, name, email)
require.NoError(t, err)
return dEnv

View File

@@ -78,7 +78,7 @@ func columnCollection(cols ...schema.Column) *schema.ColCollection {
}
func newRow(vals row.TaggedValues, cc *schema.ColCollection) row.Row {
r, err := row.New(types.Format_7_18, schema.MustSchemaFromCols(cc), vals)
r, err := row.New(types.Format_Default, schema.MustSchemaFromCols(cc), vals)
if err != nil {
panic(err)
}

View File

@@ -89,7 +89,7 @@ func valsToTestTuple(vals []types.Value, includePrimaryKeys bool) types.Value {
}
}
return mustTuple(types.NewTuple(types.Format_7_18, tplVals...))
return mustTuple(types.NewTuple(types.Format_Default, tplVals...))
}
func createRowMergeStruct(name string, vals, mergeVals, ancVals, expected []types.Value, expectCnf bool) RowMergeTest {
@@ -197,9 +197,9 @@ func TestRowMerge(t *testing.T) {
),
createRowMergeStruct(
"modify row where initial value wasn't given",
[]types.Value{mustTuple(types.NewTuple(types.Format_7_18, types.String("one"), types.Uint(2), types.String("a")))},
[]types.Value{mustTuple(types.NewTuple(types.Format_7_18, types.String("one"), types.Uint(2), types.String("b")))},
[]types.Value{mustTuple(types.NewTuple(types.Format_7_18, types.String("one"), types.Uint(2), types.NullValue))},
[]types.Value{mustTuple(types.NewTuple(types.Format_Default, types.String("one"), types.Uint(2), types.String("a")))},
[]types.Value{mustTuple(types.NewTuple(types.Format_Default, types.String("one"), types.Uint(2), types.String("b")))},
[]types.Value{mustTuple(types.NewTuple(types.Format_Default, types.String("one"), types.Uint(2), types.NullValue))},
nil,
true,
),
@@ -207,7 +207,7 @@ func TestRowMerge(t *testing.T) {
for _, test := range tests {
t.Run(test.name, func(t *testing.T) {
actualResult, isConflict, err := pkRowMerge(context.Background(), types.Format_7_18, test.sch, test.row, test.mergeRow, test.ancRow)
actualResult, isConflict, err := pkRowMerge(context.Background(), types.Format_Default, test.sch, test.row, test.mergeRow, test.ancRow)
assert.NoError(t, err)
assert.Equal(t, test.expectedResult, actualResult, "expected "+mustString(types.EncodedValue(context.Background(), test.expectedResult))+"got "+mustString(types.EncodedValue(context.Background(), actualResult)))
assert.Equal(t, test.expectConflict, isConflict)
@@ -256,14 +256,14 @@ func init() {
keyTag := types.Uint(idTag)
for i, id := range uuids {
keyTuples[i] = mustTuple(types.NewTuple(types.Format_7_18, keyTag, id))
keyTuples[i] = mustTuple(types.NewTuple(types.Format_Default, keyTag, id))
}
index, _ = sch.Indexes().AddIndexByColTags("idx_name", []uint64{nameTag}, schema.IndexProperties{IsUnique: false, Comment: ""})
}
func setupMergeTest(t *testing.T) (types.ValueReadWriter, *doltdb.Commit, *doltdb.Commit, types.Map, types.Map) {
ddb, _ := doltdb.LoadDoltDB(context.Background(), types.Format_7_18, doltdb.InMemDoltDB)
ddb, _ := doltdb.LoadDoltDB(context.Background(), types.Format_Default, doltdb.InMemDoltDB)
vrw := ddb.ValueReadWriter()
err := ddb.WriteEmptyRepo(context.Background(), name, email)

View File

@@ -57,7 +57,7 @@ func createRootAndFS() (*doltdb.DoltDB, *doltdb.RootValue, filesys.Filesys) {
initialDirs := []string{testHomeDir, workingDir}
fs := filesys.NewInMemFS(initialDirs, nil, workingDir)
fs.WriteFile(testSchemaFileName, []byte(testSchema))
ddb, _ := doltdb.LoadDoltDB(context.Background(), types.Format_7_18, doltdb.InMemDoltDB)
ddb, _ := doltdb.LoadDoltDB(context.Background(), types.Format_Default, doltdb.InMemDoltDB)
ddb.WriteEmptyRepo(context.Background(), "billy bob", "bigbillieb@fake.horse")
cs, _ := doltdb.NewCommitSpec("master")
@@ -116,9 +116,9 @@ func init() {
fakeSchema = schema.MustSchemaFromCols(fakeFields)
imtRows = []row.Row{
mustRow(row.New(types.Format_7_18, fakeSchema, row.TaggedValues{0: types.String("a"), 1: types.String("1")})),
mustRow(row.New(types.Format_7_18, fakeSchema, row.TaggedValues{0: types.String("b"), 1: types.String("2")})),
mustRow(row.New(types.Format_7_18, fakeSchema, row.TaggedValues{0: types.String("c"), 1: types.String("3")})),
mustRow(row.New(types.Format_Default, fakeSchema, row.TaggedValues{0: types.String("a"), 1: types.String("1")})),
mustRow(row.New(types.Format_Default, fakeSchema, row.TaggedValues{0: types.String("b"), 1: types.String("2")})),
mustRow(row.New(types.Format_Default, fakeSchema, row.TaggedValues{0: types.String("c"), 1: types.String("3")})),
}
imt = table.NewInMemTableWithData(fakeSchema, imtRows)

View File

@@ -78,7 +78,7 @@ func newTestRow() (Row, error) {
titleColTag: titleVal,
}
return New(types.Format_7_18, sch, vals)
return New(types.Format_Default, sch, vals)
}
func TestItrRowCols(t *testing.T) {
@@ -104,7 +104,7 @@ func TestItrRowCols(t *testing.T) {
func TestFromNoms(t *testing.T) {
// New() will faithfully return null values in the row, but such columns won't ever be set when loaded from Noms.
// So we use a row here with no null values set to avoid this inconsistency.
expectedRow, err := New(types.Format_7_18, sch, TaggedValues{
expectedRow, err := New(types.Format_Default, sch, TaggedValues{
fnColTag: fnVal,
lnColTag: lnVal,
addrColTag: addrVal,
@@ -113,13 +113,13 @@ func TestFromNoms(t *testing.T) {
assert.NoError(t, err)
t.Run("all values specified", func(t *testing.T) {
keys, err := types.NewTuple(types.Format_7_18,
keys, err := types.NewTuple(types.Format_Default,
types.Uint(fnColTag), fnVal,
types.Uint(lnColTag), lnVal,
)
assert.NoError(t, err)
vals, err := types.NewTuple(types.Format_7_18,
vals, err := types.NewTuple(types.Format_Default,
types.Uint(addrColTag), addrVal,
types.Uint(ageColTag), ageVal,
types.Uint(titleColTag), titleVal,
@@ -133,16 +133,16 @@ func TestFromNoms(t *testing.T) {
})
t.Run("only key", func(t *testing.T) {
keys, err := types.NewTuple(types.Format_7_18,
keys, err := types.NewTuple(types.Format_Default,
types.Uint(fnColTag), fnVal,
types.Uint(lnColTag), lnVal,
)
assert.NoError(t, err)
vals, err := types.NewTuple(types.Format_7_18)
vals, err := types.NewTuple(types.Format_Default)
assert.NoError(t, err)
expectedRow, err := New(types.Format_7_18, sch, TaggedValues{
expectedRow, err := New(types.Format_Default, sch, TaggedValues{
fnColTag: fnVal,
lnColTag: lnVal,
})
@@ -153,14 +153,14 @@ func TestFromNoms(t *testing.T) {
})
t.Run("additional tag not in schema is silently dropped", func(t *testing.T) {
keys, err := types.NewTuple(types.Format_7_18,
keys, err := types.NewTuple(types.Format_Default,
types.Uint(fnColTag), fnVal,
types.Uint(lnColTag), lnVal,
)
assert.NoError(t, err)
vals, err := types.NewTuple(types.Format_7_18,
vals, err := types.NewTuple(types.Format_Default,
types.Uint(addrColTag), addrVal,
types.Uint(ageColTag), ageVal,
types.Uint(titleColTag), titleVal,
@@ -175,12 +175,12 @@ func TestFromNoms(t *testing.T) {
})
t.Run("bad type", func(t *testing.T) {
keys, err := types.NewTuple(types.Format_7_18,
keys, err := types.NewTuple(types.Format_Default,
types.Uint(fnColTag), fnVal,
types.Uint(lnColTag), lnVal,
)
assert.NoError(t, err)
vals, err := types.NewTuple(types.Format_7_18,
vals, err := types.NewTuple(types.Format_Default,
types.Uint(addrColTag), addrVal,
types.Uint(ageColTag), fnVal,
)
@@ -191,12 +191,12 @@ func TestFromNoms(t *testing.T) {
})
t.Run("key col set in vals", func(t *testing.T) {
keys, err := types.NewTuple(types.Format_7_18,
keys, err := types.NewTuple(types.Format_Default,
types.Uint(fnColTag), fnVal,
types.Uint(lnColTag), lnVal,
)
assert.NoError(t, err)
vals, err := types.NewTuple(types.Format_7_18,
vals, err := types.NewTuple(types.Format_Default,
types.Uint(addrColTag), addrVal,
types.Uint(fnColTag), fnVal,
)
@@ -207,7 +207,7 @@ func TestFromNoms(t *testing.T) {
})
t.Run("unknown tag in key", func(t *testing.T) {
keys, err := types.NewTuple(types.Format_7_18,
keys, err := types.NewTuple(types.Format_Default,
types.Uint(fnColTag), fnVal,
types.Uint(lnColTag), lnVal,
types.Uint(unusedTag), fnVal,
@@ -215,7 +215,7 @@ func TestFromNoms(t *testing.T) {
assert.NoError(t, err)
vals, err := types.NewTuple(types.Format_7_18,
vals, err := types.NewTuple(types.Format_Default,
types.Uint(addrColTag), addrVal,
types.Uint(ageColTag), ageVal,
types.Uint(titleColTag), titleVal,
@@ -228,7 +228,7 @@ func TestFromNoms(t *testing.T) {
})
t.Run("value tag in key", func(t *testing.T) {
keys, err := types.NewTuple(types.Format_7_18,
keys, err := types.NewTuple(types.Format_Default,
types.Uint(fnColTag), fnVal,
types.Uint(lnColTag), lnVal,
types.Uint(ageColTag), ageVal,
@@ -236,7 +236,7 @@ func TestFromNoms(t *testing.T) {
assert.NoError(t, err)
vals, err := types.NewTuple(types.Format_7_18,
vals, err := types.NewTuple(types.Format_Default,
types.Uint(addrColTag), addrVal,
types.Uint(titleColTag), titleVal,
)
@@ -261,7 +261,7 @@ func TestSetColVal(t *testing.T) {
r, err := newTestRow()
assert.NoError(t, err)
r2, err := New(types.Format_7_18, sch, expected)
r2, err := New(types.Format_Default, sch, expected)
assert.NoError(t, err)
assert.Equal(t, r, r2)
@@ -269,18 +269,18 @@ func TestSetColVal(t *testing.T) {
assert.NoError(t, err)
// validate calling set does not mutate the original row
r3, err := New(types.Format_7_18, sch, expected)
r3, err := New(types.Format_Default, sch, expected)
assert.NoError(t, err)
assert.Equal(t, r, r3)
expected[lnColTag] = updatedVal
r4, err := New(types.Format_7_18, sch, expected)
r4, err := New(types.Format_Default, sch, expected)
assert.Equal(t, updated, r4)
// set to a nil value
updated, err = updated.SetColVal(titleColTag, nil, sch)
assert.NoError(t, err)
delete(expected, titleColTag)
r5, err := New(types.Format_7_18, sch, expected)
r5, err := New(types.Format_Default, sch, expected)
assert.Equal(t, updated, r5)
})
@@ -295,7 +295,7 @@ func TestSetColVal(t *testing.T) {
r, err := newTestRow()
assert.NoError(t, err)
r2, err := New(types.Format_7_18, sch, expected)
r2, err := New(types.Format_Default, sch, expected)
assert.NoError(t, err)
assert.Equal(t, r, r2)
@@ -312,7 +312,7 @@ func TestSetColVal(t *testing.T) {
assert.Equal(t, uint64(lnColTag), invalidCol.Tag)
// validate calling set does not mutate the original row
r3, err := New(types.Format_7_18, sch, expected)
r3, err := New(types.Format_Default, sch, expected)
assert.NoError(t, err)
assert.Equal(t, r, r3)
})
@@ -395,9 +395,9 @@ func TestReduceToIndex(t *testing.T) {
}
for _, tvCombo := range taggedValues {
row, err := New(types.Format_7_18, sch, tvCombo.row)
row, err := New(types.Format_Default, sch, tvCombo.row)
require.NoError(t, err)
expectedIndex, err := New(types.Format_7_18, index.Schema(), tvCombo.expectedIndex)
expectedIndex, err := New(types.Format_Default, index.Schema(), tvCombo.expectedIndex)
require.NoError(t, err)
indexRow, err := ReduceToIndex(index, row)
assert.NoError(t, err)

View File

@@ -95,12 +95,12 @@ func TestTupleValsLess(t *testing.T) {
t.Run(test.name, func(t *testing.T) {
ctx := context.Background()
lesserTplVals := test.lesserTVs.nomsTupleForTags(types.Format_7_18, test.tags, true)
greaterTplVals := test.greaterTVs.nomsTupleForTags(types.Format_7_18, test.tags, true)
lesserTplVals := test.lesserTVs.nomsTupleForTags(types.Format_Default, test.tags, true)
greaterTplVals := test.greaterTVs.nomsTupleForTags(types.Format_Default, test.tags, true)
lessLTGreater, err := lesserTplVals.Less(types.Format_7_18, greaterTplVals)
lessLTGreater, err := lesserTplVals.Less(types.Format_Default, greaterTplVals)
assert.NoError(t, err)
greaterLTLess, err := greaterTplVals.Less(types.Format_7_18, lesserTplVals)
greaterLTLess, err := greaterTplVals.Less(types.Format_Default, lesserTplVals)
assert.NoError(t, err)
assert.True(t, test.areEqual && !lessLTGreater || !test.areEqual && lessLTGreater)
@@ -111,9 +111,9 @@ func TestTupleValsLess(t *testing.T) {
greaterTpl, err := greaterTplVals.Value(ctx)
assert.NoError(t, err)
lesserLess, err := lesserTpl.Less(types.Format_7_18, greaterTpl)
lesserLess, err := lesserTpl.Less(types.Format_Default, greaterTpl)
assert.NoError(t, err)
greaterLess, err := greaterTpl.Less(types.Format_7_18, lesserTpl)
greaterLess, err := greaterTpl.Less(types.Format_Default, lesserTpl)
assert.NoError(t, err)
// needs to match with the types.Tuple Less implementation.
@@ -144,18 +144,18 @@ func TestTaggedTuple_NomsTupleForTags(t *testing.T) {
encodeNulls bool
want types.Tuple
}{
{[]uint64{}, true, mustTuple(types.NewTuple(types.Format_7_18))},
{[]uint64{1}, true, mustTuple(types.NewTuple(types.Format_7_18, types.Uint(1), types.String("1")))},
{[]uint64{0, 1, 2}, true, mustTuple(types.NewTuple(types.Format_7_18, types.Uint(0), types.String("0"), types.Uint(1), types.String("1"), types.Uint(2), types.String("2")))},
{[]uint64{2, 1, 0}, true, mustTuple(types.NewTuple(types.Format_7_18, types.Uint(2), types.String("2"), types.Uint(1), types.String("1"), types.Uint(0), types.String("0")))},
{[]uint64{1, 3}, true, mustTuple(types.NewTuple(types.Format_7_18, types.Uint(1), types.String("1"), types.Uint(3), types.NullValue))},
{[]uint64{1, 3}, false, mustTuple(types.NewTuple(types.Format_7_18, types.Uint(1), types.String("1")))},
{[]uint64{}, true, mustTuple(types.NewTuple(types.Format_Default))},
{[]uint64{1}, true, mustTuple(types.NewTuple(types.Format_Default, types.Uint(1), types.String("1")))},
{[]uint64{0, 1, 2}, true, mustTuple(types.NewTuple(types.Format_Default, types.Uint(0), types.String("0"), types.Uint(1), types.String("1"), types.Uint(2), types.String("2")))},
{[]uint64{2, 1, 0}, true, mustTuple(types.NewTuple(types.Format_Default, types.Uint(2), types.String("2"), types.Uint(1), types.String("1"), types.Uint(0), types.String("0")))},
{[]uint64{1, 3}, true, mustTuple(types.NewTuple(types.Format_Default, types.Uint(1), types.String("1"), types.Uint(3), types.NullValue))},
{[]uint64{1, 3}, false, mustTuple(types.NewTuple(types.Format_Default, types.Uint(1), types.String("1")))},
//{[]uint64{0, 1, 2}, types.NewTuple(types.Uint(0), types.String("0"), )},
//{map[uint64]types.Value{}, []uint64{}, types.NewTuple()},
//{map[uint64]types.Value{}, []uint64{}, types.NewTuple()},
}
for _, test := range tests {
if got, err := tt.nomsTupleForTags(types.Format_7_18, test.tags, test.encodeNulls).Value(ctx); err != nil {
if got, err := tt.nomsTupleForTags(types.Format_Default, test.tags, test.encodeNulls).Value(ctx); err != nil {
t.Error(err)
} else if !reflect.DeepEqual(got, test.want) {
gotStr, err := types.EncodedValue(ctx, got)
@@ -261,15 +261,15 @@ func TestParseTaggedTuple(t *testing.T) {
want TaggedValues
}{
{
mustTuple(types.NewTuple(types.Format_7_18)),
mustTuple(types.NewTuple(types.Format_Default)),
TaggedValues{},
},
{
mustTuple(types.NewTuple(types.Format_7_18, types.Uint(0), types.String("0"))),
mustTuple(types.NewTuple(types.Format_Default, types.Uint(0), types.String("0"))),
TaggedValues{0: types.String("0")},
},
{
mustTuple(types.NewTuple(types.Format_7_18, types.Uint(0), types.String("0"), types.Uint(5), types.Uint(5), types.Uint(60), types.Int(60))),
mustTuple(types.NewTuple(types.Format_Default, types.Uint(0), types.String("0"), types.Uint(5), types.Uint(5), types.Uint(60), types.Int(60))),
TaggedValues{0: types.String("0"), 5: types.Uint(5), 60: types.Int(60)},
},
}

View File

@@ -50,7 +50,7 @@ func createTestSchema() schema.Schema {
func TestNomsMarshalling(t *testing.T) {
tSchema := createTestSchema()
db, err := dbfactory.MemFactory{}.CreateDB(context.Background(), types.Format_7_18, nil, nil)
db, err := dbfactory.MemFactory{}.CreateDB(context.Background(), types.Format_Default, nil, nil)
if err != nil {
t.Fatal("Could not create in mem noms db.")
@@ -62,7 +62,7 @@ func TestNomsMarshalling(t *testing.T) {
t.Fatal("Failed to marshal Schema as a types.Value.")
}
unMarshalled, err := UnmarshalSchemaNomsValue(context.Background(), types.Format_7_18, val)
unMarshalled, err := UnmarshalSchemaNomsValue(context.Background(), types.Format_Default, val)
if err != nil {
t.Fatal("Failed to unmarshal types.Value as Schema")
@@ -72,7 +72,7 @@ func TestNomsMarshalling(t *testing.T) {
t.Error("Value different after marshalling and unmarshalling.")
}
validated, err := validateUnmarshaledNomsValue(context.Background(), types.Format_7_18, val)
validated, err := validateUnmarshaledNomsValue(context.Background(), types.Format_Default, val)
if err != nil {
t.Fatal(fmt.Sprintf("Failed compatibility test. Schema could not be unmarshalled with mirror type, error: %s", err.Error()))
@@ -88,7 +88,7 @@ func TestNomsMarshalling(t *testing.T) {
ssVal, err := MarshalSuperSchemaAsNomsValue(context.Background(), db, tSuperSchema)
require.NoError(t, err)
unMarshalledSS, err := UnmarshalSuperSchemaNomsValue(context.Background(), types.Format_7_18, ssVal)
unMarshalledSS, err := UnmarshalSuperSchemaNomsValue(context.Background(), types.Format_Default, ssVal)
require.NoError(t, err)
if !reflect.DeepEqual(tSuperSchema, unMarshalledSS) {

View File

@@ -136,7 +136,7 @@ func NewPeopleRow(id int, first, last string, isMarried bool, age int, rating fl
RatingTag: types.Float(rating),
}
r, err := row.New(types.Format_7_18, PeopleTestSchema, vals)
r, err := row.New(types.Format_Default, PeopleTestSchema, vals)
if err != nil {
panic(err)
@@ -153,7 +153,7 @@ func newEpsRow(id int, name string, airdate string, rating float64) row.Row {
EpRatingTag: types.Float(rating),
}
r, err := row.New(types.Format_7_18, EpisodesTestSchema, vals)
r, err := row.New(types.Format_Default, EpisodesTestSchema, vals)
if err != nil {
panic(err)
@@ -177,7 +177,7 @@ func newAppsRow(charId, epId int, comment string) row.Row {
AppCommentsTag: types.String(comment),
}
r, err := row.New(types.Format_7_18, AppearancesTestSchema, vals)
r, err := row.New(types.Format_Default, AppearancesTestSchema, vals)
if err != nil {
panic(err)
@@ -199,7 +199,7 @@ func NewPeopleRowWithOptionalFields(id int, first, last string, isMarried bool,
NumEpisodesTag: types.Uint(numEpisodes),
}
r, err := row.New(types.Format_7_18, PeopleTestSchema, vals)
r, err := row.New(types.Format_Default, PeopleTestSchema, vals)
if err != nil {
panic(err)

View File

@@ -56,7 +56,7 @@ func NewResultSetRow(colVals ...types.Value) row.Row {
collection := schema.NewColCollection(cols...)
sch := schema.UnkeyedSchemaFromCols(collection)
r, err := row.New(types.Format_7_18, sch, taggedVals)
r, err := row.New(types.Format_Default, sch, taggedVals)
if err != nil {
panic(err)
@@ -94,7 +94,7 @@ func NewRowWithPks(pkColVals []types.Value, nonPkVals ...types.Value) row.Row {
colColl := schema.NewColCollection(cols...)
sch := schema.MustSchemaFromCols(colColl)
r, err := row.New(types.Format_7_18, sch, taggedVals)
r, err := row.New(types.Format_Default, sch, taggedVals)
if err != nil {
panic(err)
@@ -113,7 +113,7 @@ func NewRowWithSchema(sch schema.Schema, vals ...types.Value) row.Row {
return false, nil
})
r, err := row.New(types.Format_7_18, sch, tv)
r, err := row.New(types.Format_Default, sch, tv)
if err != nil {
panic(err)
}
@@ -187,7 +187,7 @@ func ConcatRows(schemasAndRows ...interface{}) row.Row {
}
colCol := schema.NewColCollection(cols...)
r, err := row.New(types.Format_7_18, schema.UnkeyedSchemaFromCols(colCol), taggedVals)
r, err := row.New(types.Format_Default, schema.UnkeyedSchemaFromCols(colCol), taggedVals)
if err != nil {
panic(err)
@@ -213,7 +213,7 @@ func CompressRow(sch schema.Schema, r row.Row) row.Row {
})
// call to compress schema is a no-op in most cases
r, err := row.New(types.Format_7_18, CompressSchema(sch), compressedRow)
r, err := row.New(types.Format_Default, CompressSchema(sch), compressedRow)
if err != nil {
panic(err)

View File

@@ -274,7 +274,7 @@ func newPeopleRow(id int, firstName, lastName string) row.Row {
LastNameTag: types.String(lastName),
}
r, err := row.New(types.Format_7_18, PeopleTestSchema, vals)
r, err := row.New(types.Format_Default, PeopleTestSchema, vals)
if err != nil {
panic(err)
@@ -289,7 +289,7 @@ func newEpsRow(id int, name string) row.Row {
EpNameTag: types.String(name),
}
r, err := row.New(types.Format_7_18, EpisodesTestSchema, vals)
r, err := row.New(types.Format_Default, EpisodesTestSchema, vals)
if err != nil {
panic(err)
@@ -304,7 +304,7 @@ func newAppsRow(charId int, epId int) row.Row {
AppEpTag: types.Int(epId),
}
r, err := row.New(types.Format_7_18, AppearancesTestSchema, vals)
r, err := row.New(types.Format_Default, AppearancesTestSchema, vals)
if err != nil {
panic(err)

View File

@@ -775,17 +775,17 @@ var SelectDiffTests = []SelectTest{
Name: "select from diff system table",
Query: "select to_id, to_first_name, to_last_name, to_addr, from_id, from_first_name, from_last_name, from_addr, diff_type from dolt_diff_test_table",
ExpectedRows: ToSqlRows(DiffSchema,
mustRow(row.New(types.Format_7_18, DiffSchema, row.TaggedValues{0: types.Int(6), 1: types.String("Katie"), 2: types.String("McCulloch"), 14: types.String("added")})),
mustRow(row.New(types.Format_7_18, DiffSchema, row.TaggedValues{0: types.Int(0), 1: types.String("Aaron"), 2: types.String("Son"), 3: types.String("123 Fake St"), 7: types.Int(0), 8: types.String("Aaron"), 9: types.String("Son"), 10: types.String("123 Fake St"), 14: types.String("modified")})),
mustRow(row.New(types.Format_7_18, DiffSchema, row.TaggedValues{0: types.Int(1), 1: types.String("Brian"), 2: types.String("Hendriks"), 3: types.String("456 Bull Ln"), 7: types.Int(1), 8: types.String("Brian"), 9: types.String("Hendriks"), 10: types.String("456 Bull Ln"), 14: types.String("modified")})),
mustRow(row.New(types.Format_7_18, DiffSchema, row.TaggedValues{0: types.Int(2), 1: types.String("Tim"), 2: types.String("Sehn"), 3: types.String("789 Not Real Ct"), 7: types.Int(2), 8: types.String("Tim"), 9: types.String("Sehn"), 10: types.String("789 Not Real Ct"), 14: types.String("modified")})),
mustRow(row.New(types.Format_7_18, DiffSchema, row.TaggedValues{0: types.Int(3), 1: types.String("Zach"), 2: types.String("Musgrave"), 3: types.String("-1 Imaginary Wy"), 7: types.Int(3), 8: types.String("Zach"), 9: types.String("Musgrave"), 14: types.String("modified")})),
mustRow(row.New(types.Format_7_18, DiffSchema, row.TaggedValues{0: types.Int(5), 1: types.String("Daylon"), 2: types.String("Wilkins"), 14: types.String("added")})),
mustRow(row.New(types.Format_7_18, DiffSchema, row.TaggedValues{0: types.Int(0), 1: types.String("Aaron"), 2: types.String("Son"), 3: types.String("123 Fake St"), 14: types.String("added")})),
mustRow(row.New(types.Format_7_18, DiffSchema, row.TaggedValues{0: types.Int(1), 1: types.String("Brian"), 2: types.String("Hendriks"), 3: types.String("456 Bull Ln"), 14: types.String("added")})),
mustRow(row.New(types.Format_7_18, DiffSchema, row.TaggedValues{0: types.Int(2), 1: types.String("Tim"), 2: types.String("Sehn"), 3: types.String("789 Not Real Ct"), 14: types.String("added")})),
mustRow(row.New(types.Format_7_18, DiffSchema, row.TaggedValues{0: types.Int(3), 1: types.String("Zach"), 2: types.String("Musgrave"), 14: types.String("added")})),
mustRow(row.New(types.Format_7_18, DiffSchema, row.TaggedValues{0: types.Int(4), 1: types.String("Matt"), 2: types.String("Jesuele"), 14: types.String("added")})),
mustRow(row.New(types.Format_Default, DiffSchema, row.TaggedValues{0: types.Int(6), 1: types.String("Katie"), 2: types.String("McCulloch"), 14: types.String("added")})),
mustRow(row.New(types.Format_Default, DiffSchema, row.TaggedValues{0: types.Int(0), 1: types.String("Aaron"), 2: types.String("Son"), 3: types.String("123 Fake St"), 7: types.Int(0), 8: types.String("Aaron"), 9: types.String("Son"), 10: types.String("123 Fake St"), 14: types.String("modified")})),
mustRow(row.New(types.Format_Default, DiffSchema, row.TaggedValues{0: types.Int(1), 1: types.String("Brian"), 2: types.String("Hendriks"), 3: types.String("456 Bull Ln"), 7: types.Int(1), 8: types.String("Brian"), 9: types.String("Hendriks"), 10: types.String("456 Bull Ln"), 14: types.String("modified")})),
mustRow(row.New(types.Format_Default, DiffSchema, row.TaggedValues{0: types.Int(2), 1: types.String("Tim"), 2: types.String("Sehn"), 3: types.String("789 Not Real Ct"), 7: types.Int(2), 8: types.String("Tim"), 9: types.String("Sehn"), 10: types.String("789 Not Real Ct"), 14: types.String("modified")})),
mustRow(row.New(types.Format_Default, DiffSchema, row.TaggedValues{0: types.Int(3), 1: types.String("Zach"), 2: types.String("Musgrave"), 3: types.String("-1 Imaginary Wy"), 7: types.Int(3), 8: types.String("Zach"), 9: types.String("Musgrave"), 14: types.String("modified")})),
mustRow(row.New(types.Format_Default, DiffSchema, row.TaggedValues{0: types.Int(5), 1: types.String("Daylon"), 2: types.String("Wilkins"), 14: types.String("added")})),
mustRow(row.New(types.Format_Default, DiffSchema, row.TaggedValues{0: types.Int(0), 1: types.String("Aaron"), 2: types.String("Son"), 3: types.String("123 Fake St"), 14: types.String("added")})),
mustRow(row.New(types.Format_Default, DiffSchema, row.TaggedValues{0: types.Int(1), 1: types.String("Brian"), 2: types.String("Hendriks"), 3: types.String("456 Bull Ln"), 14: types.String("added")})),
mustRow(row.New(types.Format_Default, DiffSchema, row.TaggedValues{0: types.Int(2), 1: types.String("Tim"), 2: types.String("Sehn"), 3: types.String("789 Not Real Ct"), 14: types.String("added")})),
mustRow(row.New(types.Format_Default, DiffSchema, row.TaggedValues{0: types.Int(3), 1: types.String("Zach"), 2: types.String("Musgrave"), 14: types.String("added")})),
mustRow(row.New(types.Format_Default, DiffSchema, row.TaggedValues{0: types.Int(4), 1: types.String("Matt"), 2: types.String("Jesuele"), 14: types.String("added")})),
),
ExpectedSqlSchema: sqlDiffSchema,
},
@@ -793,7 +793,7 @@ var SelectDiffTests = []SelectTest{
Name: "select from diff system table with to commit",
Query: "select to_id, to_first_name, to_last_name, to_addr, from_id, from_first_name, from_last_name, from_addr, diff_type from dolt_diff_test_table where to_commit = 'WORKING'",
ExpectedRows: ToSqlRows(DiffSchema,
mustRow(row.New(types.Format_7_18, DiffSchema, row.TaggedValues{0: types.Int(6), 1: types.String("Katie"), 2: types.String("McCulloch"), 14: types.String("added")})),
mustRow(row.New(types.Format_Default, DiffSchema, row.TaggedValues{0: types.Int(6), 1: types.String("Katie"), 2: types.String("McCulloch"), 14: types.String("added")})),
),
ExpectedSqlSchema: sqlDiffSchema,
},
@@ -802,12 +802,12 @@ var SelectDiffTests = []SelectTest{
Name: "select from diff system table with from and to commit and test insensitive name",
Query: "select to_id, to_first_name, to_last_name, to_addr, to_age_4, to_age_5, from_id, from_first_name, from_last_name, from_addr, from_age_4, from_age_5, diff_type from dolt_diff_TeSt_TaBlE where from_commit = 'add-age' and to_commit = 'master'",
ExpectedRows: ToSqlRows(DiffSchema,
mustRow(row.New(types.Format_7_18, DiffSchema, row.TaggedValues{7: types.Int(0), 8: types.String("Aaron"), 9: types.String("Son"), 11: types.Int(35), 0: types.Int(0), 1: types.String("Aaron"), 2: types.String("Son"), 3: types.String("123 Fake St"), 5: types.Uint(35), 13: types.String("add-age"), 6: types.String("master"), 14: types.String("modified")})),
mustRow(row.New(types.Format_7_18, DiffSchema, row.TaggedValues{7: types.Int(1), 8: types.String("Brian"), 9: types.String("Hendriks"), 11: types.Int(38), 0: types.Int(1), 1: types.String("Brian"), 2: types.String("Hendriks"), 3: types.String("456 Bull Ln"), 5: types.Uint(38), 13: types.String("add-age"), 6: types.String("master"), 14: types.String("modified")})),
mustRow(row.New(types.Format_7_18, DiffSchema, row.TaggedValues{7: types.Int(2), 8: types.String("Tim"), 9: types.String("Sehn"), 11: types.Int(37), 0: types.Int(2), 1: types.String("Tim"), 2: types.String("Sehn"), 3: types.String("789 Not Real Ct"), 5: types.Uint(37), 13: types.String("add-age"), 6: types.String("master"), 14: types.String("modified")})),
mustRow(row.New(types.Format_7_18, DiffSchema, row.TaggedValues{7: types.Int(3), 8: types.String("Zach"), 9: types.String("Musgrave"), 11: types.Int(37), 0: types.Int(3), 1: types.String("Zach"), 2: types.String("Musgrave"), 3: types.String("-1 Imaginary Wy"), 5: types.Uint(37), 13: types.String("add-age"), 6: types.String("master"), 14: types.String("modified")})),
mustRow(row.New(types.Format_7_18, DiffSchema, row.TaggedValues{0: types.Int(4), 1: types.String("Matt"), 2: types.String("Jesuele"), 3: types.NullValue, 13: types.String("add-age"), 6: types.String("master"), 14: types.String("added")})),
mustRow(row.New(types.Format_7_18, DiffSchema, row.TaggedValues{0: types.Int(5), 1: types.String("Daylon"), 2: types.String("Wilkins"), 3: types.NullValue, 13: types.String("add-age"), 6: types.String("master"), 14: types.String("added")})),
mustRow(row.New(types.Format_Default, DiffSchema, row.TaggedValues{7: types.Int(0), 8: types.String("Aaron"), 9: types.String("Son"), 11: types.Int(35), 0: types.Int(0), 1: types.String("Aaron"), 2: types.String("Son"), 3: types.String("123 Fake St"), 5: types.Uint(35), 13: types.String("add-age"), 6: types.String("master"), 14: types.String("modified")})),
mustRow(row.New(types.Format_Default, DiffSchema, row.TaggedValues{7: types.Int(1), 8: types.String("Brian"), 9: types.String("Hendriks"), 11: types.Int(38), 0: types.Int(1), 1: types.String("Brian"), 2: types.String("Hendriks"), 3: types.String("456 Bull Ln"), 5: types.Uint(38), 13: types.String("add-age"), 6: types.String("master"), 14: types.String("modified")})),
mustRow(row.New(types.Format_Default, DiffSchema, row.TaggedValues{7: types.Int(2), 8: types.String("Tim"), 9: types.String("Sehn"), 11: types.Int(37), 0: types.Int(2), 1: types.String("Tim"), 2: types.String("Sehn"), 3: types.String("789 Not Real Ct"), 5: types.Uint(37), 13: types.String("add-age"), 6: types.String("master"), 14: types.String("modified")})),
mustRow(row.New(types.Format_Default, DiffSchema, row.TaggedValues{7: types.Int(3), 8: types.String("Zach"), 9: types.String("Musgrave"), 11: types.Int(37), 0: types.Int(3), 1: types.String("Zach"), 2: types.String("Musgrave"), 3: types.String("-1 Imaginary Wy"), 5: types.Uint(37), 13: types.String("add-age"), 6: types.String("master"), 14: types.String("modified")})),
mustRow(row.New(types.Format_Default, DiffSchema, row.TaggedValues{0: types.Int(4), 1: types.String("Matt"), 2: types.String("Jesuele"), 3: types.NullValue, 13: types.String("add-age"), 6: types.String("master"), 14: types.String("added")})),
mustRow(row.New(types.Format_Default, DiffSchema, row.TaggedValues{0: types.Int(5), 1: types.String("Daylon"), 2: types.String("Wilkins"), 3: types.NullValue, 13: types.String("add-age"), 6: types.String("master"), 14: types.String("added")})),
),
ExpectedSqlSchema: sqlDiffSchema,
},*/
@@ -818,9 +818,9 @@ var AsOfTests = []SelectTest{
Name: "select * from seed branch",
Query: "select * from test_table as of 'seed'",
ExpectedRows: ToSqlRows(InitialHistSch,
mustRow(row.New(types.Format_7_18, InitialHistSch, row.TaggedValues{0: types.Int(0), 1: types.String("Aaron"), 2: types.String("Son")})),
mustRow(row.New(types.Format_7_18, InitialHistSch, row.TaggedValues{0: types.Int(1), 1: types.String("Brian"), 2: types.String("Hendriks")})),
mustRow(row.New(types.Format_7_18, InitialHistSch, row.TaggedValues{0: types.Int(2), 1: types.String("Tim"), 2: types.String("Sehn")})),
mustRow(row.New(types.Format_Default, InitialHistSch, row.TaggedValues{0: types.Int(0), 1: types.String("Aaron"), 2: types.String("Son")})),
mustRow(row.New(types.Format_Default, InitialHistSch, row.TaggedValues{0: types.Int(1), 1: types.String("Brian"), 2: types.String("Hendriks")})),
mustRow(row.New(types.Format_Default, InitialHistSch, row.TaggedValues{0: types.Int(2), 1: types.String("Tim"), 2: types.String("Sehn")})),
),
ExpectedSchema: InitialHistSch,
},
@@ -828,10 +828,10 @@ var AsOfTests = []SelectTest{
Name: "select * from add-age branch",
Query: "select * from test_table as of 'add-age'",
ExpectedRows: ToSqlRows(AddAgeAt4HistSch,
mustRow(row.New(types.Format_7_18, AddAgeAt4HistSch, row.TaggedValues{0: types.Int(0), 1: types.String("Aaron"), 2: types.String("Son"), 4: types.Int(35)})),
mustRow(row.New(types.Format_7_18, AddAgeAt4HistSch, row.TaggedValues{0: types.Int(1), 1: types.String("Brian"), 2: types.String("Hendriks"), 4: types.Int(38)})),
mustRow(row.New(types.Format_7_18, AddAgeAt4HistSch, row.TaggedValues{0: types.Int(2), 1: types.String("Tim"), 2: types.String("Sehn"), 4: types.Int(37)})),
mustRow(row.New(types.Format_7_18, AddAgeAt4HistSch, row.TaggedValues{0: types.Int(3), 1: types.String("Zach"), 2: types.String("Musgrave"), 4: types.Int(37)})),
mustRow(row.New(types.Format_Default, AddAgeAt4HistSch, row.TaggedValues{0: types.Int(0), 1: types.String("Aaron"), 2: types.String("Son"), 4: types.Int(35)})),
mustRow(row.New(types.Format_Default, AddAgeAt4HistSch, row.TaggedValues{0: types.Int(1), 1: types.String("Brian"), 2: types.String("Hendriks"), 4: types.Int(38)})),
mustRow(row.New(types.Format_Default, AddAgeAt4HistSch, row.TaggedValues{0: types.Int(2), 1: types.String("Tim"), 2: types.String("Sehn"), 4: types.Int(37)})),
mustRow(row.New(types.Format_Default, AddAgeAt4HistSch, row.TaggedValues{0: types.Int(3), 1: types.String("Zach"), 2: types.String("Musgrave"), 4: types.Int(37)})),
),
ExpectedSchema: AddAgeAt4HistSch,
},
@@ -839,12 +839,12 @@ var AsOfTests = []SelectTest{
Name: "select * from master branch",
Query: "select * from test_table as of 'master'",
ExpectedRows: ToSqlRows(ReaddAgeAt5HistSch,
mustRow(row.New(types.Format_7_18, ReaddAgeAt5HistSch, row.TaggedValues{0: types.Int(0), 1: types.String("Aaron"), 2: types.String("Son"), 3: types.String("123 Fake St"), 5: types.Uint(35)})),
mustRow(row.New(types.Format_7_18, ReaddAgeAt5HistSch, row.TaggedValues{0: types.Int(1), 1: types.String("Brian"), 2: types.String("Hendriks"), 3: types.String("456 Bull Ln"), 5: types.Uint(38)})),
mustRow(row.New(types.Format_7_18, ReaddAgeAt5HistSch, row.TaggedValues{0: types.Int(2), 1: types.String("Tim"), 2: types.String("Sehn"), 3: types.String("789 Not Real Ct"), 5: types.Uint(37)})),
mustRow(row.New(types.Format_7_18, ReaddAgeAt5HistSch, row.TaggedValues{0: types.Int(3), 1: types.String("Zach"), 2: types.String("Musgrave"), 3: types.String("-1 Imaginary Wy"), 5: types.Uint(37)})),
mustRow(row.New(types.Format_7_18, ReaddAgeAt5HistSch, row.TaggedValues{0: types.Int(4), 1: types.String("Matt"), 2: types.String("Jesuele")})),
mustRow(row.New(types.Format_7_18, ReaddAgeAt5HistSch, row.TaggedValues{0: types.Int(5), 1: types.String("Daylon"), 2: types.String("Wilkins")})),
mustRow(row.New(types.Format_Default, ReaddAgeAt5HistSch, row.TaggedValues{0: types.Int(0), 1: types.String("Aaron"), 2: types.String("Son"), 3: types.String("123 Fake St"), 5: types.Uint(35)})),
mustRow(row.New(types.Format_Default, ReaddAgeAt5HistSch, row.TaggedValues{0: types.Int(1), 1: types.String("Brian"), 2: types.String("Hendriks"), 3: types.String("456 Bull Ln"), 5: types.Uint(38)})),
mustRow(row.New(types.Format_Default, ReaddAgeAt5HistSch, row.TaggedValues{0: types.Int(2), 1: types.String("Tim"), 2: types.String("Sehn"), 3: types.String("789 Not Real Ct"), 5: types.Uint(37)})),
mustRow(row.New(types.Format_Default, ReaddAgeAt5HistSch, row.TaggedValues{0: types.Int(3), 1: types.String("Zach"), 2: types.String("Musgrave"), 3: types.String("-1 Imaginary Wy"), 5: types.Uint(37)})),
mustRow(row.New(types.Format_Default, ReaddAgeAt5HistSch, row.TaggedValues{0: types.Int(4), 1: types.String("Matt"), 2: types.String("Jesuele")})),
mustRow(row.New(types.Format_Default, ReaddAgeAt5HistSch, row.TaggedValues{0: types.Int(5), 1: types.String("Daylon"), 2: types.String("Wilkins")})),
),
ExpectedSchema: ReaddAgeAt5HistSch,
},
@@ -852,11 +852,11 @@ var AsOfTests = []SelectTest{
Name: "select * from HEAD~",
Query: "select * from test_table as of 'HEAD~'",
ExpectedRows: ToSqlRows(AddAddrAt3HistSch,
mustRow(row.New(types.Format_7_18, AddAddrAt3HistSch, row.TaggedValues{0: types.Int(0), 1: types.String("Aaron"), 2: types.String("Son"), 3: types.String("123 Fake St")})),
mustRow(row.New(types.Format_7_18, AddAddrAt3HistSch, row.TaggedValues{0: types.Int(1), 1: types.String("Brian"), 2: types.String("Hendriks"), 3: types.String("456 Bull Ln")})),
mustRow(row.New(types.Format_7_18, AddAddrAt3HistSch, row.TaggedValues{0: types.Int(2), 1: types.String("Tim"), 2: types.String("Sehn"), 3: types.String("789 Not Real Ct")})),
mustRow(row.New(types.Format_7_18, AddAddrAt3HistSch, row.TaggedValues{0: types.Int(3), 1: types.String("Zach"), 2: types.String("Musgrave")})),
mustRow(row.New(types.Format_7_18, AddAddrAt3HistSch, row.TaggedValues{0: types.Int(4), 1: types.String("Matt"), 2: types.String("Jesuele")})),
mustRow(row.New(types.Format_Default, AddAddrAt3HistSch, row.TaggedValues{0: types.Int(0), 1: types.String("Aaron"), 2: types.String("Son"), 3: types.String("123 Fake St")})),
mustRow(row.New(types.Format_Default, AddAddrAt3HistSch, row.TaggedValues{0: types.Int(1), 1: types.String("Brian"), 2: types.String("Hendriks"), 3: types.String("456 Bull Ln")})),
mustRow(row.New(types.Format_Default, AddAddrAt3HistSch, row.TaggedValues{0: types.Int(2), 1: types.String("Tim"), 2: types.String("Sehn"), 3: types.String("789 Not Real Ct")})),
mustRow(row.New(types.Format_Default, AddAddrAt3HistSch, row.TaggedValues{0: types.Int(3), 1: types.String("Zach"), 2: types.String("Musgrave")})),
mustRow(row.New(types.Format_Default, AddAddrAt3HistSch, row.TaggedValues{0: types.Int(4), 1: types.String("Matt"), 2: types.String("Jesuele")})),
),
ExpectedSchema: AddAddrAt3HistSch,
},
@@ -864,11 +864,11 @@ var AsOfTests = []SelectTest{
Name: "select * from HEAD^",
Query: "select * from test_table as of 'HEAD^'",
ExpectedRows: ToSqlRows(AddAddrAt3HistSch,
mustRow(row.New(types.Format_7_18, AddAddrAt3HistSch, row.TaggedValues{0: types.Int(0), 1: types.String("Aaron"), 2: types.String("Son"), 3: types.String("123 Fake St")})),
mustRow(row.New(types.Format_7_18, AddAddrAt3HistSch, row.TaggedValues{0: types.Int(1), 1: types.String("Brian"), 2: types.String("Hendriks"), 3: types.String("456 Bull Ln")})),
mustRow(row.New(types.Format_7_18, AddAddrAt3HistSch, row.TaggedValues{0: types.Int(2), 1: types.String("Tim"), 2: types.String("Sehn"), 3: types.String("789 Not Real Ct")})),
mustRow(row.New(types.Format_7_18, AddAddrAt3HistSch, row.TaggedValues{0: types.Int(3), 1: types.String("Zach"), 2: types.String("Musgrave")})),
mustRow(row.New(types.Format_7_18, AddAddrAt3HistSch, row.TaggedValues{0: types.Int(4), 1: types.String("Matt"), 2: types.String("Jesuele")})),
mustRow(row.New(types.Format_Default, AddAddrAt3HistSch, row.TaggedValues{0: types.Int(0), 1: types.String("Aaron"), 2: types.String("Son"), 3: types.String("123 Fake St")})),
mustRow(row.New(types.Format_Default, AddAddrAt3HistSch, row.TaggedValues{0: types.Int(1), 1: types.String("Brian"), 2: types.String("Hendriks"), 3: types.String("456 Bull Ln")})),
mustRow(row.New(types.Format_Default, AddAddrAt3HistSch, row.TaggedValues{0: types.Int(2), 1: types.String("Tim"), 2: types.String("Sehn"), 3: types.String("789 Not Real Ct")})),
mustRow(row.New(types.Format_Default, AddAddrAt3HistSch, row.TaggedValues{0: types.Int(3), 1: types.String("Zach"), 2: types.String("Musgrave")})),
mustRow(row.New(types.Format_Default, AddAddrAt3HistSch, row.TaggedValues{0: types.Int(4), 1: types.String("Matt"), 2: types.String("Jesuele")})),
),
ExpectedSchema: AddAddrAt3HistSch,
},
@@ -876,11 +876,11 @@ var AsOfTests = []SelectTest{
Name: "select * from master^",
Query: "select * from test_table as of 'master^'",
ExpectedRows: ToSqlRows(AddAddrAt3HistSch,
mustRow(row.New(types.Format_7_18, AddAddrAt3HistSch, row.TaggedValues{0: types.Int(0), 1: types.String("Aaron"), 2: types.String("Son"), 3: types.String("123 Fake St")})),
mustRow(row.New(types.Format_7_18, AddAddrAt3HistSch, row.TaggedValues{0: types.Int(1), 1: types.String("Brian"), 2: types.String("Hendriks"), 3: types.String("456 Bull Ln")})),
mustRow(row.New(types.Format_7_18, AddAddrAt3HistSch, row.TaggedValues{0: types.Int(2), 1: types.String("Tim"), 2: types.String("Sehn"), 3: types.String("789 Not Real Ct")})),
mustRow(row.New(types.Format_7_18, AddAddrAt3HistSch, row.TaggedValues{0: types.Int(3), 1: types.String("Zach"), 2: types.String("Musgrave")})),
mustRow(row.New(types.Format_7_18, AddAddrAt3HistSch, row.TaggedValues{0: types.Int(4), 1: types.String("Matt"), 2: types.String("Jesuele")})),
mustRow(row.New(types.Format_Default, AddAddrAt3HistSch, row.TaggedValues{0: types.Int(0), 1: types.String("Aaron"), 2: types.String("Son"), 3: types.String("123 Fake St")})),
mustRow(row.New(types.Format_Default, AddAddrAt3HistSch, row.TaggedValues{0: types.Int(1), 1: types.String("Brian"), 2: types.String("Hendriks"), 3: types.String("456 Bull Ln")})),
mustRow(row.New(types.Format_Default, AddAddrAt3HistSch, row.TaggedValues{0: types.Int(2), 1: types.String("Tim"), 2: types.String("Sehn"), 3: types.String("789 Not Real Ct")})),
mustRow(row.New(types.Format_Default, AddAddrAt3HistSch, row.TaggedValues{0: types.Int(3), 1: types.String("Zach"), 2: types.String("Musgrave")})),
mustRow(row.New(types.Format_Default, AddAddrAt3HistSch, row.TaggedValues{0: types.Int(4), 1: types.String("Matt"), 2: types.String("Jesuele")})),
),
ExpectedSchema: AddAddrAt3HistSch,
},
@@ -889,12 +889,12 @@ var AsOfTests = []SelectTest{
Name: "select * from timestamp after HEAD",
Query: "select * from test_table as of CONVERT('1970-01-01 10:00:00', DATETIME)",
ExpectedRows: ToSqlRows(ReaddAgeAt5HistSch,
mustRow(row.New(types.Format_7_18, ReaddAgeAt5HistSch, row.TaggedValues{0: types.Int(0), 1: types.String("Aaron"), 2: types.String("Son"), 3: types.String("123 Fake St"), 5: types.Uint(35)})),
mustRow(row.New(types.Format_7_18, ReaddAgeAt5HistSch, row.TaggedValues{0: types.Int(1), 1: types.String("Brian"), 2: types.String("Hendriks"), 3: types.String("456 Bull Ln"), 5: types.Uint(38)})),
mustRow(row.New(types.Format_7_18, ReaddAgeAt5HistSch, row.TaggedValues{0: types.Int(2), 1: types.String("Tim"), 2: types.String("Sehn"), 3: types.String("789 Not Real Ct"), 5: types.Uint(37)})),
mustRow(row.New(types.Format_7_18, ReaddAgeAt5HistSch, row.TaggedValues{0: types.Int(3), 1: types.String("Zach"), 2: types.String("Musgrave"), 3: types.String("-1 Imaginary Wy"), 5: types.Uint(37)})),
mustRow(row.New(types.Format_7_18, ReaddAgeAt5HistSch, row.TaggedValues{0: types.Int(4), 1: types.String("Matt"), 2: types.String("Jesuele")})),
mustRow(row.New(types.Format_7_18, ReaddAgeAt5HistSch, row.TaggedValues{0: types.Int(5), 1: types.String("Daylon"), 2: types.String("Wilkins")})),
mustRow(row.New(types.Format_Default, ReaddAgeAt5HistSch, row.TaggedValues{0: types.Int(0), 1: types.String("Aaron"), 2: types.String("Son"), 3: types.String("123 Fake St"), 5: types.Uint(35)})),
mustRow(row.New(types.Format_Default, ReaddAgeAt5HistSch, row.TaggedValues{0: types.Int(1), 1: types.String("Brian"), 2: types.String("Hendriks"), 3: types.String("456 Bull Ln"), 5: types.Uint(38)})),
mustRow(row.New(types.Format_Default, ReaddAgeAt5HistSch, row.TaggedValues{0: types.Int(2), 1: types.String("Tim"), 2: types.String("Sehn"), 3: types.String("789 Not Real Ct"), 5: types.Uint(37)})),
mustRow(row.New(types.Format_Default, ReaddAgeAt5HistSch, row.TaggedValues{0: types.Int(3), 1: types.String("Zach"), 2: types.String("Musgrave"), 3: types.String("-1 Imaginary Wy"), 5: types.Uint(37)})),
mustRow(row.New(types.Format_Default, ReaddAgeAt5HistSch, row.TaggedValues{0: types.Int(4), 1: types.String("Matt"), 2: types.String("Jesuele")})),
mustRow(row.New(types.Format_Default, ReaddAgeAt5HistSch, row.TaggedValues{0: types.Int(5), 1: types.String("Daylon"), 2: types.String("Wilkins")})),
),
ExpectedSchema: ReaddAgeAt5HistSch,
},
@@ -902,12 +902,12 @@ var AsOfTests = []SelectTest{
Name: "select * from timestamp, HEAD exact",
Query: "select * from test_table as of CONVERT('1970-01-01 08:00:00', DATETIME)",
ExpectedRows: ToSqlRows(ReaddAgeAt5HistSch,
mustRow(row.New(types.Format_7_18, ReaddAgeAt5HistSch, row.TaggedValues{0: types.Int(0), 1: types.String("Aaron"), 2: types.String("Son"), 3: types.String("123 Fake St"), 5: types.Uint(35)})),
mustRow(row.New(types.Format_7_18, ReaddAgeAt5HistSch, row.TaggedValues{0: types.Int(1), 1: types.String("Brian"), 2: types.String("Hendriks"), 3: types.String("456 Bull Ln"), 5: types.Uint(38)})),
mustRow(row.New(types.Format_7_18, ReaddAgeAt5HistSch, row.TaggedValues{0: types.Int(2), 1: types.String("Tim"), 2: types.String("Sehn"), 3: types.String("789 Not Real Ct"), 5: types.Uint(37)})),
mustRow(row.New(types.Format_7_18, ReaddAgeAt5HistSch, row.TaggedValues{0: types.Int(3), 1: types.String("Zach"), 2: types.String("Musgrave"), 3: types.String("-1 Imaginary Wy"), 5: types.Uint(37)})),
mustRow(row.New(types.Format_7_18, ReaddAgeAt5HistSch, row.TaggedValues{0: types.Int(4), 1: types.String("Matt"), 2: types.String("Jesuele")})),
mustRow(row.New(types.Format_7_18, ReaddAgeAt5HistSch, row.TaggedValues{0: types.Int(5), 1: types.String("Daylon"), 2: types.String("Wilkins")})),
mustRow(row.New(types.Format_Default, ReaddAgeAt5HistSch, row.TaggedValues{0: types.Int(0), 1: types.String("Aaron"), 2: types.String("Son"), 3: types.String("123 Fake St"), 5: types.Uint(35)})),
mustRow(row.New(types.Format_Default, ReaddAgeAt5HistSch, row.TaggedValues{0: types.Int(1), 1: types.String("Brian"), 2: types.String("Hendriks"), 3: types.String("456 Bull Ln"), 5: types.Uint(38)})),
mustRow(row.New(types.Format_Default, ReaddAgeAt5HistSch, row.TaggedValues{0: types.Int(2), 1: types.String("Tim"), 2: types.String("Sehn"), 3: types.String("789 Not Real Ct"), 5: types.Uint(37)})),
mustRow(row.New(types.Format_Default, ReaddAgeAt5HistSch, row.TaggedValues{0: types.Int(3), 1: types.String("Zach"), 2: types.String("Musgrave"), 3: types.String("-1 Imaginary Wy"), 5: types.Uint(37)})),
mustRow(row.New(types.Format_Default, ReaddAgeAt5HistSch, row.TaggedValues{0: types.Int(4), 1: types.String("Matt"), 2: types.String("Jesuele")})),
mustRow(row.New(types.Format_Default, ReaddAgeAt5HistSch, row.TaggedValues{0: types.Int(5), 1: types.String("Daylon"), 2: types.String("Wilkins")})),
),
ExpectedSchema: ReaddAgeAt5HistSch,
},
@@ -915,11 +915,11 @@ var AsOfTests = []SelectTest{
Name: "select * from timestamp, HEAD~ + 1",
Query: "select * from test_table as of CONVERT('1970-01-01 07:00:00', DATETIME)",
ExpectedRows: ToSqlRows(AddAddrAt3HistSch,
mustRow(row.New(types.Format_7_18, AddAddrAt3HistSch, row.TaggedValues{0: types.Int(0), 1: types.String("Aaron"), 2: types.String("Son"), 3: types.String("123 Fake St")})),
mustRow(row.New(types.Format_7_18, AddAddrAt3HistSch, row.TaggedValues{0: types.Int(1), 1: types.String("Brian"), 2: types.String("Hendriks"), 3: types.String("456 Bull Ln")})),
mustRow(row.New(types.Format_7_18, AddAddrAt3HistSch, row.TaggedValues{0: types.Int(2), 1: types.String("Tim"), 2: types.String("Sehn"), 3: types.String("789 Not Real Ct")})),
mustRow(row.New(types.Format_7_18, AddAddrAt3HistSch, row.TaggedValues{0: types.Int(3), 1: types.String("Zach"), 2: types.String("Musgrave")})),
mustRow(row.New(types.Format_7_18, AddAddrAt3HistSch, row.TaggedValues{0: types.Int(4), 1: types.String("Matt"), 2: types.String("Jesuele")})),
mustRow(row.New(types.Format_Default, AddAddrAt3HistSch, row.TaggedValues{0: types.Int(0), 1: types.String("Aaron"), 2: types.String("Son"), 3: types.String("123 Fake St")})),
mustRow(row.New(types.Format_Default, AddAddrAt3HistSch, row.TaggedValues{0: types.Int(1), 1: types.String("Brian"), 2: types.String("Hendriks"), 3: types.String("456 Bull Ln")})),
mustRow(row.New(types.Format_Default, AddAddrAt3HistSch, row.TaggedValues{0: types.Int(2), 1: types.String("Tim"), 2: types.String("Sehn"), 3: types.String("789 Not Real Ct")})),
mustRow(row.New(types.Format_Default, AddAddrAt3HistSch, row.TaggedValues{0: types.Int(3), 1: types.String("Zach"), 2: types.String("Musgrave")})),
mustRow(row.New(types.Format_Default, AddAddrAt3HistSch, row.TaggedValues{0: types.Int(4), 1: types.String("Matt"), 2: types.String("Jesuele")})),
),
ExpectedSchema: AddAddrAt3HistSch,
},
@@ -927,11 +927,11 @@ var AsOfTests = []SelectTest{
Name: "select * from timestamp, HEAD~",
Query: "select * from test_table as of CONVERT('1970-01-01 06:00:00', DATETIME)",
ExpectedRows: ToSqlRows(AddAddrAt3HistSch,
mustRow(row.New(types.Format_7_18, AddAddrAt3HistSch, row.TaggedValues{0: types.Int(0), 1: types.String("Aaron"), 2: types.String("Son"), 3: types.String("123 Fake St")})),
mustRow(row.New(types.Format_7_18, AddAddrAt3HistSch, row.TaggedValues{0: types.Int(1), 1: types.String("Brian"), 2: types.String("Hendriks"), 3: types.String("456 Bull Ln")})),
mustRow(row.New(types.Format_7_18, AddAddrAt3HistSch, row.TaggedValues{0: types.Int(2), 1: types.String("Tim"), 2: types.String("Sehn"), 3: types.String("789 Not Real Ct")})),
mustRow(row.New(types.Format_7_18, AddAddrAt3HistSch, row.TaggedValues{0: types.Int(3), 1: types.String("Zach"), 2: types.String("Musgrave")})),
mustRow(row.New(types.Format_7_18, AddAddrAt3HistSch, row.TaggedValues{0: types.Int(4), 1: types.String("Matt"), 2: types.String("Jesuele")})),
mustRow(row.New(types.Format_Default, AddAddrAt3HistSch, row.TaggedValues{0: types.Int(0), 1: types.String("Aaron"), 2: types.String("Son"), 3: types.String("123 Fake St")})),
mustRow(row.New(types.Format_Default, AddAddrAt3HistSch, row.TaggedValues{0: types.Int(1), 1: types.String("Brian"), 2: types.String("Hendriks"), 3: types.String("456 Bull Ln")})),
mustRow(row.New(types.Format_Default, AddAddrAt3HistSch, row.TaggedValues{0: types.Int(2), 1: types.String("Tim"), 2: types.String("Sehn"), 3: types.String("789 Not Real Ct")})),
mustRow(row.New(types.Format_Default, AddAddrAt3HistSch, row.TaggedValues{0: types.Int(3), 1: types.String("Zach"), 2: types.String("Musgrave")})),
mustRow(row.New(types.Format_Default, AddAddrAt3HistSch, row.TaggedValues{0: types.Int(4), 1: types.String("Matt"), 2: types.String("Jesuele")})),
),
ExpectedSchema: AddAddrAt3HistSch,
},

View File

@@ -55,7 +55,7 @@ var id2, _ = uuid.NewRandom()
var id3, _ = uuid.NewRandom()
func TestIndexEditorConcurrency(t *testing.T) {
format := types.Format_7_18
format := types.Format_Default
db, err := dbfactory.MemFactory{}.CreateDB(context.Background(), format, nil, nil)
require.NoError(t, err)
colColl := schema.NewColCollection(
@@ -142,7 +142,7 @@ func TestIndexEditorConcurrency(t *testing.T) {
}
func TestIndexEditorConcurrencyPostInsert(t *testing.T) {
format := types.Format_7_18
format := types.Format_Default
db, err := dbfactory.MemFactory{}.CreateDB(context.Background(), format, nil, nil)
require.NoError(t, err)
colColl := schema.NewColCollection(
@@ -226,7 +226,7 @@ func TestIndexEditorConcurrencyPostInsert(t *testing.T) {
}
func TestIndexEditorConcurrencyUnique(t *testing.T) {
format := types.Format_7_18
format := types.Format_Default
db, err := dbfactory.MemFactory{}.CreateDB(context.Background(), format, nil, nil)
require.NoError(t, err)
colColl := schema.NewColCollection(
@@ -313,7 +313,7 @@ func TestIndexEditorConcurrencyUnique(t *testing.T) {
}
func TestIndexEditorUniqueMultipleNil(t *testing.T) {
format := types.Format_7_18
format := types.Format_Default
db, err := dbfactory.MemFactory{}.CreateDB(context.Background(), format, nil, nil)
require.NoError(t, err)
colColl := schema.NewColCollection(
@@ -355,7 +355,7 @@ func TestIndexEditorUniqueMultipleNil(t *testing.T) {
}
func TestIndexEditorWriteAfterFlush(t *testing.T) {
format := types.Format_7_18
format := types.Format_Default
db, err := dbfactory.MemFactory{}.CreateDB(context.Background(), format, nil, nil)
require.NoError(t, err)
colColl := schema.NewColCollection(
@@ -417,7 +417,7 @@ func TestIndexEditorWriteAfterFlush(t *testing.T) {
}
func TestIndexEditorFlushClearsUniqueError(t *testing.T) {
format := types.Format_7_18
format := types.Format_Default
db, err := dbfactory.MemFactory{}.CreateDB(context.Background(), format, nil, nil)
require.NoError(t, err)
colColl := schema.NewColCollection(
@@ -451,7 +451,7 @@ func TestIndexEditorFlushClearsUniqueError(t *testing.T) {
}
func TestIndexRebuildingWithZeroIndexes(t *testing.T) {
db, _ := dbfactory.MemFactory{}.CreateDB(context.Background(), types.Format_7_18, nil, nil)
db, _ := dbfactory.MemFactory{}.CreateDB(context.Background(), types.Format_Default, nil, nil)
tSchema := createTestSchema(t)
_, err := tSchema.Indexes().RemoveIndex(testSchemaIndexName)
require.NoError(t, err)
@@ -474,7 +474,7 @@ func TestIndexRebuildingWithZeroIndexes(t *testing.T) {
}
func TestIndexRebuildingWithOneIndex(t *testing.T) {
db, _ := dbfactory.MemFactory{}.CreateDB(context.Background(), types.Format_7_18, nil, nil)
db, _ := dbfactory.MemFactory{}.CreateDB(context.Background(), types.Format_Default, nil, nil)
tSchema := createTestSchema(t)
_, err := tSchema.Indexes().RemoveIndex(testSchemaIndexAge)
require.NoError(t, err)
@@ -493,7 +493,7 @@ func TestIndexRebuildingWithOneIndex(t *testing.T) {
require.True(t, ok)
indexKey[tag] = val
}
indexExpectedRows[i], err = row.New(types.Format_7_18, indexSch, indexKey)
indexExpectedRows[i], err = row.New(types.Format_Default, indexSch, indexKey)
require.NoError(t, err)
}
@@ -527,7 +527,7 @@ func TestIndexRebuildingWithOneIndex(t *testing.T) {
}
func TestIndexRebuildingWithTwoIndexes(t *testing.T) {
db, _ := dbfactory.MemFactory{}.CreateDB(context.Background(), types.Format_7_18, nil, nil)
db, _ := dbfactory.MemFactory{}.CreateDB(context.Background(), types.Format_Default, nil, nil)
tSchema := createTestSchema(t)
indexName := tSchema.Indexes().GetByName(testSchemaIndexName)
@@ -652,7 +652,7 @@ func TestIndexRebuildingWithTwoIndexes(t *testing.T) {
}
func TestIndexRebuildingUniqueSuccessOneCol(t *testing.T) {
db, _ := dbfactory.MemFactory{}.CreateDB(context.Background(), types.Format_7_18, nil, nil)
db, _ := dbfactory.MemFactory{}.CreateDB(context.Background(), types.Format_Default, nil, nil)
colColl := schema.NewColCollection(
schema.NewColumn("pk1", 1, types.IntKind, true, schema.NotNullConstraint{}),
schema.NewColumn("v1", 2, types.IntKind, false),
@@ -683,7 +683,7 @@ func TestIndexRebuildingUniqueSuccessOneCol(t *testing.T) {
}
func TestIndexRebuildingUniqueSuccessTwoCol(t *testing.T) {
db, _ := dbfactory.MemFactory{}.CreateDB(context.Background(), types.Format_7_18, nil, nil)
db, _ := dbfactory.MemFactory{}.CreateDB(context.Background(), types.Format_Default, nil, nil)
colColl := schema.NewColCollection(
schema.NewColumn("pk1", 1, types.IntKind, true, schema.NotNullConstraint{}),
schema.NewColumn("v1", 2, types.IntKind, false),
@@ -714,7 +714,7 @@ func TestIndexRebuildingUniqueSuccessTwoCol(t *testing.T) {
}
func TestIndexRebuildingUniqueFailOneCol(t *testing.T) {
db, _ := dbfactory.MemFactory{}.CreateDB(context.Background(), types.Format_7_18, nil, nil)
db, _ := dbfactory.MemFactory{}.CreateDB(context.Background(), types.Format_Default, nil, nil)
colColl := schema.NewColCollection(
schema.NewColumn("pk1", 1, types.IntKind, true, schema.NotNullConstraint{}),
schema.NewColumn("v1", 2, types.IntKind, false),
@@ -745,7 +745,7 @@ func TestIndexRebuildingUniqueFailOneCol(t *testing.T) {
}
func TestIndexRebuildingUniqueFailTwoCol(t *testing.T) {
db, _ := dbfactory.MemFactory{}.CreateDB(context.Background(), types.Format_7_18, nil, nil)
db, _ := dbfactory.MemFactory{}.CreateDB(context.Background(), types.Format_Default, nil, nil)
colColl := schema.NewColCollection(
schema.NewColumn("pk1", 1, types.IntKind, true, schema.NotNullConstraint{}),
schema.NewColumn("v1", 2, types.IntKind, false),
@@ -811,7 +811,7 @@ func createTestRowDataFromTaggedValues(t *testing.T, vrw types.ValueReadWriter,
ed := m.Edit()
for i, val := range vals {
r, err := row.New(types.Format_7_18, sch, val)
r, err := row.New(types.Format_Default, sch, val)
require.NoError(t, err)
rows[i] = r
ed = ed.Set(r.NomsMapKey(sch), r.NomsMapValue(sch))
@@ -859,7 +859,7 @@ func rowsToIndexRows(t *testing.T, rows []row.Row, indexName schema.Index, index
require.True(t, ok)
indexNameKey[tag] = val
}
indexNameExpectedRows[i], err = row.New(types.Format_7_18, indexNameSch, indexNameKey)
indexNameExpectedRows[i], err = row.New(types.Format_Default, indexNameSch, indexNameKey)
require.NoError(t, err)
indexAgeKey := make(row.TaggedValues)
@@ -868,7 +868,7 @@ func rowsToIndexRows(t *testing.T, rows []row.Row, indexName schema.Index, index
require.True(t, ok)
indexAgeKey[tag] = val
}
indexAgeExpectedRows[i], err = row.New(types.Format_7_18, indexAgeSch, indexAgeKey)
indexAgeExpectedRows[i], err = row.New(types.Format_Default, indexAgeSch, indexAgeKey)
require.NoError(t, err)
}
return

View File

@@ -42,7 +42,7 @@ const (
)
func TestTableEditorConcurrency(t *testing.T) {
format := types.Format_7_18
format := types.Format_Default
db, err := dbfactory.MemFactory{}.CreateDB(context.Background(), format, nil, nil)
require.NoError(t, err)
colColl := schema.NewColCollection(
@@ -138,7 +138,7 @@ func TestTableEditorConcurrency(t *testing.T) {
}
func TestTableEditorConcurrencyPostInsert(t *testing.T) {
format := types.Format_7_18
format := types.Format_Default
db, err := dbfactory.MemFactory{}.CreateDB(context.Background(), format, nil, nil)
require.NoError(t, err)
colColl := schema.NewColCollection(
@@ -232,7 +232,7 @@ func TestTableEditorConcurrencyPostInsert(t *testing.T) {
}
func TestTableEditorWriteAfterFlush(t *testing.T) {
format := types.Format_7_18
format := types.Format_Default
db, err := dbfactory.MemFactory{}.CreateDB(context.Background(), format, nil, nil)
require.NoError(t, err)
colColl := schema.NewColCollection(
@@ -303,7 +303,7 @@ func TestTableEditorWriteAfterFlush(t *testing.T) {
}
func TestTableEditorDuplicateKeyHandling(t *testing.T) {
format := types.Format_7_18
format := types.Format_Default
db, err := dbfactory.MemFactory{}.CreateDB(context.Background(), format, nil, nil)
require.NoError(t, err)
colColl := schema.NewColCollection(

View File

@@ -29,7 +29,7 @@ func TestBadRow(t *testing.T) {
sch, err := schema.SchemaFromCols(cols)
assert.NoError(t, err)
emptyRow, err := row.New(types.Format_7_18, sch, row.TaggedValues{})
emptyRow, err := row.New(types.Format_Default, sch, row.TaggedValues{})
assert.NoError(t, err)
err = NewBadRow(emptyRow, "details")

View File

@@ -52,19 +52,19 @@ func mustRow(r row.Row, err error) row.Row {
// These are in noms-key-sorted order, since InMemoryTable.AppendRow sorts its rows. This should probably be done
// programatically instead of hard-coded.
var rows = []row.Row{
mustRow(row.New(types.Format_7_18, rowSch, row.TaggedValues{
mustRow(row.New(types.Format_Default, rowSch, row.TaggedValues{
nameTag: types.String("Bill Billerson"),
ageTag: types.Uint(32),
titleTag: types.String("Senior Dufus"),
greatTag: types.Bool(true),
})),
mustRow(row.New(types.Format_7_18, rowSch, row.TaggedValues{
mustRow(row.New(types.Format_Default, rowSch, row.TaggedValues{
nameTag: types.String("John Johnson"),
ageTag: types.Uint(21),
titleTag: types.String("Intern Dufus"),
greatTag: types.Bool(true),
})),
mustRow(row.New(types.Format_7_18, rowSch, row.TaggedValues{
mustRow(row.New(types.Format_Default, rowSch, row.TaggedValues{
nameTag: types.String("Rob Robertson"),
ageTag: types.Uint(25),
titleTag: types.String("Dufus"),

View File

@@ -26,7 +26,7 @@ import (
func TestTransformRowFailure(t *testing.T) {
_, sch := untyped.NewUntypedSchema("a", "b", "c")
r, err := untyped.NewRowFromStrings(types.Format_7_18, sch, []string{"1", "2", "3"})
r, err := untyped.NewRowFromStrings(types.Format_Default, sch, []string{"1", "2", "3"})
assert.NoError(t, err)

View File

@@ -85,7 +85,7 @@ func TestPipeline(t *testing.T) {
func() {
csvInfo := &csv.CSVFileInfo{Delim: ",", HasHeaderLine: true, Columns: nil, EscapeQuotes: true}
rd, _ := csv.NewCSVReader(types.Format_7_18, ioutil.NopCloser(buf), csvInfo)
rd, _ := csv.NewCSVReader(types.Format_Default, ioutil.NopCloser(buf), csvInfo)
wr, _ := csv.NewCSVWriter(iohelp.NopWrCloser(outBuf), schOut, csvInfo)
tc := NewTransformCollection(
@@ -123,7 +123,7 @@ func TestAddingStages(t *testing.T) {
func() {
csvInfo := &csv.CSVFileInfo{Delim: ",", HasHeaderLine: true, Columns: nil, EscapeQuotes: true}
rd, _ := csv.NewCSVReader(types.Format_7_18, ioutil.NopCloser(buf), csvInfo)
rd, _ := csv.NewCSVReader(types.Format_Default, ioutil.NopCloser(buf), csvInfo)
wr, _ := csv.NewCSVWriter(iohelp.NopWrCloser(outBuf), schOut, csvInfo)
tc := NewTransformCollection(
@@ -193,7 +193,7 @@ Don,Beddoe,Bewitched (episode Humbug Not to Be Spoken Here - Season 4),1967,true
func() {
csvInfo := &csv.CSVFileInfo{Delim: ",", HasHeaderLine: true, Columns: nil, EscapeQuotes: true}
rd, _ := csv.NewCSVReader(types.Format_7_18, ioutil.NopCloser(buf), csvInfo)
rd, _ := csv.NewCSVReader(types.Format_Default, ioutil.NopCloser(buf), csvInfo)
wr, _ := csv.NewCSVWriter(iohelp.NopWrCloser(outBuf), schOut, csvInfo)
addedStages := []NamedTransform{
@@ -227,7 +227,7 @@ Don,Beddoe,Bewitched (episode Humbug Not to Be Spoken Here - Season 4),1967,true
4: "true",
5: "0",
}
injectedRow, err := untyped.NewRowFromTaggedStrings(types.Format_7_18, schOut, injectedColumns)
injectedRow, err := untyped.NewRowFromTaggedStrings(types.Format_Default, schOut, injectedColumns)
assert.NoError(t, err)
p.InjectRow("append", injectedRow)
@@ -240,7 +240,7 @@ Don,Beddoe,Bewitched (episode Humbug Not to Be Spoken Here - Season 4),1967,true
4: "true",
5: "1",
}
injectedRow, err = untyped.NewRowFromTaggedStrings(types.Format_7_18, schOut, injectedColumns)
injectedRow, err = untyped.NewRowFromTaggedStrings(types.Format_Default, schOut, injectedColumns)
assert.NoError(t, err)
p.InjectRow("append", injectedRow)
@@ -281,7 +281,7 @@ func TestAbort(t *testing.T) {
func() {
csvInfo := &csv.CSVFileInfo{Delim: ",", HasHeaderLine: true, Columns: nil, EscapeQuotes: true}
rd, _ := csv.NewCSVReader(types.Format_7_18, ioutil.NopCloser(buf), csvInfo)
rd, _ := csv.NewCSVReader(types.Format_Default, ioutil.NopCloser(buf), csvInfo)
wr, _ := csv.NewCSVWriter(iohelp.NopWrCloser(outBuf), schOut, csvInfo)
var wg = sync.WaitGroup{}

View File

@@ -74,7 +74,7 @@ func createRows(t *testing.T, onlyUpdated, updatedAge bool) []row.Row {
titleColTag: types.String(titles[i]),
}
r, err := row.New(types.Format_7_18, sch, rowVals)
r, err := row.New(types.Format_Default, sch, rowVals)
assert.NoError(t, err)
rows = append(rows, r)
@@ -85,7 +85,7 @@ func createRows(t *testing.T, onlyUpdated, updatedAge bool) []row.Row {
}
func TestReadWrite(t *testing.T) {
db, _ := dbfactory.MemFactory{}.CreateDB(context.Background(), types.Format_7_18, nil, nil)
db, _ := dbfactory.MemFactory{}.CreateDB(context.Background(), types.Format_Default, nil, nil)
rows := createRows(t, false, false)

View File

@@ -71,15 +71,15 @@ func TestReader(t *testing.T) {
colNames := []string{"name", "age", "title"}
_, sch := untyped.NewUntypedSchema(colNames...)
goodExpectedRows := []row.Row{
mustRow(untyped.NewRowFromStrings(types.Format_7_18, sch, []string{"Bill Billerson", "32", "Senior Dufus"})),
mustRow(untyped.NewRowFromStrings(types.Format_7_18, sch, []string{"Rob Robertson", "25", "Assistant, Dufus"})),
mustRow(untyped.NewRowFromStrings(types.Format_7_18, sch, []string{"Jack Jackson", "27"})),
mustRow(untyped.NewRowFromStrings(types.Format_7_18, sch, []string{"John Johnson", "21", "Intern\nDufus"})),
mustRow(untyped.NewRowFromStrings(types.Format_Default, sch, []string{"Bill Billerson", "32", "Senior Dufus"})),
mustRow(untyped.NewRowFromStrings(types.Format_Default, sch, []string{"Rob Robertson", "25", "Assistant, Dufus"})),
mustRow(untyped.NewRowFromStrings(types.Format_Default, sch, []string{"Jack Jackson", "27"})),
mustRow(untyped.NewRowFromStrings(types.Format_Default, sch, []string{"John Johnson", "21", "Intern\nDufus"})),
}
badExpectedRows := []row.Row{
mustRow(untyped.NewRowFromStrings(types.Format_7_18, sch, []string{"Bill Billerson", "32", "Senior Dufus"})),
mustRow(untyped.NewRowFromStrings(types.Format_7_18, sch, []string{"Rob Robertson", "25", "Dufus"})),
mustRow(untyped.NewRowFromStrings(types.Format_7_18, sch, []string{"Jack Jackson", "27"})),
mustRow(untyped.NewRowFromStrings(types.Format_Default, sch, []string{"Bill Billerson", "32", "Senior Dufus"})),
mustRow(untyped.NewRowFromStrings(types.Format_Default, sch, []string{"Rob Robertson", "25", "Dufus"})),
mustRow(untyped.NewRowFromStrings(types.Format_Default, sch, []string{"Jack Jackson", "27"})),
}
tests := []struct {
@@ -141,7 +141,7 @@ func readTestRows(t *testing.T, inputStr string, info *CSVFileInfo) ([]row.Row,
const path = "/file.csv"
fs := filesys.NewInMemFS(nil, map[string][]byte{path: []byte(inputStr)}, root)
csvR, err := OpenCSVReader(types.Format_7_18, path, fs, info)
csvR, err := OpenCSVReader(types.Format_Default, path, fs, info)
defer csvR.Close(context.Background())
if err != nil {

View File

@@ -45,19 +45,19 @@ func getSampleRows() (rows []row.Row) {
colColl := schema.NewColCollection(inCols...)
rowSch := schema.MustSchemaFromCols(colColl)
return []row.Row{
mustRow(row.New(types.Format_7_18, rowSch, row.TaggedValues{
mustRow(row.New(types.Format_Default, rowSch, row.TaggedValues{
nameColTag: types.String("Bill Billerson"),
ageColTag: types.Uint(32),
titleColTag: types.String("Senior Dufus")})),
mustRow(row.New(types.Format_7_18, rowSch, row.TaggedValues{
mustRow(row.New(types.Format_Default, rowSch, row.TaggedValues{
nameColTag: types.String("Rob Robertson"),
ageColTag: types.Uint(25),
titleColTag: types.String("Dufus")})),
mustRow(row.New(types.Format_7_18, rowSch, row.TaggedValues{
mustRow(row.New(types.Format_Default, rowSch, row.TaggedValues{
nameColTag: types.String("John Johnson"),
ageColTag: types.Uint(21),
titleColTag: types.String("")})),
mustRow(row.New(types.Format_7_18, rowSch, row.TaggedValues{
mustRow(row.New(types.Format_Default, rowSch, row.TaggedValues{
nameColTag: types.String("Andy Anderson"),
ageColTag: types.Uint(27),
/* title = NULL */})),

View File

@@ -101,7 +101,7 @@ func testSchema() schema.Schema {
func testRow(t *testing.T, col1, col2 string) pipeline.RowWithProps {
taggedVals := row.TaggedValues{0: types.String(col1), 1: types.String(col2)}
r, err := row.New(types.Format_7_18, testSchema(), taggedVals)
r, err := row.New(types.Format_Default, testSchema(), taggedVals)
assert.NoError(t, err)
return pipeline.RowWithProps{Row: r, Props: pipeline.NoProps}
}

View File

@@ -82,7 +82,7 @@ func TestWriter(t *testing.T) {
rows := make([]row.Row, len(ages))
for i := range ages {
var err error
rows[i], err = row.New(types.Format_7_18, rowSch, row.TaggedValues{
rows[i], err = row.New(types.Format_Default, rowSch, row.TaggedValues{
nameColTag: types.String(names[i]),
ageColTag: types.String(ages[i]),
titleColTag: types.String(titles[i]),
@@ -249,7 +249,7 @@ func TestEastAsianLanguages(t *testing.T) {
rows := make([]row.Row, len(ages))
for i := range ages {
var err error
rows[i], err = row.New(types.Format_7_18, rowSch, row.TaggedValues{
rows[i], err = row.New(types.Format_Default, rowSch, row.TaggedValues{
nameColTag: types.String(names[i]),
ageColTag: types.String(ages[i]),
titleColTag: types.String(titles[i]),

View File

@@ -75,7 +75,7 @@ func TestNewUntypedSchema(t *testing.T) {
name := "Billy Bob"
city := "Fargo"
blurb := "Billy Bob is a scholar."
r, err := NewRowFromStrings(types.Format_7_18, sch, []string{name, city, blurb})
r, err := NewRowFromStrings(types.Format_Default, sch, []string{name, city, blurb})
assert.NoError(t, err)
nameVal, _ := r.GetColVal(nameToTag["name"])