mirror of
https://github.com/dolthub/dolt.git
synced 2026-04-24 03:16:12 -05:00
cleanup remaining references to __DOLT_1__
This commit is contained in:
@@ -52,7 +52,7 @@ func (cmd *DumpDocsCmd) Description() string {
|
||||
}
|
||||
|
||||
func (cmd *DumpDocsCmd) GatedForNBF(nbf *types.NomsBinFormat) bool {
|
||||
return types.IsFormat_DOLT_1(nbf)
|
||||
return types.IsFormat_DOLT(nbf)
|
||||
}
|
||||
|
||||
// Hidden should return true if this command should be hidden from the help text
|
||||
|
||||
@@ -59,7 +59,7 @@ func (cmd InspectCmd) Description() string {
|
||||
}
|
||||
|
||||
func (cmd InspectCmd) GatedForNBF(nbf *types.NomsBinFormat) bool {
|
||||
return types.IsFormat_DOLT_1(nbf)
|
||||
return types.IsFormat_DOLT(nbf)
|
||||
}
|
||||
|
||||
func (cmd InspectCmd) Docs() *cli.CommandDocumentation {
|
||||
|
||||
@@ -57,7 +57,7 @@ func (cmd ReadTablesCmd) Description() string {
|
||||
}
|
||||
|
||||
func (cmd ReadTablesCmd) GatedForNBF(nbf *types.NomsBinFormat) bool {
|
||||
return types.IsFormat_DOLT_1(nbf)
|
||||
return types.IsFormat_DOLT(nbf)
|
||||
}
|
||||
|
||||
func (cmd ReadTablesCmd) Docs() *cli.CommandDocumentation {
|
||||
|
||||
@@ -52,7 +52,7 @@ func Summary(ctx context.Context, ch chan DiffSummaryProgress, from, to durable.
|
||||
return fmt.Errorf("cannot perform a diff between keyless and keyed schema")
|
||||
}
|
||||
|
||||
if types.IsFormat_DOLT_1(from.Format()) {
|
||||
if types.IsFormat_DOLT(from.Format()) {
|
||||
return diffProllyTrees(ctx, ch, keyless, from, to, fromSch, toSch)
|
||||
}
|
||||
|
||||
@@ -80,7 +80,7 @@ func SummaryForTableDelta(ctx context.Context, ch chan DiffSummaryProgress, td T
|
||||
return err
|
||||
}
|
||||
|
||||
if types.IsFormat_DOLT_1(td.Format()) {
|
||||
if types.IsFormat_DOLT(td.Format()) {
|
||||
return diffProllyTrees(ctx, ch, keyless, fromRows, toRows, fromSch, toSch)
|
||||
} else {
|
||||
return diffNomsMaps(ctx, ch, keyless, fromRows, toRows)
|
||||
|
||||
@@ -962,7 +962,7 @@ func (t doltDevTable) GetConflicts(ctx context.Context) (conflict.ConflictSchema
|
||||
// GetArtifacts implements Table.
|
||||
func (t doltDevTable) GetArtifacts(ctx context.Context) (ArtifactIndex, error) {
|
||||
if t.Format() != types.Format_DOLT {
|
||||
panic("artifacts only implemented for DOLT_1")
|
||||
panic("artifacts only implemented for DOLT")
|
||||
}
|
||||
|
||||
sch, err := t.GetSchema(ctx)
|
||||
@@ -981,7 +981,7 @@ func (t doltDevTable) GetArtifacts(ctx context.Context) (ArtifactIndex, error) {
|
||||
// SetArtifacts implements Table.
|
||||
func (t doltDevTable) SetArtifacts(ctx context.Context, artifacts ArtifactIndex) (Table, error) {
|
||||
if t.Format() != types.Format_DOLT {
|
||||
panic("artifacts only implemented for DOLT_1")
|
||||
panic("artifacts only implemented for DOLT")
|
||||
}
|
||||
|
||||
var addr hash.Hash
|
||||
|
||||
@@ -60,7 +60,7 @@ func TestForeignKeyErrors(t *testing.T) {
|
||||
}
|
||||
|
||||
func skipNewFormat(t *testing.T) {
|
||||
if types.IsFormat_DOLT_1(types.Format_Default) {
|
||||
if types.IsFormat_DOLT(types.Format_Default) {
|
||||
t.Skip()
|
||||
}
|
||||
}
|
||||
|
||||
@@ -300,7 +300,7 @@ func TestKeylessMergeConflicts(t *testing.T) {
|
||||
}
|
||||
|
||||
func assertConflicts(t *testing.T, ctx context.Context, tbl *doltdb.Table, expected conflictEntries) {
|
||||
if types.IsFormat_DOLT_1(tbl.Format()) {
|
||||
if types.IsFormat_DOLT(tbl.Format()) {
|
||||
assertProllyConflicts(t, ctx, tbl, expected)
|
||||
return
|
||||
}
|
||||
@@ -406,7 +406,7 @@ func mustGetRowValueFromRootIsh(t *testing.T, ctx context.Context, vrw types.Val
|
||||
|
||||
// |expected| is a tupleSet to compensate for random storage order
|
||||
func assertKeylessRows(t *testing.T, ctx context.Context, tbl *doltdb.Table, expected keylessEntries) {
|
||||
if types.IsFormat_DOLT_1(tbl.Format()) {
|
||||
if types.IsFormat_DOLT(tbl.Format()) {
|
||||
assertKeylessProllyRows(t, ctx, tbl, expected)
|
||||
return
|
||||
}
|
||||
|
||||
@@ -89,7 +89,7 @@ func MergeRoots(
|
||||
var conflictStash *conflictStash
|
||||
var violationStash *violationStash
|
||||
var err error
|
||||
if !types.IsFormat_DOLT_1(ourRoot.VRW().Format()) {
|
||||
if !types.IsFormat_DOLT(ourRoot.VRW().Format()) {
|
||||
ourRoot, conflictStash, err = stashConflicts(ctx, ourRoot)
|
||||
if err != nil {
|
||||
return nil, nil, err
|
||||
@@ -189,7 +189,7 @@ func MergeRoots(
|
||||
return nil, nil, err
|
||||
}
|
||||
|
||||
if types.IsFormat_DOLT_1(ourRoot.VRW().Format()) {
|
||||
if types.IsFormat_DOLT(ourRoot.VRW().Format()) {
|
||||
err = getConstraintViolationStats(ctx, mergedRoot, tblToStats)
|
||||
if err != nil {
|
||||
return nil, nil, err
|
||||
|
||||
@@ -134,7 +134,7 @@ func (rm *RootMerger) MergeTable(ctx context.Context, tblName string, opts edito
|
||||
return nil, nil, err
|
||||
}
|
||||
|
||||
if types.IsFormat_DOLT_1(mergeTbl.Format()) {
|
||||
if types.IsFormat_DOLT(mergeTbl.Format()) {
|
||||
mergeTbl, err = mergeTableArtifacts(ctx, tm, mergeTbl)
|
||||
if err != nil {
|
||||
return nil, nil, err
|
||||
|
||||
@@ -302,7 +302,7 @@ var testRows = []testRow{
|
||||
}
|
||||
|
||||
func TestMergeCommits(t *testing.T) {
|
||||
if !types.IsFormat_DOLT_1(types.Format_Default) {
|
||||
if !types.IsFormat_DOLT(types.Format_Default) {
|
||||
t.Skip()
|
||||
}
|
||||
|
||||
@@ -355,7 +355,7 @@ func TestMergeCommits(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestNomsMergeCommits(t *testing.T) {
|
||||
if types.IsFormat_DOLT_1(types.Format_Default) {
|
||||
if types.IsFormat_DOLT(types.Format_Default) {
|
||||
t.Skip()
|
||||
}
|
||||
|
||||
|
||||
@@ -196,7 +196,7 @@ func ArePrimaryKeySetsDiffable(format *types.NomsBinFormat, fromSch, toSch Schem
|
||||
if (c1.Tag != c2.Tag) || (c1.IsPartOfPK != c2.IsPartOfPK) {
|
||||
return false
|
||||
}
|
||||
if types.IsFormat_DOLT_1(format) && !c1.TypeInfo.ToSqlType().Equals(c2.TypeInfo.ToSqlType()) {
|
||||
if types.IsFormat_DOLT(format) && !c1.TypeInfo.ToSqlType().Equals(c2.TypeInfo.ToSqlType()) {
|
||||
return false
|
||||
}
|
||||
}
|
||||
|
||||
@@ -35,7 +35,7 @@ func NewConflictsTable(ctx *sql.Context, tblName string, root *doltdb.RootValue,
|
||||
return nil, sql.ErrTableNotFound.New(tblName)
|
||||
}
|
||||
|
||||
if types.IsFormat_DOLT_1(tbl.Format()) {
|
||||
if types.IsFormat_DOLT(tbl.Format()) {
|
||||
return newProllyConflictsTable(ctx, tbl, tblName, root, rs)
|
||||
}
|
||||
|
||||
|
||||
@@ -300,7 +300,7 @@ func (dp DiffPartition) Key() []byte {
|
||||
}
|
||||
|
||||
func (dp DiffPartition) GetRowIter(ctx *sql.Context, ddb *doltdb.DoltDB, joiner *rowconv.Joiner, lookup sql.IndexLookup) (sql.RowIter, error) {
|
||||
if types.IsFormat_DOLT_1(ddb.Format()) {
|
||||
if types.IsFormat_DOLT(ddb.Format()) {
|
||||
return newProllyDiffIter(ctx, dp, ddb, dp.fromSch, dp.toSch)
|
||||
} else {
|
||||
return newNomsDiffIter(ctx, ddb, joiner, dp, lookup)
|
||||
|
||||
@@ -166,7 +166,7 @@ func newQueryCatalogEntry(ctx context.Context, root *doltdb.RootValue, id, name,
|
||||
|
||||
var sq SavedQuery
|
||||
var newTable *doltdb.Table
|
||||
if types.IsFormat_DOLT_1(tbl.Format()) {
|
||||
if types.IsFormat_DOLT(tbl.Format()) {
|
||||
sq, newTable, err = newQueryCatalogEntryProlly(ctx, tbl, id, name, query, description)
|
||||
} else {
|
||||
sq, newTable, err = newQueryCatalogEntryNoms(ctx, tbl, id, name, query, description)
|
||||
@@ -298,7 +298,7 @@ func RetrieveFromQueryCatalog(ctx context.Context, root *doltdb.RootValue, id st
|
||||
return SavedQuery{}, doltdb.ErrTableNotFound
|
||||
}
|
||||
|
||||
if types.IsFormat_DOLT_1(tbl.Format()) {
|
||||
if types.IsFormat_DOLT(tbl.Format()) {
|
||||
return retrieveFromQueryCatalogProlly(ctx, tbl, id)
|
||||
}
|
||||
|
||||
|
||||
@@ -303,7 +303,7 @@ func TestInsertIgnoreInto(t *testing.T) {
|
||||
|
||||
// todo: merge this into the above test when https://github.com/dolthub/dolt/issues/3836 is fixed
|
||||
func TestIgnoreIntoWithDuplicateUniqueKeyKeyless(t *testing.T) {
|
||||
if !types.IsFormat_DOLT_1(types.Format_Default) {
|
||||
if !types.IsFormat_DOLT(types.Format_Default) {
|
||||
// todo: fix https://github.com/dolthub/dolt/issues/3836
|
||||
t.Skip()
|
||||
}
|
||||
@@ -360,7 +360,7 @@ func TestTruncate(t *testing.T) {
|
||||
|
||||
func TestScripts(t *testing.T) {
|
||||
var skipped []string
|
||||
if types.IsFormat_DOLT_1(types.Format_Default) {
|
||||
if types.IsFormat_DOLT(types.Format_Default) {
|
||||
skipped = append(skipped, newFormatSkippedScripts...)
|
||||
}
|
||||
enginetest.TestScripts(t, newDoltHarness(t).WithSkippedQueries(skipped))
|
||||
@@ -748,7 +748,7 @@ func TestDoltMerge(t *testing.T) {
|
||||
enginetest.TestScript(t, newDoltHarness(t), script)
|
||||
}
|
||||
|
||||
if types.IsFormat_DOLT_1(types.Format_Default) {
|
||||
if types.IsFormat_DOLT(types.Format_Default) {
|
||||
for _, script := range Dolt1MergeScripts {
|
||||
enginetest.TestScript(t, newDoltHarness(t), script)
|
||||
}
|
||||
@@ -763,7 +763,7 @@ func TestDoltConflictsTableNameTable(t *testing.T) {
|
||||
|
||||
// tests new format behavior for keyless merges that create CVs and conflicts
|
||||
func TestKeylessDoltMergeCVsAndConflicts(t *testing.T) {
|
||||
if !types.IsFormat_DOLT_1(types.Format_Default) {
|
||||
if !types.IsFormat_DOLT(types.Format_Default) {
|
||||
t.Skip()
|
||||
}
|
||||
for _, script := range KeylessMergeCVsAndConflictsScripts {
|
||||
@@ -773,7 +773,7 @@ func TestKeylessDoltMergeCVsAndConflicts(t *testing.T) {
|
||||
|
||||
// eventually this will be part of TestDoltMerge
|
||||
func TestDoltMergeArtifacts(t *testing.T) {
|
||||
if !types.IsFormat_DOLT_1(types.Format_Default) {
|
||||
if !types.IsFormat_DOLT(types.Format_Default) {
|
||||
t.Skip()
|
||||
}
|
||||
for _, script := range MergeArtifactsScripts {
|
||||
@@ -784,7 +784,7 @@ func TestDoltMergeArtifacts(t *testing.T) {
|
||||
// these tests are temporary while there is a difference between the old format
|
||||
// and new format merge behaviors.
|
||||
func TestOldFormatMergeConflictsAndCVs(t *testing.T) {
|
||||
if types.IsFormat_DOLT_1(types.Format_Default) {
|
||||
if types.IsFormat_DOLT(types.Format_Default) {
|
||||
t.Skip()
|
||||
}
|
||||
for _, script := range OldFormatMergeConflictsAndCVsScripts {
|
||||
@@ -971,7 +971,7 @@ func TestDiffSystemTable(t *testing.T) {
|
||||
})
|
||||
}
|
||||
|
||||
if types.IsFormat_DOLT_1(types.Format_Default) {
|
||||
if types.IsFormat_DOLT(types.Format_Default) {
|
||||
for _, test := range Dolt1DiffSystemTableScripts {
|
||||
enginetest.TestScript(t, newDoltHarness(t), test)
|
||||
}
|
||||
@@ -1065,7 +1065,7 @@ func TestDeleteQueriesPrepared(t *testing.T) {
|
||||
|
||||
func TestScriptsPrepared(t *testing.T) {
|
||||
var skipped []string
|
||||
if types.IsFormat_DOLT_1(types.Format_Default) {
|
||||
if types.IsFormat_DOLT(types.Format_Default) {
|
||||
skipped = append(skipped, newFormatSkippedScripts...)
|
||||
}
|
||||
skipPreparedTests(t)
|
||||
@@ -1318,7 +1318,7 @@ var newFormatSkippedScripts = []string{
|
||||
}
|
||||
|
||||
func skipOldFormat(t *testing.T) {
|
||||
if !types.IsFormat_DOLT_1(types.Format_Default) {
|
||||
if !types.IsFormat_DOLT(types.Format_Default) {
|
||||
t.Skip()
|
||||
}
|
||||
}
|
||||
|
||||
@@ -45,7 +45,7 @@ func ValidateDatabase(ctx context.Context, db sql.Database) (err error) {
|
||||
}
|
||||
|
||||
func ValidateDoltDatabase(ctx context.Context, db sqle.Database) (err error) {
|
||||
if !types.IsFormat_DOLT_1(db.GetDoltDB().Format()) {
|
||||
if !types.IsFormat_DOLT(db.GetDoltDB().Format()) {
|
||||
return nil
|
||||
}
|
||||
for _, stage := range validationStages {
|
||||
|
||||
@@ -270,7 +270,7 @@ func (s *durableIndexState) coversAllColumns(i *doltIndex) bool {
|
||||
}
|
||||
cols := i.Schema().GetAllCols()
|
||||
var idxCols *schema.ColCollection
|
||||
if types.IsFormat_DOLT_1(i.Format()) {
|
||||
if types.IsFormat_DOLT(i.Format()) {
|
||||
// prolly indexes can cover an index lookup using
|
||||
// both the key and value fields of the index,
|
||||
// this allows using covering index machinery for
|
||||
@@ -402,7 +402,7 @@ func (di *doltIndex) NewLookup(ctx *sql.Context, ranges ...sql.Range) (sql.Index
|
||||
return nil, nil
|
||||
}
|
||||
|
||||
if types.IsFormat_DOLT_1(di.vrw.Format()) {
|
||||
if types.IsFormat_DOLT(di.vrw.Format()) {
|
||||
return di.newProllyLookup(ctx, di.ns, ranges...)
|
||||
}
|
||||
|
||||
@@ -606,7 +606,7 @@ func (di *doltIndex) coversColumns(s *durableIndexState, cols []uint64) bool {
|
||||
}
|
||||
|
||||
var idxCols *schema.ColCollection
|
||||
if types.IsFormat_DOLT_1(di.Format()) {
|
||||
if types.IsFormat_DOLT(di.Format()) {
|
||||
// prolly indexes can cover an index lookup using
|
||||
// both the key and value fields of the index,
|
||||
// this allows using covering index machinery for
|
||||
@@ -741,7 +741,7 @@ func (di *doltIndex) keysToTuple(ctx *sql.Context, keys []interface{}) (types.Tu
|
||||
var sharePool = pool.NewBuffPool()
|
||||
|
||||
func maybeGetKeyBuilder(idx durable.Index) *val.TupleBuilder {
|
||||
if types.IsFormat_DOLT_1(idx.Format()) {
|
||||
if types.IsFormat_DOLT(idx.Format()) {
|
||||
kd, _ := durable.ProllyMapFromIndex(idx).Descriptors()
|
||||
return val.NewTupleBuilder(kd)
|
||||
}
|
||||
|
||||
@@ -33,7 +33,7 @@ func PartitionIndexedTableRows(ctx *sql.Context, idx sql.Index, part sql.Partiti
|
||||
rp := part.(rangePartition)
|
||||
doltIdx := idx.(DoltIndex)
|
||||
|
||||
if types.IsFormat_DOLT_1(rp.durableState.Primary.Format()) {
|
||||
if types.IsFormat_DOLT(rp.durableState.Primary.Format()) {
|
||||
return RowIterForProllyRange(ctx, doltIdx, rp.prollyRange, pkSch, columns, rp.durableState)
|
||||
}
|
||||
|
||||
@@ -50,7 +50,7 @@ func RowIterForIndexLookup(ctx *sql.Context, t DoltTableable, ilu sql.IndexLooku
|
||||
return nil, err
|
||||
}
|
||||
|
||||
if types.IsFormat_DOLT_1(idx.Format()) {
|
||||
if types.IsFormat_DOLT(idx.Format()) {
|
||||
if len(lookup.prollyRanges) > 1 {
|
||||
return nil, fmt.Errorf("expected a single index range")
|
||||
}
|
||||
@@ -126,7 +126,7 @@ func (itr *rangePartitionIter) Close(*sql.Context) error {
|
||||
|
||||
// Next returns the next partition if there is one, or io.EOF if there isn't.
|
||||
func (itr *rangePartitionIter) Next(_ *sql.Context) (sql.Partition, error) {
|
||||
if types.IsFormat_DOLT_1(itr.durableState.Secondary.Format()) {
|
||||
if types.IsFormat_DOLT(itr.durableState.Secondary.Format()) {
|
||||
return itr.nextProllyPartition()
|
||||
}
|
||||
return itr.nextNomsPartition()
|
||||
|
||||
@@ -75,7 +75,7 @@ func newRowIterator(ctx context.Context, tbl *doltdb.Table, sqlSch sql.Schema, p
|
||||
return nil, err
|
||||
}
|
||||
|
||||
if types.IsFormat_DOLT_1(tbl.Format()) {
|
||||
if types.IsFormat_DOLT(tbl.Format()) {
|
||||
return ProllyRowIterFromPartition(ctx, sch, sqlSch, projCols, partition)
|
||||
}
|
||||
|
||||
|
||||
@@ -224,7 +224,7 @@ func nextSchemasTableIndex(ctx *sql.Context, root *doltdb.RootValue) (int64, err
|
||||
return 1, nil
|
||||
}
|
||||
|
||||
if types.IsFormat_DOLT_1(tbl.Format()) {
|
||||
if types.IsFormat_DOLT(tbl.Format()) {
|
||||
p := durable.ProllyMapFromIndex(rows)
|
||||
key, _, err := p.Last(ctx)
|
||||
if err != nil {
|
||||
|
||||
@@ -1217,7 +1217,7 @@ func (t *AlterableDoltTable) isIncompatibleTypeChange(oldColumn *sql.Column, new
|
||||
}
|
||||
|
||||
if !existingCol.TypeInfo.Equals(newCol.TypeInfo) {
|
||||
if types.IsFormat_DOLT_1(t.Format()) {
|
||||
if types.IsFormat_DOLT(t.Format()) {
|
||||
// This is overly broad, we could narrow this down a bit
|
||||
return true
|
||||
}
|
||||
@@ -1522,7 +1522,7 @@ func (t *AlterableDoltTable) adjustForeignKeysForDroppedPk(ctx *sql.Context, roo
|
||||
|
||||
// DropColumn implements sql.AlterableTable
|
||||
func (t *AlterableDoltTable) DropColumn(ctx *sql.Context, columnName string) error {
|
||||
if types.IsFormat_DOLT_1(t.nbf) {
|
||||
if types.IsFormat_DOLT(t.nbf) {
|
||||
return nil
|
||||
}
|
||||
|
||||
@@ -2624,7 +2624,7 @@ func (t *AlterableDoltTable) constraintNameExists(ctx *sql.Context, name string)
|
||||
}
|
||||
|
||||
func (t *AlterableDoltTable) CreatePrimaryKey(ctx *sql.Context, columns []sql.IndexColumn) error {
|
||||
if types.IsFormat_DOLT_1(t.nbf) {
|
||||
if types.IsFormat_DOLT(t.nbf) {
|
||||
return nil
|
||||
}
|
||||
|
||||
@@ -2658,7 +2658,7 @@ func (t *AlterableDoltTable) CreatePrimaryKey(ctx *sql.Context, columns []sql.In
|
||||
}
|
||||
|
||||
func (t *AlterableDoltTable) DropPrimaryKey(ctx *sql.Context) error {
|
||||
if types.IsFormat_DOLT_1(t.nbf) {
|
||||
if types.IsFormat_DOLT(t.nbf) {
|
||||
return nil
|
||||
}
|
||||
|
||||
|
||||
@@ -70,7 +70,7 @@ var _ WriteSession = &nomsWriteSession{}
|
||||
// locations that do not have a root at the time of this call. However, a root must be set through SetRoot before any
|
||||
// table editors are returned.
|
||||
func NewWriteSession(nbf *types.NomsBinFormat, ws *doltdb.WorkingSet, tracker globalstate.AutoIncrementTracker, opts editor.Options) WriteSession {
|
||||
if types.IsFormat_DOLT_1(nbf) {
|
||||
if types.IsFormat_DOLT(nbf) {
|
||||
return &prollyWriteSession{
|
||||
workingSet: ws,
|
||||
tables: make(map[string]*prollyTableWriter),
|
||||
|
||||
@@ -62,7 +62,7 @@ func (i rowIterImpl) Close(ctx context.Context) error {
|
||||
// |offset| can be supplied to read at some start point in |idx|.
|
||||
func NewTableIterator(ctx context.Context, sch schema.Schema, idx durable.Index, offset uint64) (RowIter, error) {
|
||||
var rowItr sql.RowIter
|
||||
if types.IsFormat_DOLT_1(idx.Format()) {
|
||||
if types.IsFormat_DOLT(idx.Format()) {
|
||||
m := durable.ProllyMapFromIndex(idx)
|
||||
itr, err := m.IterOrdinalRange(ctx, offset, uint64(m.Count()))
|
||||
if err != nil {
|
||||
|
||||
@@ -64,7 +64,7 @@ func isFormat_7_18(nbf *NomsBinFormat) bool {
|
||||
return nbf.tag == formatTag_7_18
|
||||
}
|
||||
|
||||
func IsFormat_DOLT_1(nbf *NomsBinFormat) bool {
|
||||
func IsFormat_DOLT(nbf *NomsBinFormat) bool {
|
||||
return nbf.tag == formatTag_DOLT
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user