diff --git a/go/cmd/dolt/commands/add.go b/go/cmd/dolt/commands/add.go index 8c10f621632..09cb0da5c34 100644 --- a/go/cmd/dolt/commands/add.go +++ b/go/cmd/dolt/commands/add.go @@ -181,7 +181,7 @@ func patchWorkflow(sqlCtx *sql.Context, queryist cli.Queryist, tables []string) } for _, r := range rows { - tbl := r[0].(string) + tbl := r.GetValue(0).(string) tables = append(tables, tbl) } } @@ -301,8 +301,8 @@ func queryForUnstagedChanges(sqlCtx *sql.Context, queryist cli.Queryist, tables changeCounts[tableName] = &tablePatchInfo{} for _, row := range rows { - diffType := row[0].(string) - count, err := coerceToInt(row[1]) + diffType := row.GetValue(0).(string) + count, err := coerceToInt(row.GetValue(1)) if err != nil { return nil, err } @@ -344,12 +344,12 @@ func queryForUnstagedChanges(sqlCtx *sql.Context, queryist cli.Queryist, tables if len(rows) != 1 { return nil, errors.New("Expected one row") } - firstId, err := coerceToInt(rows[0][0]) + firstId, err := coerceToInt(rows[0].GetValue(0)) if err != nil { return nil, err } changeCounts[tableName].firstId = firstId - lastId, err := coerceToInt(rows[0][1]) + lastId, err := coerceToInt(rows[0].GetValue(1)) if err != nil { return nil, err } @@ -468,7 +468,7 @@ func (ps *patchState) skipRemainingInTable(c *ishell.Context) { // addRemainingInTable adds all changes in the current table. "a" command. func (ps *patchState) addRemainingInTable(c *ishell.Context) { // grab the row id. - id, err := coerceToInt(ps.currentRow[0]) + id, err := coerceToInt(ps.currentRow.GetValue(0)) if err != nil { ps.err = err c.Stop() @@ -609,20 +609,20 @@ func newState(sqlCtx *sql.Context, queryist cli.Queryist, tables []string) (*pat } func printSingleChange(sqlCtx *sql.Context, workspaceRow sql.Row, schema sql.Schema) (err error) { - writer := tabular.NewFixedWidthDiffTableWriter(schema, iohelp.NopWrCloser(cli.CliOut), len(workspaceRow)/2) + writer := tabular.NewFixedWidthDiffTableWriter(schema, iohelp.NopWrCloser(cli.CliOut), workspaceRow.Len()/2) defer writer.Close(sqlCtx.Context) - toRow := workspaceRow[3 : 3+len(schema)] - fromRow := workspaceRow[3+len(schema):] + toRow := workspaceRow.Subslice(3, 3+len(schema)) + fromRow := workspaceRow.Subslice(3+len(schema), workspaceRow.Len()) - diffType := workspaceRow[2].(string) + diffType := workspaceRow.GetValue(2).(string) switch diffType { case "added": - err = writer.WriteRow(sqlCtx.Context, toRow, diff.Added, colDiffType(diff.Added, len(toRow))) + err = writer.WriteRow(sqlCtx.Context, toRow, diff.Added, colDiffType(diff.Added, toRow.Len())) case "modified": err = writer.WriteCombinedRow(sqlCtx.Context, fromRow, toRow, diff.ModeContext) case "removed": - err = writer.WriteRow(sqlCtx.Context, fromRow, diff.Removed, colDiffType(diff.Removed, len(fromRow))) + err = writer.WriteRow(sqlCtx.Context, fromRow, diff.Removed, colDiffType(diff.Removed, fromRow.Len())) default: err = errors.New(fmt.Sprintf("Unexpected diff type: %s", diffType)) } diff --git a/go/cmd/dolt/commands/assist.go b/go/cmd/dolt/commands/assist.go index 04de9739dd5..da92fe9700c 100644 --- a/go/cmd/dolt/commands/assist.go +++ b/go/cmd/dolt/commands/assist.go @@ -596,7 +596,7 @@ func getCreateTableStatements(ctx *sql.Context, sqlEngine *engine.SqlEngine, dEn return "", err } - createTable := rows[0][1].(string) + createTable := rows[0].GetValue(1).(string) sb.WriteString(createTable) sb.WriteString("\n\n") } diff --git a/go/cmd/dolt/commands/branch.go b/go/cmd/dolt/commands/branch.go index c4377e75c03..65bddebb4e3 100644 --- a/go/cmd/dolt/commands/branch.go +++ b/go/cmd/dolt/commands/branch.go @@ -175,7 +175,7 @@ func getBranches(sqlCtx *sql.Context, queryEngine cli.Queryist, remote bool) ([] if err != nil { return nil, err } - if len(row) != 2 { + if row.Len() != 2 { return nil, fmt.Errorf("unexpectedly received multiple columns in '%s': %s", command, row) } diff --git a/go/cmd/dolt/commands/checkout.go b/go/cmd/dolt/commands/checkout.go index 8ebed49ebb2..d3ec135d51d 100644 --- a/go/cmd/dolt/commands/checkout.go +++ b/go/cmd/dolt/commands/checkout.go @@ -167,11 +167,11 @@ func (cmd CheckoutCmd) Exec(ctx context.Context, commandStr string, args []strin return HandleVErrAndExitCode(errhand.BuildDError("expected 1 row response from %s, got %d", sqlQuery, len(rows)).Build(), usage) } - if len(rows[0]) < 2 { + if rows[0].Len() < 2 { return HandleVErrAndExitCode(errhand.BuildDError("no 'message' field in response from %s", sqlQuery).Build(), usage) } - message, ok := rows[0][1].(string) + message, ok := rows[0].GetValue(1).(string) if !ok { return HandleVErrAndExitCode(errhand.BuildDError("expected string value for 'message' field in response from %s ", sqlQuery).Build(), usage) } diff --git a/go/cmd/dolt/commands/cherry-pick.go b/go/cmd/dolt/commands/cherry-pick.go index 69a40bb18bc..502ef9dd773 100644 --- a/go/cmd/dolt/commands/cherry-pick.go +++ b/go/cmd/dolt/commands/cherry-pick.go @@ -175,16 +175,16 @@ hint: commit your changes (dolt commit -am \"\") or reset them (dolt re succeeded := false commitHash := "" for _, row := range rows { - commitHash = row[0].(string) - dataConflicts, err := getInt64ColAsInt64(row[1]) + commitHash = row.GetValue(0).(string) + dataConflicts, err := getInt64ColAsInt64(row.GetValue(1)) if err != nil { return fmt.Errorf("Unable to parse data_conflicts column: %w", err) } - schemaConflicts, err := getInt64ColAsInt64(row[2]) + schemaConflicts, err := getInt64ColAsInt64(row.GetValue(2)) if err != nil { return fmt.Errorf("Unable to parse schema_conflicts column: %w", err) } - constraintViolations, err := getInt64ColAsInt64(row[3]) + constraintViolations, err := getInt64ColAsInt64(row.GetValue(3)) if err != nil { return fmt.Errorf("Unable to parse constraint_violations column: %w", err) } diff --git a/go/cmd/dolt/commands/cnfcmds/cat.go b/go/cmd/dolt/commands/cnfcmds/cat.go index 252393b3128..0488da73eef 100644 --- a/go/cmd/dolt/commands/cnfcmds/cat.go +++ b/go/cmd/dolt/commands/cnfcmds/cat.go @@ -298,15 +298,15 @@ func getMergeStatus(queryist cli.Queryist, sqlCtx *sql.Context) (mergeStatus, er } row := rows[0] - ms.isMerging, err = commands.GetTinyIntColAsBool(row[0]) + ms.isMerging, err = commands.GetTinyIntColAsBool(row.GetValue(0)) if err != nil { return ms, fmt.Errorf("error: failed to parse is_merging: %w", err) } if ms.isMerging { - ms.source = row[1].(string) - ms.sourceCommit = row[2].(string) - ms.target = row[3].(string) - unmergedTables := row[4].(string) + ms.source = row.GetValue(1).(string) + ms.sourceCommit = row.GetValue(2).(string) + ms.target = row.GetValue(3).(string) + unmergedTables := row.GetValue(4).(string) ms.unmergedTables = strings.Split(unmergedTables, ", ") } diff --git a/go/cmd/dolt/commands/cnfcmds/conflictsplitter.go b/go/cmd/dolt/commands/cnfcmds/conflictsplitter.go index 04e615c7a57..ba21ee57504 100644 --- a/go/cmd/dolt/commands/cnfcmds/conflictsplitter.go +++ b/go/cmd/dolt/commands/cnfcmds/conflictsplitter.go @@ -109,20 +109,20 @@ type conflictRow struct { } func (cs conflictSplitter) splitConflictRow(row sql.Row) ([]conflictRow, error) { - baseRow, ourRow, theirRow := make(sql.Row, len(cs.targetSch)), make(sql.Row, len(cs.targetSch)), make(sql.Row, len(cs.targetSch)) + baseRow, ourRow, theirRow := make(sql.UntypedSqlRow, len(cs.targetSch)), make(sql.UntypedSqlRow, len(cs.targetSch)), make(sql.UntypedSqlRow, len(cs.targetSch)) - ourDiffType := changeTypeFromString(row[cs.ourDiffTypeIdx].(string)) - theirDiffType := changeTypeFromString(row[cs.theirDiffTypeIdx].(string)) + ourDiffType := changeTypeFromString(row.GetValue(cs.ourDiffTypeIdx).(string)) + theirDiffType := changeTypeFromString(row.GetValue(cs.theirDiffTypeIdx).(string)) for from, to := range cs.baseToTarget { - baseRow[to] = row[from] + baseRow.SetValue(to, row.GetValue(from)) } if ourDiffType == diff.Removed { ourRow = baseRow } else { for from, to := range cs.ourToTarget { - ourRow[to] = row[from] + ourRow.SetValue(to, row.GetValue(from)) } } @@ -130,7 +130,7 @@ func (cs conflictSplitter) splitConflictRow(row sql.Row) ([]conflictRow, error) theirRow = baseRow } else { for from, to := range cs.theirToTarget { - theirRow[to] = row[from] + theirRow.SetValue(to, row.GetValue(from)) } } diff --git a/go/cmd/dolt/commands/commit.go b/go/cmd/dolt/commands/commit.go index 8fa442fba87..ce9b77ed23b 100644 --- a/go/cmd/dolt/commands/commit.go +++ b/go/cmd/dolt/commands/commit.go @@ -142,7 +142,7 @@ func performCommit(ctx context.Context, commandStr string, args []string, cliCtx cli.Println(err.Error()) return 1, false } - amendStr = row[0].(string) + amendStr = row.GetValue(0).(string) } msg, err = getCommitMessageFromEditor(sqlCtx, queryist, "", amendStr, false, cliCtx) if err != nil { @@ -463,7 +463,7 @@ func PrintDiffsNotStaged( } var conflictTables []string for i, _ := range conflictRows { - conflictTables = append(conflictTables, conflictRows[i][0].(string)) + conflictTables = append(conflictTables, conflictRows[i].GetValue(0).(string)) } inCnfSet := set.NewStrSet(conflictTables) @@ -478,7 +478,7 @@ func PrintDiffsNotStaged( } var schemaConflictTables []string for i, _ := range schemaConflictRows { - schemaConflictTables = append(schemaConflictTables, schemaConflictRows[i][0].(string)) + schemaConflictTables = append(schemaConflictTables, schemaConflictRows[i].GetValue(0).(string)) } inCnfSet.Add(schemaConflictTables...) @@ -493,7 +493,7 @@ func PrintDiffsNotStaged( } var constraintViolationTables []string for i, _ := range constraintViolationRows { - constraintViolationTables = append(constraintViolationTables, constraintViolationRows[i][0].(string)) + constraintViolationTables = append(constraintViolationTables, constraintViolationRows[i].GetValue(0).(string)) } violationSet := set.NewStrSet(constraintViolationTables) @@ -532,9 +532,9 @@ func PrintDiffsNotStaged( added := 0 removeModified := 0 for _, row := range notStagedRows { - if row[1] == "new table" { + if row.GetValue(1) == "new table" { added++ - } else if row[1] == "renamed" { + } else if row.GetValue(1) == "renamed" { added++ removeModified++ } else { @@ -633,17 +633,17 @@ func PrintDiffsNotStaged( func getModifiedAndRemovedNotStaged(notStagedRows []sql.Row, inCnfSet, violationSet *set.StrSet) (lines []string) { lines = make([]string, 0, len(notStagedRows)) for _, row := range notStagedRows { - if row[1] == "added" || inCnfSet.Contains(row[0].(string)) || violationSet.Contains(row[0].(string)) { + if row.GetValue(1) == "added" || inCnfSet.Contains(row.GetValue(0).(string)) || violationSet.Contains(row.GetValue(0).(string)) { continue } - if row[1] == "deleted" { - lines = append(lines, fmt.Sprintf(statusFmt, tblDiffTypeToLabel[diff.RemovedTable], row[0].(string))) - } else if row[1] == "renamed" { + if row.GetValue(1) == "deleted" { + lines = append(lines, fmt.Sprintf(statusFmt, tblDiffTypeToLabel[diff.RemovedTable], row.GetValue(0).(string))) + } else if row.GetValue(1) == "renamed" { // per Git, unstaged renames are shown as drop + add - names := strings.Split(row[0].(string), " -> ") + names := strings.Split(row.GetValue(0).(string), " -> ") lines = append(lines, fmt.Sprintf(statusFmt, tblDiffTypeToLabel[diff.RemovedTable], names[0])) } else { - lines = append(lines, fmt.Sprintf(statusFmt, tblDiffTypeToLabel[diff.ModifiedTable], row[0].(string))) + lines = append(lines, fmt.Sprintf(statusFmt, tblDiffTypeToLabel[diff.ModifiedTable], row.GetValue(0).(string))) } } return lines @@ -652,8 +652,8 @@ func getModifiedAndRemovedNotStaged(notStagedRows []sql.Row, inCnfSet, violation func getAddedNotStagedTables(notStagedRows []sql.Row) (tables []doltdb.TableName) { tables = make([]doltdb.TableName, 0, len(notStagedRows)) for _, row := range notStagedRows { - if row[1] == "added" || row[1] == "renamed" { - names := strings.Split(row[0].(string), " -> ") + if row.GetValue(1) == "added" || row.GetValue(1) == "renamed" { + names := strings.Split(row.GetValue(0).(string), " -> ") // TODO: schema name tables = append(tables, doltdb.TableName{Name: names[0]}) } @@ -713,17 +713,17 @@ func printStagedDiffs(wr io.Writer, stagedRows []sql.Row, printHelp bool) int { lines := make([]string, 0, len(stagedRows)) for _, row := range stagedRows { - if !doltdb.IsReadOnlySystemTable(doltdb.TableName{Name: row[0].(string)}) { - switch row[1].(string) { + if !doltdb.IsReadOnlySystemTable(doltdb.TableName{Name: row.GetValue(0).(string)}) { + switch row.GetValue(1).(string) { case "new table": - lines = append(lines, fmt.Sprintf(statusFmt, tblDiffTypeToLabel[diff.AddedTable], row[0].(string))) + lines = append(lines, fmt.Sprintf(statusFmt, tblDiffTypeToLabel[diff.AddedTable], row.GetValue(0).(string))) case "deleted": - lines = append(lines, fmt.Sprintf(statusFmt, tblDiffTypeToLabel[diff.RemovedTable], row[0].(string))) + lines = append(lines, fmt.Sprintf(statusFmt, tblDiffTypeToLabel[diff.RemovedTable], row.GetValue(0).(string))) case "renamed": - names := strings.Split(row[0].(string), " -> ") + names := strings.Split(row.GetValue(0).(string), " -> ") lines = append(lines, fmt.Sprintf(statusRenameFmt, tblDiffTypeToLabel[diff.RenamedTable], names[0], names[1])) default: - lines = append(lines, fmt.Sprintf(statusFmt, tblDiffTypeToLabel[diff.ModifiedTable], row[0].(string))) + lines = append(lines, fmt.Sprintf(statusFmt, tblDiffTypeToLabel[diff.ModifiedTable], row.GetValue(0).(string))) } } } diff --git a/go/cmd/dolt/commands/diff.go b/go/cmd/dolt/commands/diff.go index 98fbfdfc75a..6d2123f0622 100644 --- a/go/cmd/dolt/commands/diff.go +++ b/go/cmd/dolt/commands/diff.go @@ -376,8 +376,8 @@ func getTableNamesAtRef(queryist cli.Queryist, sqlCtx *sql.Context, ref string) tableNames := make(map[string]bool) for _, row := range rows { - tableName := row[0].(string) - tableType := row[1].(string) + tableName := row.GetValue(0).(string) + tableType := row.GetValue(1).(string) isTable := tableType == "BASE TABLE" if isTable { tableNames[tableName] = true @@ -528,7 +528,7 @@ func getCommonAncestor(queryist cli.Queryist, sqlCtx *sql.Context, c1, c2 string if len(rows) != 1 { return "", errors.New("unexpected number of rows returned from dolt_merge_base") } - ancestor := rows[0][0].(string) + ancestor := rows[0].GetValue(0).(string) return ancestor, nil } @@ -601,7 +601,7 @@ func printDiffSummary(ctx context.Context, diffSummaries []diff.TableDeltaSummar if diffSummary.DiffType == "renamed" { tableName = fmt.Sprintf("%s -> %s", diffSummary.FromTableName.Name, diffSummary.ToTableName.Name) } - err := wr.WriteSqlRow(ctx, sql.Row{tableName, diffSummary.DiffType, diffSummary.DataChange, diffSummary.SchemaChange}) + err := wr.WriteSqlRow(ctx, sql.UntypedSqlRow{tableName, diffSummary.DiffType, diffSummary.DataChange, diffSummary.SchemaChange}) if err != nil { return errhand.BuildDError("could not write table delta summary").AddCause(err).Build() } @@ -657,10 +657,10 @@ func getSchemaDiffSummariesBetweenRefs(queryist cli.Queryist, sqlCtx *sql.Contex var summaries []diff.TableDeltaSummary for _, row := range schemaDiffRows { - fromTable := row[0].(string) - toTable := row[1].(string) - fromCreateStmt := row[2].(string) - toCreateStmt := row[3].(string) + fromTable := row.GetValue(0).(string) + toTable := row.GetValue(1).(string) + fromCreateStmt := row.GetValue(2).(string) + toCreateStmt := row.GetValue(3).(string) var diffType = "" var tableName = "" switch { @@ -695,7 +695,7 @@ func getSchemaDiffSummariesBetweenRefs(queryist cli.Queryist, sqlCtx *sql.Contex } alterStmts := []string{} for _, row := range patchRows { - alterStmts = append(alterStmts, row[1].(string)) + alterStmts = append(alterStmts, row.GetValue(1).(string)) } summary := diff.TableDeltaSummary{ @@ -725,16 +725,16 @@ func getDiffSummariesBetweenRefs(queryist cli.Queryist, sqlCtx *sql.Context, fro for _, row := range dataDiffRows { summary := diff.TableDeltaSummary{} - summary.FromTableName.Name = row[0].(string) - summary.ToTableName.Name = row[1].(string) - summary.DiffType = row[2].(string) - summary.DataChange, err = GetTinyIntColAsBool(row[3]) + summary.FromTableName.Name = row.GetValue(0).(string) + summary.ToTableName.Name = row.GetValue(1).(string) + summary.DiffType = row.GetValue(2).(string) + summary.DataChange, err = GetTinyIntColAsBool(row.GetValue(3)) if err != nil { - return nil, fmt.Errorf("error: unable to parse data change value '%s': %w", row[3], err) + return nil, fmt.Errorf("error: unable to parse data change value '%s': %w", row.GetValue(3), err) } - summary.SchemaChange, err = GetTinyIntColAsBool(row[4]) + summary.SchemaChange, err = GetTinyIntColAsBool(row.GetValue(4)) if err != nil { - return nil, fmt.Errorf("error: unable to parse schema change value '%s': %w", row[4], err) + return nil, fmt.Errorf("error: unable to parse schema change value '%s': %w", row.GetValue(4), err) } switch summary.DiffType { @@ -883,7 +883,7 @@ func getTableSchemaAtRef(queryist cli.Queryist, sqlCtx *sql.Context, tableName s if len(rows) != 1 { return sch, createStmt, fmt.Errorf("creating schema, expected 1 row, got %d", len(rows)) } - createStmt = rows[0][1].(string) + createStmt = rows[0].GetValue(1).(string) // append ; at the end, if one isn't there yet if createStmt[len(createStmt)-1] != ';' { @@ -927,7 +927,7 @@ func getDatabaseSchemaAtRef(queryist cli.Queryist, sqlCtx *sql.Context, tableNam if len(rows) != 1 { return "", fmt.Errorf("creating schema, expected 1 row, got %d", len(rows)) } - createStmt := rows[0][1].(string) + createStmt := rows[0].GetValue(1).(string) // append ; at the end, if one isn't there yet if createStmt[len(createStmt)-1] != ';' { @@ -1022,53 +1022,53 @@ func getTableDiffStats(queryist cli.Queryist, sqlCtx *sql.Context, tableName, fr allStats := []diffStatistics{} for _, row := range rows { - rowsUnmodified, err := coallesceNilToUint64(row[1]) + rowsUnmodified, err := coallesceNilToUint64(row.GetValue(1)) if err != nil { return nil, err } - rowsAdded, err := coallesceNilToUint64(row[2]) + rowsAdded, err := coallesceNilToUint64(row.GetValue(2)) if err != nil { return nil, err } - rowsDeleted, err := coallesceNilToUint64(row[3]) + rowsDeleted, err := coallesceNilToUint64(row.GetValue(3)) if err != nil { return nil, err } - rowsModified, err := coallesceNilToUint64(row[4]) + rowsModified, err := coallesceNilToUint64(row.GetValue(4)) if err != nil { return nil, err } - cellsAdded, err := coallesceNilToUint64(row[5]) + cellsAdded, err := coallesceNilToUint64(row.GetValue(5)) if err != nil { return nil, err } - cellsDeleted, err := coallesceNilToUint64(row[6]) + cellsDeleted, err := coallesceNilToUint64(row.GetValue(6)) if err != nil { return nil, err } - cellsModified, err := coallesceNilToUint64(row[7]) + cellsModified, err := coallesceNilToUint64(row.GetValue(7)) if err != nil { return nil, err } - oldRowCount, err := coallesceNilToUint64(row[8]) + oldRowCount, err := coallesceNilToUint64(row.GetValue(8)) if err != nil { return nil, err } - newRowCount, err := coallesceNilToUint64(row[9]) + newRowCount, err := coallesceNilToUint64(row.GetValue(9)) if err != nil { return nil, err } - oldCellCount, err := coallesceNilToUint64(row[10]) + oldCellCount, err := coallesceNilToUint64(row.GetValue(10)) if err != nil { return nil, err } - newCellCount, err := coallesceNilToUint64(row[11]) + newCellCount, err := coallesceNilToUint64(row.GetValue(11)) if err != nil { return nil, err } stats := diffStatistics{ - TableName: row[0].(string), + TableName: row.GetValue(0).(string), RowsUnmodified: rowsUnmodified, RowsAdded: rowsAdded, RowsDeleted: rowsDeleted, @@ -1224,30 +1224,30 @@ func diffDoltSchemasTable( } var fragmentName string - if row[0] != nil { - fragmentName = row[0].(string) + if row.GetValue(0) != nil { + fragmentName = row.GetValue(0).(string) } else { - fragmentName = row[1].(string) + fragmentName = row.GetValue(1).(string) } var fragmentType string - if row[2] != nil { - fragmentType = row[2].(string) + if row.GetValue(2) != nil { + fragmentType = row.GetValue(2).(string) } else { - fragmentType = row[3].(string) + fragmentType = row.GetValue(3).(string) } var oldFragment string var newFragment string - if row[4] != nil { - oldFragment = row[4].(string) + if row.GetValue(4) != nil { + oldFragment = row.GetValue(4).(string) // Typically schema fragments have the semicolons stripped, so put it back on if len(oldFragment) > 0 && oldFragment[len(oldFragment)-1] != ';' { oldFragment += ";" } } - if row[5] != nil { - newFragment = row[5].(string) + if row.GetValue(5) != nil { + newFragment = row.GetValue(5).(string) // Typically schema fragments have the semicolons stripped, so put it back on if len(newFragment) > 0 && newFragment[len(newFragment)-1] != ';' { newFragment += ";" @@ -1674,14 +1674,14 @@ func writeDiffResults( var filteredOldRow, filteredNewRow diff.RowDiff for i, changeType := range newRow.ColDiffs { if (changeType == diff.Added|diff.Removed) || modifiedColNames[targetSch[i].Name] { - if i < len(oldRow.Row) { - filteredOldRow.Row = append(filteredOldRow.Row, oldRow.Row[i]) + if i < oldRow.Row.Len() { + filteredOldRow.Row = filteredOldRow.Row.Append(oldRow.Row.Subslice(i, i+1)) filteredOldRow.ColDiffs = append(filteredOldRow.ColDiffs, oldRow.ColDiffs[i]) filteredOldRow.RowDiff = oldRow.RowDiff } - if i < len(newRow.Row) { - filteredNewRow.Row = append(filteredNewRow.Row, newRow.Row[i]) + if i < newRow.Row.Len() { + filteredNewRow.Row = filteredNewRow.Row.Append(newRow.Row.Subslice(i, i+1)) filteredNewRow.ColDiffs = append(filteredNewRow.ColDiffs, newRow.ColDiffs[i]) filteredNewRow.RowDiff = newRow.RowDiff } diff --git a/go/cmd/dolt/commands/docscmds/write.go b/go/cmd/dolt/commands/docscmds/write.go index f9c53d780a0..113eea47e56 100644 --- a/go/cmd/dolt/commands/docscmds/write.go +++ b/go/cmd/dolt/commands/docscmds/write.go @@ -153,7 +153,7 @@ func readDocFromTableAsOf(ctx context.Context, eng *engine.SqlEngine, dbName, do return "", err } - doc = row[0].(string) + doc = row.GetValue(0).(string) _, eof := iter.Next(sctx) if eof != io.EOF && eof != nil { diff --git a/go/cmd/dolt/commands/dump.go b/go/cmd/dolt/commands/dump.go index b3194d06f2d..6ffca8bfa85 100644 --- a/go/cmd/dolt/commands/dump.go +++ b/go/cmd/dolt/commands/dump.go @@ -289,7 +289,7 @@ func dumpProcedures(sqlCtx *sql.Context, engine *engine.SqlEngine, root doltdb.R sqlMode := "" if sqlModeIdx >= 0 { - if s, ok := row[sqlModeIdx].(string); ok { + if s, ok := row.GetValue(sqlModeIdx).(string); ok { sqlMode = s } } @@ -304,7 +304,7 @@ func dumpProcedures(sqlCtx *sql.Context, engine *engine.SqlEngine, root doltdb.R return err } - err = iohelp.WriteLine(writer, fmt.Sprintf("%s;", row[stmtColIdx])) + err = iohelp.WriteLine(writer, fmt.Sprintf("%s;", row.GetValue(stmtColIdx))) if err != nil { return err } @@ -359,13 +359,13 @@ func dumpTriggers(sqlCtx *sql.Context, engine *engine.SqlEngine, root doltdb.Roo return err } - if row[typeColIdx] != "trigger" { + if row.GetValue(typeColIdx) != "trigger" { continue } sqlMode := "" if sqlModeIdx >= 0 { - if s, ok := row[sqlModeIdx].(string); ok { + if s, ok := row.GetValue(sqlModeIdx).(string); ok { sqlMode = s } } @@ -375,7 +375,7 @@ func dumpTriggers(sqlCtx *sql.Context, engine *engine.SqlEngine, root doltdb.Roo return err } - err = iohelp.WriteLine(writer, fmt.Sprintf("%s;", row[fragColIdx])) + err = iohelp.WriteLine(writer, fmt.Sprintf("%s;", row.GetValue(fragColIdx))) if err != nil { return err } @@ -426,13 +426,13 @@ func dumpViews(ctx *sql.Context, engine *engine.SqlEngine, root doltdb.RootValue return err } - if row[typeColIdx] != "view" { + if row.GetValue(typeColIdx) != "view" { continue } sqlMode := "" if sqlModeIdx >= 0 { - if s, ok := row[sqlModeIdx].(string); ok { + if s, ok := row.GetValue(sqlModeIdx).(string); ok { sqlMode = s } } @@ -440,7 +440,7 @@ func dumpViews(ctx *sql.Context, engine *engine.SqlEngine, root doltdb.RootValue sqlEngine := engine.GetUnderlyingEngine() binder := planbuilder.New(ctx, sqlEngine.Analyzer.Catalog, sqlEngine.EventScheduler, sqlEngine.Parser) binder.SetParserOptions(sql.NewSqlModeFromString(sqlMode).ParserOptions()) - cv, _, _, _, err := binder.Parse(row[fragColIdx].(string), nil, false) + cv, _, _, _, err := binder.Parse(row.GetValue(fragColIdx).(string), nil, false) if err != nil { return err } @@ -451,12 +451,12 @@ func dumpViews(ctx *sql.Context, engine *engine.SqlEngine, root doltdb.RootValue _, ok := cv.(*plan.CreateView) if ok { - err := iohelp.WriteLine(writer, fmt.Sprintf("%s;", row[fragColIdx])) + err := iohelp.WriteLine(writer, fmt.Sprintf("%s;", row.GetValue(fragColIdx))) if err != nil { return err } } else { - err := iohelp.WriteLine(writer, fmt.Sprintf("CREATE VIEW %s AS %s;", row[nameColIdx], row[fragColIdx])) + err := iohelp.WriteLine(writer, fmt.Sprintf("CREATE VIEW %s AS %s;", row.GetValue(nameColIdx), row.GetValue(fragColIdx))) if err != nil { return err } diff --git a/go/cmd/dolt/commands/engine/sql_print.go b/go/cmd/dolt/commands/engine/sql_print.go index e127f007bc8..c6cd577b50c 100644 --- a/go/cmd/dolt/commands/engine/sql_print.go +++ b/go/cmd/dolt/commands/engine/sql_print.go @@ -206,7 +206,7 @@ func printOKResult(ctx *sql.Context, iter sql.RowIter, start time.Time) error { return err } - if okResult, ok := row[0].(types.OkResult); ok { + if okResult, ok := row.GetValue(0).(types.OkResult); ok { rowNoun := "row" if okResult.RowsAffected != 1 { rowNoun = "rows" @@ -277,7 +277,7 @@ func (v *verticalRowWriter) WriteSqlRow(ctx context.Context, r sql.Row) error { return err } - for i := range r { + for i := 0; i < r.Len(); i++ { for numSpaces := 0; numSpaces < v.offsets[i]; numSpaces++ { _, err = v.wr.Write(space) if err != nil { @@ -287,10 +287,10 @@ func (v *verticalRowWriter) WriteSqlRow(ctx context.Context, r sql.Row) error { var str string - if r[i] == nil { + if r.GetValue(i) == nil { str = "NULL" } else { - str, err = sqlutil.SqlColToStr(v.sch[i].Type, r[i]) + str, err = sqlutil.SqlColToStr(v.sch[i].Type, r.GetValue(i)) if err != nil { return err } diff --git a/go/cmd/dolt/commands/log.go b/go/cmd/dolt/commands/log.go index bed423191f2..4b51327ab33 100644 --- a/go/cmd/dolt/commands/log.go +++ b/go/cmd/dolt/commands/log.go @@ -271,7 +271,7 @@ func getExistingTables(revisions []string, queryist cli.Queryist, sqlCtx *sql.Co return nil, err } for _, r := range rows { - tableNames[r[0].(string)] = true + tableNames[r.GetValue(0).(string)] = true } } @@ -286,7 +286,7 @@ func logCommits(apr *argparser.ArgParseResults, commitHashes []sql.Row, queryist var commitsInfo []CommitInfo for _, hash := range commitHashes { - cmHash := hash[0].(string) + cmHash := hash.GetValue(0).(string) commit, err := getCommitInfoWithOptions(queryist, sqlCtx, cmHash, opts) if commit == nil { return fmt.Errorf("no commits found for ref %s", cmHash) diff --git a/go/cmd/dolt/commands/ls.go b/go/cmd/dolt/commands/ls.go index bbdfddfceed..b446112567d 100644 --- a/go/cmd/dolt/commands/ls.go +++ b/go/cmd/dolt/commands/ls.go @@ -114,7 +114,7 @@ func (cmd LsCmd) Exec(ctx context.Context, commandStr string, args []string, dEn var userTables []string var systemTables []string for _, row := range rows { - tableName := row[0].(string) + tableName := row.GetValue(0).(string) if doltdb.HasDoltPrefix(tableName) || doltdb.HasDoltCIPrefix(tableName) { systemTables = append(systemTables, tableName) } else { @@ -172,7 +172,7 @@ func printUserTables(tableNames []string, apr *argparser.ArgParseResults, queryi if err != nil { return err } - label = row[0][0].(string) + label = row[0].GetValue(0).(string) } if len(tableNames) == 0 { @@ -202,13 +202,13 @@ func printTableVerbose(table string, queryist cli.Queryist, sqlCtx *sql.Context) return err } - if cnt, ok := row[0][0].(int64); ok { + if cnt, ok := row[0].GetValue(0).(int64); ok { cli.Println(fmt.Sprintf("\t%-20s %d rows", table, cnt)) - } else if cnt, ok := row[0][0].(string); ok { + } else if cnt, ok := row[0].GetValue(0).(string); ok { // remote execution returns result as a string cli.Println(fmt.Sprintf("\t%-20s %s rows", table, cnt)) } else { - return fmt.Errorf("unexpected type for count: %T", row[0][0]) + return fmt.Errorf("unexpected type for count: %T", row[0].GetValue(0)) } return nil diff --git a/go/cmd/dolt/commands/merge.go b/go/cmd/dolt/commands/merge.go index 7e901547bb3..afe8a7df930 100644 --- a/go/cmd/dolt/commands/merge.go +++ b/go/cmd/dolt/commands/merge.go @@ -415,9 +415,9 @@ func calculateMergeConflicts(queryist cli.Queryist, sqlCtx *sql.Context, mergeSt return nil, false, err } for _, conflict := range dataConflicts { - tableName := conflict[0].(string) + tableName := conflict.GetValue(0).(string) - cf, err := getInt64ColAsInt64(conflict[1]) + cf, err := getInt64ColAsInt64(conflict.GetValue(1)) if err != nil { return nil, false, err } @@ -434,7 +434,7 @@ func calculateMergeConflicts(queryist cli.Queryist, sqlCtx *sql.Context, mergeSt return nil, false, err } for _, conflict := range schemaConflicts { - tableName := conflict[0].(string) + tableName := conflict.GetValue(0).(string) if ok := mergeStats[tableName]; ok != nil { mergeStats[tableName].SchemaConflicts = 1 } else { @@ -447,9 +447,9 @@ func calculateMergeConflicts(queryist cli.Queryist, sqlCtx *sql.Context, mergeSt return nil, false, err } for _, conflict := range constraintViolations { - tableName := conflict[0].(string) + tableName := conflict.GetValue(0).(string) - cf, err := getInt64ColAsInt64(conflict[1]) + cf, err := getInt64ColAsInt64(conflict.GetValue(1)) if err != nil { return nil, false, err } @@ -680,8 +680,8 @@ func handleMergeErr(sqlCtx *sql.Context, queryist cli.Queryist, mergeErr error, return 1 } unmergedCnt := 0 - if unmergedTables[0][0] != nil { - tableNames := unmergedTables[0][0].(string) + if unmergedTables[0].GetValue(0) != nil { + tableNames := unmergedTables[0].GetValue(0).(string) unmergedCnt = len(strings.Split(tableNames, ", ")) } @@ -727,16 +727,16 @@ func everythingUpToDate(row sql.Row) (bool, error) { hashColumn := 0 msgColumn := 3 - if hash, ok := row[hashColumn].(string); ok { - if msg, ok := row[msgColumn].(string); ok { + if hash, ok := row.GetValue(hashColumn).(string); ok { + if msg, ok := row.GetValue(msgColumn).(string); ok { if hash == "" && msg == doltdb.ErrUpToDate.Error() { // "Everything up-to-date" message. return true, nil } } else { - return false, fmt.Errorf("Runtime error: merge operation returned unexpected message column type: %v", row[msgColumn]) + return false, fmt.Errorf("Runtime error: merge operation returned unexpected message column type: %v", row.GetValue(msgColumn)) } } else { - return false, fmt.Errorf("Runtime error: merge operation returned unexpected hash column type: %v", row[hashColumn]) + return false, fmt.Errorf("Runtime error: merge operation returned unexpected hash column type: %v", row.GetValue(hashColumn)) } return false, nil diff --git a/go/cmd/dolt/commands/merge_base.go b/go/cmd/dolt/commands/merge_base.go index 1577c4f80c7..e105a7051e1 100644 --- a/go/cmd/dolt/commands/merge_base.go +++ b/go/cmd/dolt/commands/merge_base.go @@ -92,7 +92,7 @@ func (cmd MergeBaseCmd) Exec(ctx context.Context, commandStr string, args []stri return HandleVErrAndExitCode(errhand.VerboseErrorFromError(err), usage) } - cli.Println(row[0][0].(string)) + cli.Println(row[0].GetValue(0).(string)) return 0 } diff --git a/go/cmd/dolt/commands/pull.go b/go/cmd/dolt/commands/pull.go index cc41604a806..eb509d41583 100644 --- a/go/cmd/dolt/commands/pull.go +++ b/go/cmd/dolt/commands/pull.go @@ -289,14 +289,14 @@ func getRemoteHashForPull(apr *argparser.ArgParseResults, sqlCtx *sql.Context, q return "", "", err } for _, row := range rows { - ref := row[0].(string) + ref := row.GetValue(0).(string) if ref == "remotes/"+remote+"/main" { branch = "main" break } } if branch == "" { - ref := rows[0][0].(string) + ref := rows[0].GetValue(0).(string) branch = strings.TrimPrefix(ref, "remotes/"+remote+"/") } } else { @@ -325,12 +325,12 @@ func getDefaultRemote(sqlCtx *sql.Context, queryist cli.Queryist) (string, error return "", env.ErrNoRemote } if len(rows) == 1 { - return rows[0][0].(string), nil + return rows[0].GetValue(0).(string), nil } for _, row := range rows { - if row[0].(string) == "origin" { + if row.GetValue(0).(string) == "origin" { return "origin", nil } } - return rows[0][0].(string), nil + return rows[0].GetValue(0).(string), nil } diff --git a/go/cmd/dolt/commands/push.go b/go/cmd/dolt/commands/push.go index dd20ad56213..1fbafb43c97 100644 --- a/go/cmd/dolt/commands/push.go +++ b/go/cmd/dolt/commands/push.go @@ -189,8 +189,8 @@ func constructInterpolatedDoltPushQuery(apr *argparser.ArgParseResults) (string, // printPushResult prints the appropriate message for the given push output. // This function is called only when error is nil. func printPushResult(rows []sql.Row) { - if len(rows[0]) > 1 { - cli.Println(rows[0][1].(string)) + if rows[0].Len() > 1 { + cli.Println(rows[0].GetValue(1).(string)) } } diff --git a/go/cmd/dolt/commands/query_diff.go b/go/cmd/dolt/commands/query_diff.go index 69c894669fc..1075ef59d25 100644 --- a/go/cmd/dolt/commands/query_diff.go +++ b/go/cmd/dolt/commands/query_diff.go @@ -70,8 +70,8 @@ func (q QueryDiff) ArgParser() *argparser.ArgParser { func (q QueryDiff) compareRows(pkOrds []int, row1, row2 sql.Row) (int, bool) { var cmp int for _, pkOrd := range pkOrds { - pk1, _ := gmstypes.ConvertToString(row1[pkOrd], gmstypes.Text) - pk2, _ := gmstypes.ConvertToString(row2[pkOrd], gmstypes.Text) + pk1, _ := gmstypes.ConvertToString(row1.GetValue(pkOrd), gmstypes.Text) + pk2, _ := gmstypes.ConvertToString(row2.GetValue(pkOrd), gmstypes.Text) if pk1 < pk2 { cmp = -1 } else if pk1 > pk2 { @@ -81,9 +81,9 @@ func (q QueryDiff) compareRows(pkOrds []int, row1, row2 sql.Row) (int, bool) { } } var diff bool - for i := 0; i < len(row1); i++ { - a, _ := gmstypes.ConvertToString(row1[i], gmstypes.Text) - b, _ := gmstypes.ConvertToString(row2[i], gmstypes.Text) + for i := 0; i < row1.Len(); i++ { + a, _ := gmstypes.ConvertToString(row1.GetValue(i), gmstypes.Text) + b, _ := gmstypes.ConvertToString(row2.GetValue(i), gmstypes.Text) if a != b { diff = true break diff --git a/go/cmd/dolt/commands/rebase.go b/go/cmd/dolt/commands/rebase.go index 22f585ea9ce..ab53c25cfe3 100644 --- a/go/cmd/dolt/commands/rebase.go +++ b/go/cmd/dolt/commands/rebase.go @@ -117,17 +117,17 @@ func (cmd RebaseCmd) Exec(ctx context.Context, commandStr string, args []string, return HandleVErrAndExitCode(errhand.VerboseErrorFromError(err), usage) } - status, err := getInt64ColAsInt64(rows[0][0]) + status, err := getInt64ColAsInt64(rows[0].GetValue(0)) if err != nil { return HandleVErrAndExitCode(errhand.VerboseErrorFromError(err), usage) } if status == 1 { - return HandleVErrAndExitCode(errhand.VerboseErrorFromError(errors.New("error: "+rows[0][1].(string))), usage) + return HandleVErrAndExitCode(errhand.VerboseErrorFromError(errors.New("error: "+rows[0].GetValue(1).(string))), usage) } // If the rebase was successful, or if it was aborted, print out the message and // ensure the branch being rebased is checked out in the CLI - message := rows[0][1].(string) + message := rows[0].GetValue(1).(string) if strings.Contains(message, dprocedures.SuccessfulRebaseMessage) || strings.Contains(message, dprocedures.RebaseAbortedMessage) { cli.Println(message) @@ -150,12 +150,12 @@ func (cmd RebaseCmd) Exec(ctx context.Context, commandStr string, args []string, if err != nil { return HandleVErrAndExitCode(errhand.VerboseErrorFromError(err), usage) } - status, err := getInt64ColAsInt64(rows[0][0]) + status, err := getInt64ColAsInt64(rows[0].GetValue(0)) if err != nil { return HandleVErrAndExitCode(errhand.VerboseErrorFromError(err), usage) } if status == 1 { - return HandleVErrAndExitCode(errhand.VerboseErrorFromError(errors.New("error: "+rows[0][1].(string))), usage) + return HandleVErrAndExitCode(errhand.VerboseErrorFromError(errors.New("error: "+rows[0].GetValue(1).(string))), usage) } cli.Println(dprocedures.RebaseAbortedMessage) @@ -185,7 +185,7 @@ func (cmd RebaseCmd) Exec(ctx context.Context, commandStr string, args []string, return HandleVErrAndExitCode(errhand.VerboseErrorFromError(err), usage) } - status, err = getInt64ColAsInt64(rows[0][0]) + status, err = getInt64ColAsInt64(rows[0].GetValue(0)) if err != nil { _, _, _, _ = queryist.Query(sqlCtx, "CALL DOLT_REBASE('--abort');") if err = syncCliBranchToSqlSessionBranch(sqlCtx, dEnv); err != nil { @@ -198,10 +198,10 @@ func (cmd RebaseCmd) Exec(ctx context.Context, commandStr string, args []string, if err = syncCliBranchToSqlSessionBranch(sqlCtx, dEnv); err != nil { return HandleVErrAndExitCode(errhand.VerboseErrorFromError(err), usage) } - return HandleVErrAndExitCode(errhand.VerboseErrorFromError(errors.New("error: "+rows[0][1].(string))), usage) + return HandleVErrAndExitCode(errhand.VerboseErrorFromError(errors.New("error: "+rows[0].GetValue(1).(string))), usage) } - cli.Println(rows[0][1].(string)) + cli.Println(rows[0].GetValue(1).(string)) return 0 } @@ -251,12 +251,12 @@ func buildInitialRebaseMsg(sqlCtx *sql.Context, queryist cli.Queryist, rebaseBra // rebase plan for _, row := range rows { - action, found := getRebaseAction(row[0]) + action, found := getRebaseAction(row.GetValue(0)) if !found { return "", errors.New("invalid rebase action") } - commitHash := row[1].(string) - commitMessage := row[2].(string) + commitHash := row.GetValue(1).(string) + commitMessage := row.GetValue(2).(string) buffer.WriteString(fmt.Sprintf("%s %s %s\n", action, commitHash, commitMessage)) } buffer.WriteString("\n") diff --git a/go/cmd/dolt/commands/reflog.go b/go/cmd/dolt/commands/reflog.go index 4c07cfe7739..784e4c17820 100644 --- a/go/cmd/dolt/commands/reflog.go +++ b/go/cmd/dolt/commands/reflog.go @@ -141,13 +141,13 @@ func printReflog(rows []sql.Row, queryist cli.Queryist, sqlCtx *sql.Context) int res, err := GetRowsForSql(queryist, sqlCtx, "SELECT hashof('HEAD')") if err == nil { // still print the reflog even if we can't get the hash - headHash = res[0][0].(string) + headHash = res[0].GetValue(0).(string) } for _, row := range rows { - ref := row[0].(string) - commitHash := row[1].(string) - commitMessage := row[2].(string) + ref := row.GetValue(0).(string) + commitHash := row.GetValue(1).(string) + commitMessage := row.GetValue(2).(string) reflogInfo = append(reflogInfo, ReflogInfo{ref, commitHash, commitMessage}) } diff --git a/go/cmd/dolt/commands/remote.go b/go/cmd/dolt/commands/remote.go index 20deb046c80..e97fa1061b5 100644 --- a/go/cmd/dolt/commands/remote.go +++ b/go/cmd/dolt/commands/remote.go @@ -262,17 +262,17 @@ func getRemotesSQL(sqlCtx *sql.Context, queryist cli.Queryist) ([]remote, error) remotes := make([]remote, 0, len(rows)) for _, r := range rows { - name, ok := r[0].(string) + name, ok := r.GetValue(0).(string) if !ok { return nil, fmt.Errorf("invalid remote name") } - url, ok := r[1].(string) + url, ok := r.GetValue(1).(string) if !ok { return nil, fmt.Errorf("invalid remote url") } - params, err := getJsonAsString(sqlCtx, r[2]) + params, err := getJsonAsString(sqlCtx, r.GetValue(2)) if err != nil { return nil, fmt.Errorf("invalid params") } diff --git a/go/cmd/dolt/commands/reset.go b/go/cmd/dolt/commands/reset.go index d27a01a55e8..1ce39958519 100644 --- a/go/cmd/dolt/commands/reset.go +++ b/go/cmd/dolt/commands/reset.go @@ -198,7 +198,7 @@ type StatRow struct { func buildStatRows(rows []sql.Row) []StatRow { statRows := make([]StatRow, 0, len(rows)) for _, row := range rows { - statRows = append(statRows, StatRow{row[0].(string), row[1].(string)}) + statRows = append(statRows, StatRow{row.GetValue(0).(string), row.GetValue(1).(string)}) } return statRows } diff --git a/go/cmd/dolt/commands/sql.go b/go/cmd/dolt/commands/sql.go index aa44b4d7b56..791091af207 100644 --- a/go/cmd/dolt/commands/sql.go +++ b/go/cmd/dolt/commands/sql.go @@ -947,20 +947,20 @@ func getDBBranchFromSession(sqlCtx *sql.Context, qryist cli.Queryist) (db string cli.Println(color.RedString("Failure to get DB Name for session: " + err.Error())) return db, branch, false } - if len(row) != 2 { + if row.Len() != 2 { cli.Println(color.RedString("Runtime error. Invalid column count.")) return db, branch, false } - if row[1] == nil { + if row.GetValue(1) == nil { branch = "" } else { - branch = row[1].(string) + branch = row.GetValue(1).(string) } - if row[0] == nil { + if row.GetValue(0) == nil { db = "" } else { - db = row[0].(string) + db = row.GetValue(0).(string) // It is possible to `use mydb/branch`, and as far as your session is concerned your database is mydb/branch. We // allow that, but also want to show the user the branch name in the prompt. So we munge the DB in this case. @@ -990,12 +990,12 @@ func isDirty(sqlCtx *sql.Context, qryist cli.Queryist) (bool, error) { cli.Println(color.RedString("Failure to get DB Name for session: " + err.Error())) return false, err } - if len(row) != 1 { + if row.Len() != 1 { cli.Println(color.RedString("Runtime error. Invalid column count.")) return false, fmt.Errorf("invalid column count") } - return getStrBoolColAsBool(row[0]) + return getStrBoolColAsBool(row.GetValue(0)) } // Returns a new auto completer with table names, column names, and SQL keywords. @@ -1033,10 +1033,10 @@ func newCompleter( return nil, err } - identifiers[r[0].(string)] = struct{}{} - identifiers[r[1].(string)] = struct{}{} - identifiers[r[2].(string)] = struct{}{} - columnNames = append(columnNames, r[2].(string)) + identifiers[r.GetValue(0).(string)] = struct{}{} + identifiers[r.GetValue(1).(string)] = struct{}{} + identifiers[r.GetValue(2).(string)] = struct{}{} + columnNames = append(columnNames, r.GetValue(2).(string)) } var completionWords []string diff --git a/go/cmd/dolt/commands/sql_test.go b/go/cmd/dolt/commands/sql_test.go index 4a064d2104f..f878c5826de 100644 --- a/go/cmd/dolt/commands/sql_test.go +++ b/go/cmd/dolt/commands/sql_test.go @@ -523,7 +523,7 @@ func TestUpdate(t *testing.T) { rows, err := sqle.ExecuteSelect(dEnv, root, q) assert.NoError(t, err) assert.True(t, len(rows) > 0) - assert.Equal(t, uint32(test.expectedAges[i]), rows[0][2]) + assert.Equal(t, uint32(test.expectedAges[i]), rows[0].GetValue(2)) } } }) diff --git a/go/cmd/dolt/commands/sqlserver/queryist_utils.go b/go/cmd/dolt/commands/sqlserver/queryist_utils.go index e84b94e5d9e..48e321579ba 100644 --- a/go/cmd/dolt/commands/sqlserver/queryist_utils.go +++ b/go/cmd/dolt/commands/sqlserver/queryist_utils.go @@ -146,7 +146,7 @@ func (s *MysqlRowWrapper) Next(*sql.Context) (sql.Row, error) { if err != nil { return nil, err } - sqlRow := make(sql.Row, len(s.vRow)) + sqlRow := make(sql.UntypedSqlRow, len(s.vRow)) for i, val := range s.vRow { if val != nil { sqlRow[i] = *val diff --git a/go/cmd/dolt/commands/status.go b/go/cmd/dolt/commands/status.go index a5d6dd62621..94721237826 100644 --- a/go/cmd/dolt/commands/status.go +++ b/go/cmd/dolt/commands/status.go @@ -191,9 +191,9 @@ func createPrintData(err error, queryist cli.Queryist, sqlCtx *sql.Context, show ignoredTables := doltdb.IgnoredTables{} if statusPresent { for _, row := range statusRows { - tableName := row[0].(string) - staged := row[1] - status := row[2].(string) + tableName := row.GetValue(0).(string) + staged := row.GetValue(1) + status := row.GetValue(2).(string) isStaged, err := GetTinyIntColAsBool(staged) if err != nil { @@ -315,8 +315,8 @@ func createPrintData(err error, queryist cli.Queryist, sqlCtx *sql.Context, show func getConflictedTables(statusRows []sql.Row) map[string]bool { conflictedTables := make(map[string]bool) for _, row := range statusRows { - tableName := row[0].(string) - status := row[2].(string) + tableName := row.GetValue(0).(string) + status := row.GetValue(2).(string) if status == "conflict" { conflictedTables[tableName] = true } @@ -338,7 +338,7 @@ func getRemoteInfo(queryist cli.Queryist, sqlCtx *sql.Context, branchName string if len(remoteBranches) != 1 { return ahead, behind, fmt.Errorf("could not find remote branch %s", remoteBranchRef) } - remoteBranchCommit := remoteBranches[0][1].(string) + remoteBranchCommit := remoteBranches[0].GetValue(1).(string) q = fmt.Sprintf("call dolt_count_commits('--from', '%s', '--to', '%s')", currentBranchCommit, remoteBranchCommit) rows, err := GetRowsForSql(queryist, sqlCtx, q) @@ -348,8 +348,8 @@ func getRemoteInfo(queryist cli.Queryist, sqlCtx *sql.Context, branchName string if len(rows) != 1 { return ahead, behind, fmt.Errorf("could not count commits between %s and %s", currentBranchCommit, remoteBranchCommit) } - aheadDb := rows[0][0] - behindDb := rows[0][1] + aheadDb := rows[0].GetValue(0) + behindDb := rows[0].GetValue(1) ahead, err = getInt64ColAsInt64(aheadDb) if err != nil { @@ -373,11 +373,11 @@ func getLocalBranchInfo(queryist cli.Queryist, sqlCtx *sql.Context, branchName s return remoteName, remoteBranchName, currentBranchCommit, err } for _, row := range localBranches { - branch := row[0].(string) + branch := row.GetValue(0).(string) if branch == branchName { - currentBranchCommit = row[1].(string) - remoteName = row[2].(string) - remoteBranchName = row[3].(string) + currentBranchCommit = row.GetValue(1).(string) + remoteName = row.GetValue(2).(string) + remoteBranchName = row.GetValue(3).(string) } } if currentBranchCommit == "" { @@ -394,7 +394,7 @@ func getMergeStatus(queryist cli.Queryist, sqlCtx *sql.Context) (bool, error) { // determine if a merge is active mergeActive := false if len(mergeRows) == 1 { - isMerging := mergeRows[0][0] + isMerging := mergeRows[0].GetValue(0) mergeActive, err = GetTinyIntColAsBool(isMerging) if err != nil { return false, err @@ -412,7 +412,7 @@ func getDataConflictsTables(queryist cli.Queryist, sqlCtx *sql.Context) (map[str return nil, err } for _, row := range dataConflicts { - tableName := row[0].(string) + tableName := row.GetValue(0).(string) dataConflictTables[tableName] = true } return dataConflictTables, nil @@ -425,7 +425,7 @@ func getConstraintViolationTables(queryist cli.Queryist, sqlCtx *sql.Context) (m return nil, err } for _, row := range constraintViolations { - tableName := row[0].(string) + tableName := row.GetValue(0).(string) constraintViolationTables[tableName] = true } return constraintViolationTables, nil @@ -439,8 +439,8 @@ func getWorkingStagedTables(queryist cli.Queryist, sqlCtx *sql.Context) (map[str return nil, nil, err } for _, row := range diffs { - commitHash := row[0].(string) - tableName := row[1].(string) + commitHash := row.GetValue(0).(string) + tableName := row.GetValue(1).(string) if commitHash == "STAGED" { stagedTableNames[tableName] = true } else { @@ -457,8 +457,8 @@ func getIgnoredTablePatternsFromSql(queryist cli.Queryist, sqlCtx *sql.Context) return nil, err } for _, row := range ignoreRows { - pattern := row[0].(string) - ignoreVal := row[1] + pattern := row.GetValue(0).(string) + ignoreVal := row.GetValue(1) var ignore bool if ignoreString, ok := ignoreVal.(string); ok { diff --git a/go/cmd/dolt/commands/tag.go b/go/cmd/dolt/commands/tag.go index e7b514635fa..77cf00adbca 100644 --- a/go/cmd/dolt/commands/tag.go +++ b/go/cmd/dolt/commands/tag.go @@ -216,17 +216,17 @@ func getTagInfos(queryist cli.Queryist, sqlCtx *sql.Context) ([]tagInfo, error) tags := []tagInfo{} for _, row := range rows { - timestamp, err := getTimestampColAsUint64(row[4]) + timestamp, err := getTimestampColAsUint64(row.GetValue(4)) if err != nil { return nil, fmt.Errorf("failed to parse tag timestamp: %w", err) } tag := tagInfo{ - Name: row[0].(string), - Hash: row[1].(string), - Tagger: row[2].(string), - Email: row[3].(string), + Name: row.GetValue(0).(string), + Hash: row.GetValue(1).(string), + Tagger: row.GetValue(2).(string), + Email: row.GetValue(3).(string), Timestamp: timestamp, - Message: row[5].(string), + Message: row.GetValue(5).(string), } tags = append(tags, tag) } diff --git a/go/cmd/dolt/commands/tblcmds/import.go b/go/cmd/dolt/commands/tblcmds/import.go index 82603be39ac..f2cc097db61 100644 --- a/go/cmd/dolt/commands/tblcmds/import.go +++ b/go/cmd/dolt/commands/tblcmds/import.go @@ -560,7 +560,7 @@ func move(ctx context.Context, rd table.SqlRowReader, wr *mvdata.SqlEngineTableW // record the first error encountered unless asked to ignore it if row != nil && rowErr == nil && !options.contOnErr { var sqlRowWithColumns []string - for i, val := range row { + for i, val := range row.Values() { columnName := "" if len(rowSchema.Schema) > i { columnName = rowSchema.Schema[i].Name @@ -831,16 +831,16 @@ func NameAndTypeTransform(row sql.Row, rowOperationSchema sql.PrimaryKeySchema, for i, col := range rowOperationSchema.Schema { // Check if this a string that can be converted to a boolean - val, ok := detectAndConvertToBoolean(row[i], col.Type) + val, ok := detectAndConvertToBoolean(row.GetValue(i), col.Type) if ok { - row[i] = val + row.SetValue(i, val) continue } // Bit types need additional verification due to the differing values they can take on. "4", "0x04", b'100' should // be interpreted in the correct manner. if _, ok := col.Type.(gmstypes.BitType); ok { - colAsString, ok := row[i].(string) + colAsString, ok := row.GetValue(i).(string) if !ok { return nil, fmt.Errorf("error: column value should be of type string") } @@ -848,7 +848,7 @@ func NameAndTypeTransform(row sql.Row, rowOperationSchema sql.PrimaryKeySchema, // Check if the column can be parsed an uint64 val, err := strconv.ParseUint(colAsString, 10, 64) if err == nil { - row[i] = val + row.SetValue(i, val) continue } @@ -858,7 +858,7 @@ func NameAndTypeTransform(row sql.Row, rowOperationSchema sql.PrimaryKeySchema, if len(groups) > 1 { val, err = strconv.ParseUint(groups[1], 2, 64) if err == nil { - row[i] = val + row.SetValue(i, val) continue } } @@ -867,7 +867,7 @@ func NameAndTypeTransform(row sql.Row, rowOperationSchema sql.PrimaryKeySchema, numberStr := strings.Replace(colAsString, "0x", "", -1) val, err = strconv.ParseUint(numberStr, 16, 64) if err == nil { - row[i] = val + row.SetValue(i, val) } else { return nil, fmt.Errorf("error: Unparsable bit value %s", colAsString) } @@ -878,7 +878,7 @@ func NameAndTypeTransform(row sql.Row, rowOperationSchema sql.PrimaryKeySchema, switch col.Type.(type) { case sql.StringType, sql.EnumType, sql.SetType: default: - row[i] = emptyStringToNil(row[i]) + row.SetValue(i, emptyStringToNil(row.GetValue(i))) } } @@ -933,11 +933,11 @@ func emptyStringToNil(val interface{}) interface{} { } func applyMapperToRow(row sql.Row, rowOperationSchema, rdSchema sql.PrimaryKeySchema, nameMapper rowconv.NameMapper) sql.Row { - returnRow := make(sql.Row, len(rowOperationSchema.Schema)) + returnRow := make(sql.UntypedSqlRow, len(rowOperationSchema.Schema)) for i, col := range rowOperationSchema.Schema { rdIdx := rdSchema.IndexOf(nameMapper.PreImage(col.Name), col.Source) - returnRow[i] = row[rdIdx] + returnRow.SetValue(i, row.GetValue(rdIdx)) } return returnRow diff --git a/go/cmd/dolt/commands/utils.go b/go/cmd/dolt/commands/utils.go index 448d9a3a844..c5c9d072526 100644 --- a/go/cmd/dolt/commands/utils.go +++ b/go/cmd/dolt/commands/utils.go @@ -420,12 +420,12 @@ func getActiveBranchName(sqlCtx *sql.Context, queryEngine cli.Queryist) (string, return "", fmt.Errorf("unexpectedly received multiple rows in '%s': %s", query, rows) } row := rows[0] - if len(row) != 1 { + if row.Len() != 1 { return "", fmt.Errorf("unexpectedly received multiple columns in '%s': %s", query, row) } - branchName, ok := row[0].(string) + branchName, ok := row.GetValue(0).(string) if !ok { - return "", fmt.Errorf("unexpectedly received non-string column in '%s': %s", query, row[0]) + return "", fmt.Errorf("unexpectedly received non-string column in '%s': %s", query, row.GetValue(0)) } return branchName, nil } @@ -530,8 +530,8 @@ func GetDoltStatus(queryist cli.Queryist, sqlCtx *sql.Context) (stagedChangedTab } for _, row := range statusRows { - tableName := row[0].(string) - staged := row[1] + tableName := row.GetValue(0).(string) + staged := row.GetValue(1) var isStaged bool isStaged, err = GetTinyIntColAsBool(staged) if err != nil { @@ -692,22 +692,22 @@ func getCommitInfoWithOptions(queryist cli.Queryist, sqlCtx *sql.Context, ref st } row := rows[0] - commitHash := row[0].(string) - name := row[1].(string) - email := row[2].(string) - timestamp, err := getTimestampColAsUint64(row[3]) + commitHash := row.GetValue(0).(string) + name := row.GetValue(1).(string) + email := row.GetValue(2).(string) + timestamp, err := getTimestampColAsUint64(row.GetValue(3)) if err != nil { - return nil, fmt.Errorf("error parsing timestamp '%s': %v", row[3], err) + return nil, fmt.Errorf("error parsing timestamp '%s': %v", row.GetValue(3), err) } - message := row[4].(string) - parent := row[5].(string) + message := row.GetValue(4).(string) + parent := row.GetValue(5).(string) height := uint64(len(rows)) isHead := commitHash == hashOfHead var signature string - if len(row) > 7 { - signature = row[7].(string) + if row.Len() > 7 { + signature = row.GetValue(7).(string) } localBranchesForHash, err := getBranchesForHash(queryist, sqlCtx, commitHash, true) @@ -765,7 +765,7 @@ func getBranchesForHash(queryist cli.Queryist, sqlCtx *sql.Context, targetHash s branches := []string{} for _, row := range rows { - name := row[0].(string) + name := row.GetValue(0).(string) branches = append(branches, name) } return branches, nil @@ -783,7 +783,7 @@ func getTagsForHash(queryist cli.Queryist, sqlCtx *sql.Context, targetHash strin tags := []string{} for _, row := range rows { - name := row[0].(string) + name := row.GetValue(0).(string) tags = append(tags, name) } return tags, nil @@ -794,10 +794,10 @@ func getTagsForHash(queryist cli.Queryist, sqlCtx *sql.Context, targetHash strin // procedures which do this return the FF flag in different columns of their results. func getFastforward(row sql.Row, index int) bool { fastForward := false - if row != nil && len(row) > index { - if ff, ok := row[index].(int64); ok { + if row != nil && row.Len() > index { + if ff, ok := row.GetValue(index).(int64); ok { fastForward = ff == 1 - } else if ff, ok := row[index].(string); ok { + } else if ff, ok := row.GetValue(index).(string); ok { // remote execution returns row as a string fastForward = ff == "1" } @@ -817,7 +817,7 @@ func getHashOf(queryist cli.Queryist, sqlCtx *sql.Context, ref string) (string, if len(rows) == 0 { return "", fmt.Errorf("no commits found for ref %s", ref) } - return rows[0][0].(string), nil + return rows[0].GetValue(0).(string), nil } // ParseArgsOrPrintHelp is used by most commands to parse arguments and print help if necessary. It's a wrapper around diff --git a/go/go.mod b/go/go.mod index 6539313c787..b4bd0e79f3a 100644 --- a/go/go.mod +++ b/go/go.mod @@ -57,7 +57,7 @@ require ( github.com/cespare/xxhash/v2 v2.2.0 github.com/creasty/defaults v1.6.0 github.com/dolthub/flatbuffers/v23 v23.3.3-dh.2 - github.com/dolthub/go-mysql-server v0.18.2-0.20241127000145-a1809677932e + github.com/dolthub/go-mysql-server v0.18.2-0.20241127185838-f17583b7a01c github.com/dolthub/gozstd v0.0.0-20240423170813-23a2903bca63 github.com/dolthub/swiss v0.1.0 github.com/goccy/go-json v0.10.2 diff --git a/go/go.sum b/go/go.sum index afdaef5b2e2..7192241828e 100644 --- a/go/go.sum +++ b/go/go.sum @@ -183,8 +183,8 @@ github.com/dolthub/fslock v0.0.3 h1:iLMpUIvJKMKm92+N1fmHVdxJP5NdyDK5bK7z7Ba2s2U= github.com/dolthub/fslock v0.0.3/go.mod h1:QWql+P17oAAMLnL4HGB5tiovtDuAjdDTPbuqx7bYfa0= github.com/dolthub/go-icu-regex v0.0.0-20240916130659-0118adc6b662 h1:aC17hZD6iwzBwwfO5M+3oBT5E5gGRiQPdn+vzpDXqIA= github.com/dolthub/go-icu-regex v0.0.0-20240916130659-0118adc6b662/go.mod h1:KPUcpx070QOfJK1gNe0zx4pA5sicIK1GMikIGLKC168= -github.com/dolthub/go-mysql-server v0.18.2-0.20241127000145-a1809677932e h1:2oysRPgywCpyW/h4m6DxYUpUsdZ+JkJXvC51TVr4sUE= -github.com/dolthub/go-mysql-server v0.18.2-0.20241127000145-a1809677932e/go.mod h1:QdaXQKE8XFwM4P1yN14m2eydx4V2xyuqpQp4tmNoXzQ= +github.com/dolthub/go-mysql-server v0.18.2-0.20241127185838-f17583b7a01c h1:j0Qmi24Y02a0Jcbv6ayDAVYA18zQKh7e4AkoewmL9bE= +github.com/dolthub/go-mysql-server v0.18.2-0.20241127185838-f17583b7a01c/go.mod h1:QdaXQKE8XFwM4P1yN14m2eydx4V2xyuqpQp4tmNoXzQ= github.com/dolthub/gozstd v0.0.0-20240423170813-23a2903bca63 h1:OAsXLAPL4du6tfbBgK0xXHZkOlos63RdKYS3Sgw/dfI= github.com/dolthub/gozstd v0.0.0-20240423170813-23a2903bca63/go.mod h1:lV7lUeuDhH5thVGDCKXbatwKy2KW80L4rMT46n+Y2/Q= github.com/dolthub/ishell v0.0.0-20240701202509-2b217167d718 h1:lT7hE5k+0nkBdj/1UOSFwjWpNxf+LCApbRHgnCA17XE= diff --git a/go/libraries/doltcore/diff/diffsplitter.go b/go/libraries/doltcore/diff/diffsplitter.go index b7774881948..c01b7ab05ec 100644 --- a/go/libraries/doltcore/diff/diffsplitter.go +++ b/go/libraries/doltcore/diff/diffsplitter.go @@ -147,12 +147,12 @@ func (ds DiffSplitter) SplitDiffResultRow(row sql.Row) (from, to RowDiff, err er from = RowDiff{ColDiffs: make([]ChangeType, len(ds.targetSch))} to = RowDiff{ColDiffs: make([]ChangeType, len(ds.targetSch))} - diffType := row[len(row)-1] - row = row[:len(row)-1] + diffType := row.GetValue(row.Len() - 1) + row = row.Subslice(0, row.Len()-1) switch diffType.(string) { case removedStr: - from.Row = make(sql.Row, len(ds.targetSch)) + from.Row = make(sql.UntypedSqlRow, len(ds.targetSch)) from.RowDiff = Removed for i := 0; i < ds.splitIdx; i++ { j := ds.queryToTarget[i] @@ -160,25 +160,25 @@ func (ds DiffSplitter) SplitDiffResultRow(row sql.Row) (from, to RowDiff, err er if j < 0 { continue } - from.Row[j] = row[i] + from.Row.SetValue(j, row.GetValue(i)) from.ColDiffs[j] = Removed } case addedStr: - to.Row = make(sql.Row, len(ds.targetSch)) + to.Row = make(sql.UntypedSqlRow, len(ds.targetSch)) to.RowDiff = Added - for i := ds.splitIdx; i < len(row); i++ { + for i := ds.splitIdx; i < row.Len(); i++ { j := ds.queryToTarget[i] // skip any columns that aren't mapped if j < 0 { continue } - to.Row[j] = row[i] + to.Row.SetValue(j, row.GetValue(i)) to.ColDiffs[j] = Added } case modifiedStr: - from.Row = make(sql.Row, len(ds.targetSch)) + from.Row = make(sql.UntypedSqlRow, len(ds.targetSch)) from.RowDiff = ModifiedOld for i := 0; i < ds.splitIdx; i++ { j := ds.queryToTarget[i] @@ -186,18 +186,18 @@ func (ds DiffSplitter) SplitDiffResultRow(row sql.Row) (from, to RowDiff, err er if j < 0 { continue } - from.Row[j] = row[i] + from.Row.SetValue(j, row.GetValue(i)) } - to.Row = make(sql.Row, len(ds.targetSch)) + to.Row = make(sql.UntypedSqlRow, len(ds.targetSch)) to.RowDiff = ModifiedNew - for i := ds.splitIdx; i < len(row); i++ { + for i := ds.splitIdx; i < row.Len(); i++ { j := ds.queryToTarget[i] - to.Row[j] = row[i] + to.Row.SetValue(j, row.GetValue(i)) } // now do field-wise comparison var cmp int for i, col := range ds.targetSch { - cmp, err = col.Type.Compare(from.Row[i], to.Row[i]) + cmp, err = col.Type.Compare(from.Row.GetValue(i), to.Row.GetValue(i)) if err != nil { return RowDiff{}, RowDiff{}, err } else if cmp != 0 { diff --git a/go/libraries/doltcore/diff/diffsplitter_test.go b/go/libraries/doltcore/diff/diffsplitter_test.go index df34a69eb13..d6a7c786301 100644 --- a/go/libraries/doltcore/diff/diffsplitter_test.go +++ b/go/libraries/doltcore/diff/diffsplitter_test.go @@ -32,7 +32,7 @@ func TestDiffSplitter(t *testing.T) { name string diffQuerySch sql.Schema tableSch sql.Schema - diffQueryRows []sql.Row + diffQueryRows []sql.UntypedSqlRow expectedRows []splitRow } @@ -50,7 +50,7 @@ func TestDiffSplitter(t *testing.T) { intCol("a"), intCol("b"), }, - diffQueryRows: []sql.Row{ + diffQueryRows: []sql.UntypedSqlRow{ {nil, nil, 1, 2, "added"}, {3, 4, nil, nil, "removed"}, {5, 6, 5, 100, "modified"}, @@ -59,14 +59,14 @@ func TestDiffSplitter(t *testing.T) { { old: emptyRowDiff(2), new: RowDiff{ - Row: sql.Row{1, 2}, + Row: sql.UntypedSqlRow{1, 2}, RowDiff: Added, ColDiffs: []ChangeType{Added, Added}, }, }, { old: RowDiff{ - Row: sql.Row{3, 4}, + Row: sql.UntypedSqlRow{3, 4}, RowDiff: Removed, ColDiffs: []ChangeType{Removed, Removed}, }, @@ -74,12 +74,12 @@ func TestDiffSplitter(t *testing.T) { }, { old: RowDiff{ - Row: sql.Row{5, 6}, + Row: sql.UntypedSqlRow{5, 6}, RowDiff: ModifiedOld, ColDiffs: []ChangeType{None, ModifiedOld}, }, new: RowDiff{ - Row: sql.Row{5, 100}, + Row: sql.UntypedSqlRow{5, 100}, RowDiff: ModifiedNew, ColDiffs: []ChangeType{None, ModifiedNew}, }, @@ -100,7 +100,7 @@ func TestDiffSplitter(t *testing.T) { intCol("b"), intCol("c"), }, - diffQueryRows: []sql.Row{ + diffQueryRows: []sql.UntypedSqlRow{ {nil, nil, 1, 2, "added"}, {"three", 4, nil, nil, "removed"}, {"five", 6, 6, 100, "modified"}, @@ -109,14 +109,14 @@ func TestDiffSplitter(t *testing.T) { { old: emptyRowDiff(3), new: RowDiff{ - Row: sql.Row{nil, 1, 2}, + Row: sql.UntypedSqlRow{nil, 1, 2}, RowDiff: Added, ColDiffs: []ChangeType{None, Added, Added}, }, }, { old: RowDiff{ - Row: sql.Row{"three", 4, nil}, + Row: sql.UntypedSqlRow{"three", 4, nil}, RowDiff: Removed, ColDiffs: []ChangeType{Removed, Removed, None}, }, @@ -124,12 +124,12 @@ func TestDiffSplitter(t *testing.T) { }, { old: RowDiff{ - Row: sql.Row{"five", 6, nil}, + Row: sql.UntypedSqlRow{"five", 6, nil}, RowDiff: ModifiedOld, ColDiffs: []ChangeType{ModifiedOld, None, ModifiedOld}, }, new: RowDiff{ - Row: sql.Row{nil, 6, 100}, + Row: sql.UntypedSqlRow{nil, 6, 100}, RowDiff: ModifiedNew, ColDiffs: []ChangeType{ModifiedNew, None, ModifiedNew}, }, @@ -155,7 +155,7 @@ func TestDiffSplitter(t *testing.T) { intCol("c"), intCol("d"), }, - diffQueryRows: []sql.Row{ + diffQueryRows: []sql.UntypedSqlRow{ {1, 2, 3, "1", 3, 4, "modified"}, {5, 6, 7, "5", 17, 8, "modified"}, {nil, 10, 11, "9", nil, 12, "modified"}, @@ -163,38 +163,38 @@ func TestDiffSplitter(t *testing.T) { expectedRows: []splitRow{ { old: RowDiff{ - Row: sql.Row{1, 2, 3, nil}, + Row: sql.UntypedSqlRow{1, 2, 3, nil}, RowDiff: ModifiedOld, ColDiffs: []ChangeType{None, ModifiedOld, None, ModifiedOld}, }, new: RowDiff{ // todo(andy): should type changes generate a column diff? - Row: sql.Row{"1", nil, 3, 4}, + Row: sql.UntypedSqlRow{"1", nil, 3, 4}, RowDiff: ModifiedNew, ColDiffs: []ChangeType{None, ModifiedNew, None, ModifiedNew}, }, }, { old: RowDiff{ - Row: sql.Row{5, 6, 7, nil}, + Row: sql.UntypedSqlRow{5, 6, 7, nil}, RowDiff: ModifiedOld, ColDiffs: []ChangeType{None, ModifiedOld, ModifiedOld, ModifiedOld}, }, new: RowDiff{ // todo(andy): should type changes generate a column diff? - Row: sql.Row{"5", nil, 17, 8}, + Row: sql.UntypedSqlRow{"5", nil, 17, 8}, RowDiff: ModifiedNew, ColDiffs: []ChangeType{None, ModifiedNew, ModifiedNew, ModifiedNew}, }, }, { old: RowDiff{ - Row: sql.Row{nil, 10, 11, nil}, + Row: sql.UntypedSqlRow{nil, 10, 11, nil}, RowDiff: ModifiedOld, ColDiffs: []ChangeType{ModifiedOld, ModifiedOld, ModifiedOld, ModifiedOld}, }, new: RowDiff{ - Row: sql.Row{"9", nil, nil, 12}, + Row: sql.UntypedSqlRow{"9", nil, nil, 12}, RowDiff: ModifiedNew, ColDiffs: []ChangeType{ModifiedNew, ModifiedNew, ModifiedNew, ModifiedNew}, }, @@ -212,7 +212,7 @@ func TestDiffSplitter(t *testing.T) { intCol("a"), intCol("b"), }, - diffQueryRows: []sql.Row{ + diffQueryRows: []sql.UntypedSqlRow{ {1, 2, "added"}, {3, 4, "added"}, }, @@ -220,7 +220,7 @@ func TestDiffSplitter(t *testing.T) { { old: emptyRowDiff(2), new: RowDiff{ - Row: sql.Row{1, 2}, + Row: sql.UntypedSqlRow{1, 2}, RowDiff: Added, ColDiffs: []ChangeType{Added, Added}, }, @@ -228,7 +228,7 @@ func TestDiffSplitter(t *testing.T) { { old: emptyRowDiff(2), new: RowDiff{ - Row: sql.Row{3, 4}, + Row: sql.UntypedSqlRow{3, 4}, RowDiff: Added, ColDiffs: []ChangeType{Added, Added}, }, @@ -246,7 +246,7 @@ func TestDiffSplitter(t *testing.T) { intCol("a"), intCol("b"), }, - diffQueryRows: []sql.Row{ + diffQueryRows: []sql.UntypedSqlRow{ {1, 2, "removed"}, {3, 4, "removed"}, }, @@ -254,7 +254,7 @@ func TestDiffSplitter(t *testing.T) { { new: emptyRowDiff(2), old: RowDiff{ - Row: sql.Row{1, 2}, + Row: sql.UntypedSqlRow{1, 2}, RowDiff: Removed, ColDiffs: []ChangeType{Removed, Removed}, }, @@ -262,7 +262,7 @@ func TestDiffSplitter(t *testing.T) { { new: emptyRowDiff(2), old: RowDiff{ - Row: sql.Row{3, 4}, + Row: sql.UntypedSqlRow{3, 4}, RowDiff: Removed, ColDiffs: []ChangeType{Removed, Removed}, }, diff --git a/go/libraries/doltcore/doltdb/gc_test.go b/go/libraries/doltcore/doltdb/gc_test.go index 343c3213fbe..faf14d64bc9 100644 --- a/go/libraries/doltcore/doltdb/gc_test.go +++ b/go/libraries/doltcore/doltdb/gc_test.go @@ -61,7 +61,7 @@ type gcTest struct { name string stages []stage query string - expected []sql.Row + expected []sql.UntypedSqlRow postGCFunc func(ctx context.Context, t *testing.T, ddb *doltdb.DoltDB, prevRes interface{}) } @@ -100,7 +100,7 @@ var gcTests = []gcTest{ }, }, query: "select * from test;", - expected: []sql.Row{{int32(4)}, {int32(5)}, {int32(6)}}, + expected: []sql.UntypedSqlRow{{int32(4)}, {int32(5)}, {int32(6)}}, postGCFunc: func(ctx context.Context, t *testing.T, ddb *doltdb.DoltDB, prevRes interface{}) { h := prevRes.(hash.Hash) cs, err := doltdb.NewCommitSpec(h.String()) @@ -148,7 +148,7 @@ func testGarbageCollection(t *testing.T, test gcTest) { // assert all out rows are present after gc actual, err := sqle.ExecuteSelect(dEnv, working, test.query) require.NoError(t, err) - assert.Equal(t, test.expected, actual) + assert.Equal(t, test.expected, sql.RowsToUntyped(actual)) } // In September 2023, we found a failure to handle the `hasCache` in diff --git a/go/libraries/doltcore/env/actions/dolt_ci/workflow_manager.go b/go/libraries/doltcore/env/actions/dolt_ci/workflow_manager.go index 7bda847180c..dcf477a0e2f 100644 --- a/go/libraries/doltcore/env/actions/dolt_ci/workflow_manager.go +++ b/go/libraries/doltcore/env/actions/dolt_ci/workflow_manager.go @@ -599,12 +599,10 @@ func (d *doltWorkflowManager) sqlReadQuery(ctx *sql.Context, query string, cb fu size := len(sch) for _, row := range rows { - cvs := make(columnValues, size) - - for i := range size { + for i := range sch { col := sch[i] - val := row[i] + val := row.GetValue(i) cv, err := newColumnValue(col, val) if err != nil { return err diff --git a/go/libraries/doltcore/merge/fulltext_table.go b/go/libraries/doltcore/merge/fulltext_table.go index 3e85e343a91..6b63d4b336d 100644 --- a/go/libraries/doltcore/merge/fulltext_table.go +++ b/go/libraries/doltcore/merge/fulltext_table.go @@ -156,7 +156,7 @@ func (table *fulltextTable) ApplyToTable(ctx *sql.Context) (*doltdb.Table, error for ; err == nil; sqlRow, err = rowIter.Next(ctx) { for to := range keyMap { from := keyMap.MapOrdinal(to) - if err = tree.PutField(ctx, mut.NodeStore(), keyBld, to, sqlRow[from]); err != nil { + if err = tree.PutField(ctx, mut.NodeStore(), keyBld, to, sqlRow.GetValue(from)); err != nil { return nil, err } } @@ -164,7 +164,7 @@ func (table *fulltextTable) ApplyToTable(ctx *sql.Context) (*doltdb.Table, error for to := range valMap { from := valMap.MapOrdinal(to) - if err = tree.PutField(ctx, mut.NodeStore(), valBld, to, sqlRow[from]); err != nil { + if err = tree.PutField(ctx, mut.NodeStore(), valBld, to, sqlRow.GetValue(from)); err != nil { return nil, err } } diff --git a/go/libraries/doltcore/merge/integration_test.go b/go/libraries/doltcore/merge/integration_test.go index 65fd012be1d..b4cd3f01857 100644 --- a/go/libraries/doltcore/merge/integration_test.go +++ b/go/libraries/doltcore/merge/integration_test.go @@ -49,7 +49,7 @@ func TestMerge(t *testing.T) { setup []testCommand query string - expected []sql.Row + expected []sql.UntypedSqlRow }{ { name: "smoke test", @@ -65,7 +65,7 @@ func TestMerge(t *testing.T) { {cmd.MergeCmd{}, args{"other"}}, }, query: "SELECT * FROM test", - expected: []sql.Row{ + expected: []sql.UntypedSqlRow{ {int32(1), int32(1)}, {int32(2), int32(2)}, }, @@ -83,7 +83,7 @@ func TestMerge(t *testing.T) { {cmd.MergeCmd{}, args{"other"}}, }, query: "SELECT * FROM test", - expected: []sql.Row{ + expected: []sql.UntypedSqlRow{ {int32(1), int32(1)}, {int32(2), int32(2)}, {int32(11), int32(11)}, @@ -107,7 +107,7 @@ func TestMerge(t *testing.T) { {cmd.MergeCmd{}, args{"other"}}, }, query: "SELECT * FROM quiz ORDER BY pk", - expected: []sql.Row{ + expected: []sql.UntypedSqlRow{ {"a"}, {"b"}, {"c"}, @@ -159,7 +159,7 @@ func TestMergeConflicts(t *testing.T) { setup []testCommand query string - expected []sql.Row + expected []sql.UntypedSqlRow }{ { name: "conflict on merge", @@ -173,7 +173,7 @@ func TestMergeConflicts(t *testing.T) { {cmd.MergeCmd{}, args{"other"}}, }, query: "SELECT * FROM dolt_conflicts", - expected: []sql.Row{ + expected: []sql.UntypedSqlRow{ {"test", uint64(2)}, }, }, @@ -191,7 +191,7 @@ func TestMergeConflicts(t *testing.T) { {cnfcmds.ResolveCmd{}, args{"--ours", "test"}}, }, query: "SELECT * FROM test", - expected: []sql.Row{ + expected: []sql.UntypedSqlRow{ {int32(1), int32(11)}, {int32(2), int32(22)}, }, @@ -212,7 +212,7 @@ func TestMergeConflicts(t *testing.T) { {cmd.MergeCmd{}, args{"other"}}, }, query: "SELECT * FROM dolt_conflicts", - expected: []sql.Row{ + expected: []sql.UntypedSqlRow{ {"quiz", uint64(2)}, }, }, @@ -233,7 +233,7 @@ func TestMergeConflicts(t *testing.T) { {cnfcmds.ResolveCmd{}, args{"--theirs", "quiz"}}, }, query: "SELECT * FROM quiz", - expected: []sql.Row{ + expected: []sql.UntypedSqlRow{ {int32(1), int32(1)}, {int32(2), int32(2)}, }, diff --git a/go/libraries/doltcore/merge/schema_merge_test.go b/go/libraries/doltcore/merge/schema_merge_test.go index 8eae1d67622..7509d3b8e3e 100644 --- a/go/libraries/doltcore/merge/schema_merge_test.go +++ b/go/libraries/doltcore/merge/schema_merge_test.go @@ -58,9 +58,9 @@ type schemaMergeTest struct { type dataTest struct { name string - ancestor []sql.Row - left, right []sql.Row - merged []sql.Row + ancestor []sql.UntypedSqlRow + left, right []sql.UntypedSqlRow + merged []sql.UntypedSqlRow constraintViolations []constraintViolation dataConflict bool skip bool @@ -69,7 +69,7 @@ type dataTest struct { type table struct { ns namedSchema - rows []sql.Row + rows []sql.UntypedSqlRow } type namedSchema struct { @@ -290,10 +290,10 @@ var columnAddDropTests = []schemaMergeTest{ }, { name: "one side drops column, other deletes row", - ancestor: []sql.Row{row(1, 2, 3), row(4, 5, 6)}, - left: []sql.Row{row(1, 2), row(4, 5)}, - right: []sql.Row{row(1, 2, 3)}, - merged: []sql.Row{row(1, 2)}, + ancestor: []sql.UntypedSqlRow{row(1, 2, 3), row(4, 5, 6)}, + left: []sql.UntypedSqlRow{row(1, 2), row(4, 5)}, + right: []sql.UntypedSqlRow{row(1, 2, 3)}, + merged: []sql.UntypedSqlRow{row(1, 2)}, }, }, }, @@ -573,26 +573,26 @@ var collationTests = []schemaMergeTest{ }, { name: "right side insert", - ancestor: []sql.Row{{1, "hello"}}, - left: []sql.Row{{1, "hello"}}, - right: []sql.Row{{1, "hello"}, {2, "world"}}, - merged: []sql.Row{{1, "hello"}, {2, "world"}}, + ancestor: []sql.UntypedSqlRow{{1, "hello"}}, + left: []sql.UntypedSqlRow{{1, "hello"}}, + right: []sql.UntypedSqlRow{{1, "hello"}, {2, "world"}}, + merged: []sql.UntypedSqlRow{{1, "hello"}, {2, "world"}}, }, { name: "right side delete", - ancestor: []sql.Row{{1, "hello"}, {2, "world"}}, - left: []sql.Row{{1, "hello"}, {2, "world"}}, - right: []sql.Row{{1, "hello"}}, - merged: []sql.Row{{1, "hello"}}, + ancestor: []sql.UntypedSqlRow{{1, "hello"}, {2, "world"}}, + left: []sql.UntypedSqlRow{{1, "hello"}, {2, "world"}}, + right: []sql.UntypedSqlRow{{1, "hello"}}, + merged: []sql.UntypedSqlRow{{1, "hello"}}, }, { name: "right side insert causes unique violation", - ancestor: []sql.Row{{1, "hello"}}, - left: []sql.Row{{1, "hello"}}, - right: []sql.Row{{1, "hello"}, {2, "HELLO"}}, + ancestor: []sql.UntypedSqlRow{{1, "hello"}}, + left: []sql.UntypedSqlRow{{1, "hello"}}, + right: []sql.UntypedSqlRow{{1, "hello"}, {2, "HELLO"}}, constraintViolations: []constraintViolation{ - {merge.CvType_UniqueIndex, sql.Row{int32(1)}, sql.Row{"hello"}}, - {merge.CvType_UniqueIndex, sql.Row{int32(2)}, sql.Row{"HELLO"}}, + {merge.CvType_UniqueIndex, sql.UntypedSqlRow{int32(1)}, sql.UntypedSqlRow{"hello"}}, + {merge.CvType_UniqueIndex, sql.UntypedSqlRow{int32(2)}, sql.UntypedSqlRow{"HELLO"}}, }, }, }, @@ -613,26 +613,26 @@ var collationTests = []schemaMergeTest{ }, { name: "right side insert", - ancestor: []sql.Row{{1, "hello"}}, - left: []sql.Row{{1, "hello"}}, - right: []sql.Row{{1, "hello"}, {2, "world"}}, - merged: []sql.Row{{1, "hello"}, {2, "world"}}, + ancestor: []sql.UntypedSqlRow{{1, "hello"}}, + left: []sql.UntypedSqlRow{{1, "hello"}}, + right: []sql.UntypedSqlRow{{1, "hello"}, {2, "world"}}, + merged: []sql.UntypedSqlRow{{1, "hello"}, {2, "world"}}, }, { name: "right side delete", - ancestor: []sql.Row{{1, "hello"}, {2, "world"}}, - left: []sql.Row{{1, "hello"}, {2, "world"}}, - right: []sql.Row{{1, "hello"}}, - merged: []sql.Row{{1, "hello"}}, + ancestor: []sql.UntypedSqlRow{{1, "hello"}, {2, "world"}}, + left: []sql.UntypedSqlRow{{1, "hello"}, {2, "world"}}, + right: []sql.UntypedSqlRow{{1, "hello"}}, + merged: []sql.UntypedSqlRow{{1, "hello"}}, }, { name: "right side insert causes unique violation", - ancestor: []sql.Row{{1, "hello"}}, - left: []sql.Row{{1, "hello"}}, - right: []sql.Row{{1, "hello"}, {2, "HELLO"}}, + ancestor: []sql.UntypedSqlRow{{1, "hello"}}, + left: []sql.UntypedSqlRow{{1, "hello"}}, + right: []sql.UntypedSqlRow{{1, "hello"}, {2, "HELLO"}}, constraintViolations: []constraintViolation{ - {merge.CvType_UniqueIndex, sql.Row{int32(1)}, sql.Row{"hello"}}, - {merge.CvType_UniqueIndex, sql.Row{int32(2)}, sql.Row{"HELLO"}}, + {merge.CvType_UniqueIndex, sql.UntypedSqlRow{int32(1)}, sql.UntypedSqlRow{"hello"}}, + {merge.CvType_UniqueIndex, sql.UntypedSqlRow{int32(2)}, sql.UntypedSqlRow{"HELLO"}}, }, }, }, @@ -1822,7 +1822,7 @@ func maybeSkip(t *testing.T, nbf *types.NomsBinFormat, test schemaMergeTest, fli } } -func tbl(ns namedSchema, rows ...sql.Row) *table { +func tbl(ns namedSchema, rows ...sql.UntypedSqlRow) *table { return &table{ns: ns, rows: rows} } @@ -1843,12 +1843,12 @@ func sch(definition string) namedSchema { return namedSchema{name: name, sch: s, create: definition} } -func row(values ...any) sql.Row { - return sql.NewRow(values...) +func row(values ...any) sql.UntypedSqlRow { + return sql.NewUntypedRow(values...).(sql.UntypedSqlRow) } -func singleRow(values ...any) []sql.Row { - return []sql.Row{row(values...)} +func singleRow(values ...any) []sql.UntypedSqlRow { + return []sql.UntypedSqlRow{row(values...)} } func makeEmptyRoot(t *testing.T, ddb *doltdb.DoltDB, eo editor.Options) doltdb.RootValue { ctx := context.Background() diff --git a/go/libraries/doltcore/merge/violations_prolly.go b/go/libraries/doltcore/merge/violations_prolly.go index 977bb042638..5f80f569297 100644 --- a/go/libraries/doltcore/merge/violations_prolly.go +++ b/go/libraries/doltcore/merge/violations_prolly.go @@ -31,12 +31,14 @@ func NextConstraintViolation(ctx context.Context, itr prolly.ArtifactIter, kd, v return } - key = make(sql.Row, kd.Count()) + key = make(sql.UntypedSqlRow, kd.Count()) + var v interface{} for i := 0; i < kd.Count(); i++ { - key[i], err = tree.GetField(ctx, kd, i, art.SourceKey, ns) + v, err = tree.GetField(ctx, kd, i, art.SourceKey, ns) if err != nil { return } + key.SetValue(i, v) } var meta prolly.ConstraintViolationMeta @@ -45,12 +47,13 @@ func NextConstraintViolation(ctx context.Context, itr prolly.ArtifactIter, kd, v return } - value = make(sql.Row, vd.Count()) + value = make(sql.UntypedSqlRow, vd.Count()) for i := 0; i < vd.Count(); i++ { - value[i], err = tree.GetField(ctx, vd, i, meta.Value, ns) + v, err = tree.GetField(ctx, vd, i, meta.Value, ns) if err != nil { return } + value.SetValue(i, v) } return MapCVType(art.ArtType), key, value, nil diff --git a/go/libraries/doltcore/migrate/integration_test.go b/go/libraries/doltcore/migrate/integration_test.go index 317d783eb3b..1b523c3f4fa 100644 --- a/go/libraries/doltcore/migrate/integration_test.go +++ b/go/libraries/doltcore/migrate/integration_test.go @@ -51,7 +51,7 @@ type setupHook func(context.Context, *env.DoltEnv) (*env.DoltEnv, error) type assertion struct { query string - expected []sql.Row + expected []sql.UntypedSqlRow } func TestMigration(t *testing.T) { @@ -71,15 +71,15 @@ func TestMigration(t *testing.T) { asserts: []assertion{ { query: "SELECT * FROM test", - expected: []sql.Row{{int32(1)}, {int32(2)}, {int32(3)}}, + expected: []sql.UntypedSqlRow{{int32(1)}, {int32(2)}, {int32(3)}}, }, { query: "SELECT count(*) FROM dolt_log", - expected: []sql.Row{{int64(2)}}, + expected: []sql.UntypedSqlRow{{int64(2)}}, }, { query: "SELECT count(*) FROM `dolt/dolt_migrated_commits`.dolt_commit_mapping", - expected: []sql.Row{{int64(2)}}, + expected: []sql.UntypedSqlRow{{int64(2)}}, }, }, }, @@ -101,11 +101,11 @@ func TestMigration(t *testing.T) { asserts: []assertion{ { query: "SELECT * FROM test", - expected: []sql.Row{{"a", int32(2), []byte("a")}}, + expected: []sql.UntypedSqlRow{{"a", int32(2), []byte("a")}}, }, { query: "DESCRIBE test", - expected: []sql.Row{ + expected: []sql.UntypedSqlRow{ {"pk", "varchar(16383)", "NO", "PRI", "NULL", ""}, {"c0", "int", "YES", "", "NULL", ""}, {"c1", "varbinary(16383)", "YES", "MUL", "NULL", ""}, @@ -127,19 +127,19 @@ func TestMigration(t *testing.T) { asserts: []assertion{ { query: "SELECT count(*) FROM dolt_log", - expected: []sql.Row{{int64(4)}}, + expected: []sql.UntypedSqlRow{{int64(4)}}, }, { query: "SELECT count(*) FROM `dolt/dolt_migrated_commits`.dolt_commit_mapping", - expected: []sql.Row{{int64(4)}}, + expected: []sql.UntypedSqlRow{{int64(4)}}, }, { query: "SELECT count(*) FROM `dolt/dolt_migrated_commits`.dolt_commit_mapping WHERE new_commit_hash IN (SELECT commit_hash FROM dolt_log)", - expected: []sql.Row{{int64(4)}}, + expected: []sql.UntypedSqlRow{{int64(4)}}, }, { query: "SELECT count(*) FROM `dolt/dolt_migrated_commits`.dolt_commit_mapping WHERE new_commit_hash NOT IN (SELECT commit_hash FROM dolt_log)", - expected: []sql.Row{{int64(0)}}, + expected: []sql.UntypedSqlRow{{int64(0)}}, }, }, }, diff --git a/go/libraries/doltcore/migrate/validation.go b/go/libraries/doltcore/migrate/validation.go index 23080900cf8..f7bbd8fba8e 100644 --- a/go/libraries/doltcore/migrate/validation.go +++ b/go/libraries/doltcore/migrate/validation.go @@ -165,37 +165,37 @@ func validateTableDataPartition(ctx context.Context, name string, old, new *dolt } func equalRows(old, new sql.Row, sch sql.Schema) (bool, error) { - if len(new) != len(old) || len(new) != len(sch) { + if new.Len() != old.Len() || new.Len() != len(sch) { return false, nil } var err error var cmp int - for i := range new { + for i := 0; i < new.Len(); i++ { // special case string comparisons - if s, ok := old[i].(string); ok { - old[i] = strings.TrimRightFunc(s, unicode.IsSpace) + if s, ok := old.GetValue(i).(string); ok { + old.SetValue(i, strings.TrimRightFunc(s, unicode.IsSpace)) } - if s, ok := new[i].(string); ok { - new[i] = strings.TrimRightFunc(s, unicode.IsSpace) + if s, ok := new.GetValue(i).(string); ok { + new.SetValue(i, strings.TrimRightFunc(s, unicode.IsSpace)) } // special case time comparison to account // for precision changes between formats - if _, ok := old[i].(time.Time); ok { + if _, ok := old.GetValue(i).(time.Time); ok { var o, n interface{} - if o, _, err = gmstypes.Int64.Convert(old[i]); err != nil { + if o, _, err = gmstypes.Int64.Convert(old.GetValue(i)); err != nil { return false, err } - if n, _, err = gmstypes.Int64.Convert(new[i]); err != nil { + if n, _, err = gmstypes.Int64.Convert(new.GetValue(i)); err != nil { return false, err } if cmp, err = gmstypes.Int64.Compare(o, n); err != nil { return false, err } } else { - if cmp, err = sch[i].Type.Compare(old[i], new[i]); err != nil { + if cmp, err = sch[i].Type.Compare(old.GetValue(i), new.GetValue(i)); err != nil { return false, err } } diff --git a/go/libraries/doltcore/mvdata/engine_table_writer.go b/go/libraries/doltcore/mvdata/engine_table_writer.go index dc91cac6e7a..567b3b5dae6 100644 --- a/go/libraries/doltcore/mvdata/engine_table_writer.go +++ b/go/libraries/doltcore/mvdata/engine_table_writer.go @@ -154,9 +154,9 @@ func (s *SqlEngineTableWriter) WriteRows(ctx context.Context, inputChannel chan } // If the length of the row does not match the schema then we have an update operation. - if len(row) != len(s.tableSchema.Schema) { - oldRow := row[:len(row)/2] - newRow := row[len(row)/2:] + if row.Len() != len(s.tableSchema.Schema) { + oldRow := row.Subslice(0, row.Len()/2) + newRow := row.Subslice(row.Len()/2, row.Len()) if ok, err := oldRow.Equals(newRow, s.tableSchema.Schema); err == nil { if ok { diff --git a/go/libraries/doltcore/rebase/filter_branch_test.go b/go/libraries/doltcore/rebase/filter_branch_test.go index 1f0d1c76183..c858ec9adb3 100644 --- a/go/libraries/doltcore/rebase/filter_branch_test.go +++ b/go/libraries/doltcore/rebase/filter_branch_test.go @@ -52,7 +52,7 @@ type args []string type testAssertion struct { setup []testCommand query string - rows []sql.Row + rows []sql.UntypedSqlRow } var setupCommon = []testCommand{ @@ -78,7 +78,7 @@ func filterBranchTests() []filterBranchTest { asserts: []testAssertion{ { query: "select * from test", - rows: []sql.Row{ + rows: []sql.UntypedSqlRow{ {int32(0), int32(0)}, {int32(1), int32(1)}, {int32(2), int32(2)}, @@ -100,7 +100,7 @@ func filterBranchTests() []filterBranchTest { asserts: []testAssertion{ { query: "SELECT * FROM test", - rows: []sql.Row{ + rows: []sql.UntypedSqlRow{ {int32(0), int32(0)}, {int32(1), int32(1)}, {int32(2), int32(2)}, @@ -128,7 +128,7 @@ func filterBranchTests() []filterBranchTest { asserts: []testAssertion{ { query: "SELECT pk,c0 FROM dolt_history_test ORDER BY pk, c0", - rows: []sql.Row{ + rows: []sql.UntypedSqlRow{ {int32(0), int32(0)}, {int32(0), int32(0)}, {int32(1), int32(1)}, @@ -139,7 +139,7 @@ func filterBranchTests() []filterBranchTest { }, { query: "SELECT pk,c0 FROM dolt_history_test ORDER BY pk", - rows: []sql.Row{ + rows: []sql.UntypedSqlRow{ {int32(0), int32(0)}, {int32(0), int32(0)}, {int32(1), int32(1)}, @@ -153,7 +153,7 @@ func filterBranchTests() []filterBranchTest { {cmd.CheckoutCmd{}, args{"other"}}, }, query: "SELECT * FROM test;", - rows: []sql.Row{ + rows: []sql.UntypedSqlRow{ {int32(0), int32(0)}, {int32(1), int32(1)}, {int32(2), int32(2)}, @@ -162,7 +162,7 @@ func filterBranchTests() []filterBranchTest { }, { query: "SELECT pk,c0 FROM dolt_history_test ORDER BY pk,c0", - rows: []sql.Row{ + rows: []sql.UntypedSqlRow{ {int32(0), int32(0)}, {int32(0), int32(0)}, {int32(1), int32(1)}, @@ -190,7 +190,7 @@ func filterBranchTests() []filterBranchTest { }, { query: "SELECT count(*) FROM test AS OF 'HEAD~1';", - rows: []sql.Row{ + rows: []sql.UntypedSqlRow{ {int64(2)}, }, }, diff --git a/go/libraries/doltcore/sqle/binlogreplication/binlog_replica_applier.go b/go/libraries/doltcore/sqle/binlogreplication/binlog_replica_applier.go index 3833aecc6aa..2114261636b 100644 --- a/go/libraries/doltcore/sqle/binlogreplication/binlog_replica_applier.go +++ b/go/libraries/doltcore/sqle/binlogreplication/binlog_replica_applier.go @@ -802,7 +802,7 @@ func parseRow(ctx *sql.Context, tableMap *mysql.TableMap, schema sql.Schema, col column := schema[i] if columnsPresentBitmap.Bit(i) == false { - parsedRow = append(parsedRow, nil) + parsedRow = parsedRow.Append(sql.NewUntypedRow(nil)) continue } @@ -826,7 +826,7 @@ func parseRow(ctx *sql.Context, tableMap *mysql.TableMap, schema sql.Schema, col if err != nil { return nil, err } - parsedRow = append(parsedRow, convertedValue) + parsedRow = parsedRow.Append(sql.NewUntypedRow(convertedValue)) } return parsedRow, nil @@ -921,7 +921,7 @@ func convertVitessJsonExpressionString(ctx *sql.Context, value sqltypes.Value) ( return nil, err } - return row[0], nil + return row.GetValue(0), nil } func getAllUserDatabaseNames(ctx *sql.Context, engine *gms.Engine) []string { diff --git a/go/libraries/doltcore/sqle/cluster/assume_role.go b/go/libraries/doltcore/sqle/cluster/assume_role.go index d18ce8a1fe5..aba73f1e32b 100644 --- a/go/libraries/doltcore/sqle/cluster/assume_role.go +++ b/go/libraries/doltcore/sqle/cluster/assume_role.go @@ -54,7 +54,7 @@ func newAssumeRoleProcedure(controller *Controller) sql.ExternalStoredProcedureD ctx.Session.SetTransaction(nil) dsess.DSessFromSess(ctx.Session).SetValidateErr(ErrServerTransitionedRolesErr) } - return sql.RowsToRowIter(sql.Row{0}), nil + return sql.RowsToRowIter(sql.UntypedSqlRow{0}), nil }, ReadOnly: true, } @@ -106,7 +106,7 @@ func newTransitionToStandbyProcedure(controller *Controller) sql.ExternalStoredP if r.caughtUp { caughtUp = 1 } - rows[i] = sql.Row{ + rows[i] = sql.UntypedSqlRow{ caughtUp, r.database, r.remote, diff --git a/go/libraries/doltcore/sqle/clusterdb/cluster_status_table.go b/go/libraries/doltcore/sqle/clusterdb/cluster_status_table.go index 1bb62a13798..ba8f7669919 100644 --- a/go/libraries/doltcore/sqle/clusterdb/cluster_status_table.go +++ b/go/libraries/doltcore/sqle/clusterdb/cluster_status_table.go @@ -93,7 +93,7 @@ func replicaStatusesToRows(rss []ReplicaStatus) []sql.Row { } func replicaStatusToRow(rs ReplicaStatus) sql.Row { - ret := make(sql.Row, 7) + ret := make(sql.UntypedSqlRow, 7) ret[0] = rs.Database ret[1] = rs.Remote ret[2] = rs.Role diff --git a/go/libraries/doltcore/sqle/common_test.go b/go/libraries/doltcore/sqle/common_test.go index 1c5e3a45137..103a304e566 100644 --- a/go/libraries/doltcore/sqle/common_test.go +++ b/go/libraries/doltcore/sqle/common_test.go @@ -38,7 +38,7 @@ type SetupFn func(t *testing.T, dEnv *env.DoltEnv) // Runs the query given and returns the result. The schema result of the query's execution is currently ignored, and // the targetSchema given is used to prepare all rows. -func executeSelect(t *testing.T, ctx context.Context, dEnv *env.DoltEnv, root doltdb.RootValue, query string) ([]sql.Row, sql.Schema, error) { +func executeSelect(t *testing.T, ctx context.Context, dEnv *env.DoltEnv, root doltdb.RootValue, query string) ([]sql.UntypedSqlRow, sql.Schema, error) { tmpDir, err := dEnv.TempTableFilesDir() require.NoError(t, err) opts := editor.Options{Deaf: dEnv.DbEaFactory(), Tempdir: tmpDir} @@ -55,10 +55,10 @@ func executeSelect(t *testing.T, ctx context.Context, dEnv *env.DoltEnv, root do return nil, nil, err } - sqlRows := make([]sql.Row, 0) + sqlRows := make([]sql.UntypedSqlRow, 0) var r sql.Row for r, err = iter.Next(sqlCtx); err == nil; r, err = iter.Next(sqlCtx) { - sqlRows = append(sqlRows, r) + sqlRows = append(sqlRows, r.Values()) } if err != io.EOF { diff --git a/go/libraries/doltcore/sqle/database.go b/go/libraries/doltcore/sqle/database.go index 61edb64dc29..f55deb47edc 100644 --- a/go/libraries/doltcore/sqle/database.go +++ b/go/libraries/doltcore/sqle/database.go @@ -2239,7 +2239,7 @@ func (db Database) addFragToSchemasTable(ctx *sql.Context, fragType, name, defin sqlMode := sql.LoadSqlMode(ctx) - return inserter.Insert(ctx, sql.Row{fragType, name, definition, extraJSON, sqlMode.String()}) + return inserter.Insert(ctx, sql.UntypedSqlRow{fragType, name, definition, extraJSON, sqlMode.String()}) } func (db Database) dropFragFromSchemasTable(ctx *sql.Context, fragType, name string, missingErr error) error { @@ -2378,21 +2378,21 @@ func (db Database) SetCollation(ctx *sql.Context, collation sql.CollationID) err var ConvertRowToRebasePlanStep = convertRowToRebasePlanStep func convertRowToRebasePlanStep(row sql.Row) (rebase.RebasePlanStep, error) { - i, ok := row[1].(uint16) + i, ok := row.GetValue(1).(uint16) if !ok { - return rebase.RebasePlanStep{}, fmt.Errorf("invalid enum value in rebase plan: %v (%T)", row[1], row[1]) + return rebase.RebasePlanStep{}, fmt.Errorf("invalid enum value in rebase plan: %v (%T)", row.GetValue(1), row.GetValue(1)) } rebaseAction, ok := dprocedures.RebaseActionEnumType.At(int(i)) if !ok { - return rebase.RebasePlanStep{}, fmt.Errorf("invalid enum value in rebase plan: %v (%T)", row[1], row[1]) + return rebase.RebasePlanStep{}, fmt.Errorf("invalid enum value in rebase plan: %v (%T)", row.GetValue(1), row.GetValue(1)) } return rebase.RebasePlanStep{ - RebaseOrder: row[0].(decimal.Decimal), + RebaseOrder: row.GetValue(0).(decimal.Decimal), Action: rebaseAction, - CommitHash: row[2].(string), - CommitMsg: row[3].(string), + CommitHash: row.GetValue(2).(string), + CommitMsg: row.GetValue(3).(string), }, nil } @@ -2448,7 +2448,7 @@ func convertRebasePlanStepToRow(planMember rebase.RebasePlanStep) (sql.Row, erro if actionEnumValue == -1 { return nil, fmt.Errorf("invalid rebase action: %s", planMember.Action) } - return sql.Row{ + return sql.UntypedSqlRow{ planMember.RebaseOrder, uint16(actionEnumValue), planMember.CommitHash, @@ -2488,7 +2488,6 @@ func (db Database) SaveRebasePlan(ctx *sql.Context, plan *rebase.RebasePlan) err if err != nil { return err } - err = inserter.Insert(ctx, row) if err != nil { return err diff --git a/go/libraries/doltcore/sqle/dprocedures/dolt_count_commits.go b/go/libraries/doltcore/sqle/dprocedures/dolt_count_commits.go index 5ca6ddabed9..f776ff4985d 100644 --- a/go/libraries/doltcore/sqle/dprocedures/dolt_count_commits.go +++ b/go/libraries/doltcore/sqle/dprocedures/dolt_count_commits.go @@ -33,7 +33,7 @@ func doltCountCommits(ctx *sql.Context, args ...string) (sql.RowIter, error) { if err != nil { return nil, err } - return sql.RowsToRowIter(sql.Row{ahead, behind}), nil + return sql.RowsToRowIter(sql.UntypedSqlRow{ahead, behind}), nil } func countCommits(ctx *sql.Context, args ...string) (ahead uint64, behind uint64, err error) { diff --git a/go/libraries/doltcore/sqle/dprocedures/init.go b/go/libraries/doltcore/sqle/dprocedures/init.go index 1b96e1f88b0..be79c9188a6 100644 --- a/go/libraries/doltcore/sqle/dprocedures/init.go +++ b/go/libraries/doltcore/sqle/dprocedures/init.go @@ -84,9 +84,9 @@ func int64Schema(columnNames ...string) sql.Schema { // rowToIter returns a sql.RowIter with a single row containing the values passed in. func rowToIter(vals ...interface{}) sql.RowIter { - row := make(sql.Row, len(vals)) + row := make(sql.UntypedSqlRow, len(vals)) for i, val := range vals { - row[i] = val + row.SetValue(i, val) } return sql.RowsToRowIter(row) } diff --git a/go/libraries/doltcore/sqle/dtablefunctions/dolt_diff_stat_table_function.go b/go/libraries/doltcore/sqle/dtablefunctions/dolt_diff_stat_table_function.go index 1d1fe0e3cf0..2d320a2651c 100644 --- a/go/libraries/doltcore/sqle/dtablefunctions/dolt_diff_stat_table_function.go +++ b/go/libraries/doltcore/sqle/dtablefunctions/dolt_diff_stat_table_function.go @@ -527,7 +527,7 @@ func (d *diffStatTableFunctionRowIter) Close(context *sql.Context) error { func getRowFromDiffStat(tblName doltdb.TableName, dsp diff.DiffStatProgress, newColLen, oldColLen int, keyless bool) sql.Row { // if table is keyless table, match current CLI command result if keyless { - return sql.Row{ + return sql.UntypedSqlRow{ tblName.String(), // table_name nil, // rows_unmodified int64(dsp.Adds), // rows_added @@ -546,7 +546,7 @@ func getRowFromDiffStat(tblName doltdb.TableName, dsp diff.DiffStatProgress, new numCellInserts, numCellDeletes := GetCellsAddedAndDeleted(dsp, newColLen) rowsUnmodified := dsp.OldRowSize - dsp.Changes - dsp.Removes - return sql.Row{ + return sql.UntypedSqlRow{ tblName.String(), // table_name int64(rowsUnmodified), // rows_unmodified int64(dsp.Adds), // rows_added diff --git a/go/libraries/doltcore/sqle/dtablefunctions/dolt_diff_summary_table_function.go b/go/libraries/doltcore/sqle/dtablefunctions/dolt_diff_summary_table_function.go index 440a4ccfbbf..549ea5e0cf6 100644 --- a/go/libraries/doltcore/sqle/dtablefunctions/dolt_diff_summary_table_function.go +++ b/go/libraries/doltcore/sqle/dtablefunctions/dolt_diff_summary_table_function.go @@ -427,7 +427,7 @@ func (d *diffSummaryTableFunctionRowIter) Close(context *sql.Context) error { } func getRowFromSummary(ds *diff.TableDeltaSummary) sql.Row { - return sql.Row{ + return sql.UntypedSqlRow{ ds.FromTableName.String(), // from_table_name ds.ToTableName.String(), // to_table_name ds.DiffType, // diff_type diff --git a/go/libraries/doltcore/sqle/dtablefunctions/dolt_patch_table_function.go b/go/libraries/doltcore/sqle/dtablefunctions/dolt_patch_table_function.go index a06cdc0bf98..0780f18e6e2 100644 --- a/go/libraries/doltcore/sqle/dtablefunctions/dolt_patch_table_function.go +++ b/go/libraries/doltcore/sqle/dtablefunctions/dolt_patch_table_function.go @@ -743,7 +743,7 @@ func (itr *patchTableFunctionRowIter) Next(ctx *sql.Context) (sql.Row, error) { return nil, err } else { itr.statementIdx++ - r := sql.Row{ + r := sql.UntypedSqlRow{ itr.statementIdx, // statement_order itr.fromRef, // from_commit_hash itr.toRef, // to_commit_hash @@ -798,7 +798,7 @@ func (p *patchStatementsRowIter) Next(ctx *sql.Context) (sql.Row, error) { diffType = diffTypeData } - return sql.Row{ + return sql.UntypedSqlRow{ diffType, // diff_type stmt, // statement }, nil diff --git a/go/libraries/doltcore/sqle/dtablefunctions/dolt_query_diff_table_function.go b/go/libraries/doltcore/sqle/dtablefunctions/dolt_query_diff_table_function.go index 31090ae740f..03a0f488c16 100644 --- a/go/libraries/doltcore/sqle/dtablefunctions/dolt_query_diff_table_function.go +++ b/go/libraries/doltcore/sqle/dtablefunctions/dolt_query_diff_table_function.go @@ -180,7 +180,7 @@ func (tf *QueryDiffTableFunction) compareRows(pkOrds []int, row1, row2 sql.Row) var cmp int var err error for i, pkOrd := range pkOrds { - cmp, err = tf.schema1[i].Type.Compare(row1[pkOrd], row2[pkOrd]) + cmp, err = tf.schema1[i].Type.Compare(row1.GetValue(pkOrd), row2.GetValue(pkOrd)) if err != nil { return 0, false, err } @@ -189,8 +189,8 @@ func (tf *QueryDiffTableFunction) compareRows(pkOrds []int, row1, row2 sql.Row) } } var diff bool - for i := 0; i < len(row1); i++ { - if row1[i] != row2[i] { + for i := 0; i < row1.Len(); i++ { + if row1.GetValue(i) != row2.GetValue(i) { diff = true break } @@ -211,8 +211,8 @@ func (tf *QueryDiffTableFunction) RowIter(ctx *sql.Context, _ sql.Row) (sql.RowI // keylessRowIter uses the entire row for difference comparison func (tf *QueryDiffTableFunction) keylessRowIter() (sql.RowIter, error) { var results []sql.Row - var newRow sql.Row - nilRow1, nilRow2 := make(sql.Row, len(tf.schema1)), make(sql.Row, len(tf.schema2)) + var newRow sql.UntypedSqlRow + nilRow1, nilRow2 := make(sql.UntypedSqlRow, len(tf.schema1)), make(sql.UntypedSqlRow, len(tf.schema2)) for { row, err := tf.rowIter1.Next(tf.ctx) if err == io.EOF { @@ -221,7 +221,7 @@ func (tf *QueryDiffTableFunction) keylessRowIter() (sql.RowIter, error) { if err != nil { return nil, err } - newRow = append(append(row, nilRow2...), "deleted") + newRow = append(append(row.Values(), nilRow2...), "deleted") results = append(results, newRow) } for { @@ -232,7 +232,7 @@ func (tf *QueryDiffTableFunction) keylessRowIter() (sql.RowIter, error) { if err != nil { return nil, err } - newRow = append(append(nilRow1, row...), "added") + newRow = append(append(nilRow1, row.Values()...), "added") results = append(results, newRow) } return sql.RowsToRowIter(results...), nil @@ -241,7 +241,7 @@ func (tf *QueryDiffTableFunction) keylessRowIter() (sql.RowIter, error) { // pkRowIter uses primary keys to do an efficient row comparison func (tf *QueryDiffTableFunction) pkRowIter() (sql.RowIter, error) { var results []sql.Row - var newRow sql.Row + var newRow sql.UntypedSqlRow row1, err1 := tf.rowIter1.Next(tf.ctx) row2, err2 := tf.rowIter2.Next(tf.ctx) var pkOrds []int @@ -250,7 +250,8 @@ func (tf *QueryDiffTableFunction) pkRowIter() (sql.RowIter, error) { pkOrds = append(pkOrds, i) } } - nilRow := make(sql.Row, len(tf.schema1)) + + nilRow := make(sql.UntypedSqlRow, len(tf.schema1)) for err1 == nil && err2 == nil { cmp, d, err := tf.compareRows(pkOrds, row1, row2) if err != nil { @@ -258,16 +259,16 @@ func (tf *QueryDiffTableFunction) pkRowIter() (sql.RowIter, error) { } switch cmp { case -1: // deleted - newRow = append(append(row1, nilRow...), "deleted") + newRow = append(append(row1.Values(), nilRow...), "deleted") results = append(results, newRow) row1, err1 = tf.rowIter1.Next(tf.ctx) case 1: // added - newRow = append(append(nilRow, row2...), "added") + newRow = append(append(nilRow, row2.Values()...), "added") results = append(results, newRow) row2, err2 = tf.rowIter2.Next(tf.ctx) default: // modified or no change if d { - newRow = append(append(row1, row2...), "modified") + newRow = append(append(row1.Values(), row2.Values()...), "modified") results = append(results, newRow) } row1, err1 = tf.rowIter1.Next(tf.ctx) @@ -279,25 +280,25 @@ func (tf *QueryDiffTableFunction) pkRowIter() (sql.RowIter, error) { if err1 == io.EOF && err2 == io.EOF { return sql.RowsToRowIter(results...), nil } else if err1 == io.EOF { - newRow = append(append(nilRow, row2...), "added") + newRow = append(append(nilRow, row2.Values()...), "added") results = append(results, newRow) for { row2, err2 = tf.rowIter2.Next(tf.ctx) if err2 == io.EOF { break } - newRow = append(append(nilRow, row2...), "added") + newRow = append(append(nilRow, row2.Values()...), "added") results = append(results, newRow) } } else if err2 == io.EOF { - newRow = append(append(row1, nilRow...), "deleted") + newRow = append(append(row1.Values(), nilRow...), "deleted") results = append(results, newRow) for { row1, err1 = tf.rowIter1.Next(tf.ctx) if err1 == io.EOF { break } - newRow = append(append(row1, nilRow...), "deleted") + newRow = append(append(row1.Values(), nilRow...), "deleted") results = append(results, newRow) } } else { diff --git a/go/libraries/doltcore/sqle/dtablefunctions/dolt_schema_diff_table_function.go b/go/libraries/doltcore/sqle/dtablefunctions/dolt_schema_diff_table_function.go index b03b877e698..39b0d86f669 100644 --- a/go/libraries/doltcore/sqle/dtablefunctions/dolt_schema_diff_table_function.go +++ b/go/libraries/doltcore/sqle/dtablefunctions/dolt_schema_diff_table_function.go @@ -334,7 +334,7 @@ func (ds *SchemaDiffTableFunction) RowIter(ctx *sql.Context, row sql.Row) (sql.R continue } - row := sql.Row{ + row := sql.UntypedSqlRow{ fromName.String(), // from_table_name toName.String(), // to_table_name fromCreate, // from_create_statement diff --git a/go/libraries/doltcore/sqle/dtablefunctions/reflog_table_function.go b/go/libraries/doltcore/sqle/dtablefunctions/reflog_table_function.go index cb64fcc410d..cf655bad245 100644 --- a/go/libraries/doltcore/sqle/dtablefunctions/reflog_table_function.go +++ b/go/libraries/doltcore/sqle/dtablefunctions/reflog_table_function.go @@ -165,7 +165,7 @@ func (rltf *ReflogTableFunction) RowIter(ctx *sql.Context, row sql.Row) (sql.Row ts = *timestamp } - rows = append(rows, sql.Row{ + rows = append(rows, sql.UntypedSqlRow{ id, // ref ts, // ref_timestamp addr.String(), // commit_hash diff --git a/go/libraries/doltcore/sqle/dtables/binlog_table.go b/go/libraries/doltcore/sqle/dtables/binlog_table.go index 5dbd8d1c034..976b19dfd14 100644 --- a/go/libraries/doltcore/sqle/dtables/binlog_table.go +++ b/go/libraries/doltcore/sqle/dtables/binlog_table.go @@ -163,7 +163,7 @@ func (b BinlogTable) PartitionRows(context *sql.Context, partition sql.Partition } if b.IsAccess { - rows[i] = sql.Row{ + rows[i] = sql.UntypedSqlRow{ int64(i), operation, logRow.Branch, @@ -172,7 +172,7 @@ func (b BinlogTable) PartitionRows(context *sql.Context, partition sql.Partition logRow.Permissions, } } else { - rows[i] = sql.Row{ + rows[i] = sql.UntypedSqlRow{ int64(i), operation, logRow.Branch, diff --git a/go/libraries/doltcore/sqle/dtables/branch_control_table.go b/go/libraries/doltcore/sqle/dtables/branch_control_table.go index ff7d4aa6e46..d4f777461b2 100644 --- a/go/libraries/doltcore/sqle/dtables/branch_control_table.go +++ b/go/libraries/doltcore/sqle/dtables/branch_control_table.go @@ -122,7 +122,7 @@ func (tbl BranchControlTable) PartitionRows(context *sql.Context, partition sql. var rows []sql.Row rowIter := tbl.Iter() for value, ok := rowIter.Next(); ok; value, ok = rowIter.Next() { - rows = append(rows, sql.Row{ + rows = append(rows, sql.UntypedSqlRow{ value.Database, value.Branch, value.User, @@ -176,11 +176,11 @@ func (tbl BranchControlTable) Insert(ctx *sql.Context, row sql.Row) error { defer tbl.RWMutex.Unlock() // Database, Branch, and Host are case-insensitive, while user is case-sensitive - database := strings.ToLower(branch_control.FoldExpression(row[0].(string))) - branch := strings.ToLower(branch_control.FoldExpression(row[1].(string))) - user := branch_control.FoldExpression(row[2].(string)) - host := strings.ToLower(branch_control.FoldExpression(row[3].(string))) - perms := branch_control.Permissions(row[4].(uint64)) + database := strings.ToLower(branch_control.FoldExpression(row.GetValue(0).(string))) + branch := strings.ToLower(branch_control.FoldExpression(row.GetValue(1).(string))) + user := branch_control.FoldExpression(row.GetValue(2).(string)) + host := strings.ToLower(branch_control.FoldExpression(row.GetValue(3).(string))) + perms := branch_control.Permissions(row.GetValue(4).(uint64)) // Verify that the lengths of each expression fit within an uint16 if len(database) > math.MaxUint16 || len(branch) > math.MaxUint16 || len(user) > math.MaxUint16 || len(host) > math.MaxUint16 { @@ -210,7 +210,7 @@ func (tbl BranchControlTable) Insert(ctx *sql.Context, row sql.Row) error { return sql.NewUniqueKeyErr( fmt.Sprintf(`[%q, %q, %q, %q, %q]`, database, branch, user, host, permStr), true, - sql.Row{database, branch, user, host, permBits}) + sql.UntypedSqlRow{database, branch, user, host, permBits}) } tbl.Access.Insert(database, branch, user, host, perms) @@ -223,15 +223,15 @@ func (tbl BranchControlTable) Update(ctx *sql.Context, old sql.Row, new sql.Row) defer tbl.RWMutex.Unlock() // Database, Branch, and Host are case-insensitive, while User is case-sensitive - oldDatabase := strings.ToLower(branch_control.FoldExpression(old[0].(string))) - oldBranch := strings.ToLower(branch_control.FoldExpression(old[1].(string))) - oldUser := branch_control.FoldExpression(old[2].(string)) - oldHost := strings.ToLower(branch_control.FoldExpression(old[3].(string))) - newDatabase := strings.ToLower(branch_control.FoldExpression(new[0].(string))) - newBranch := strings.ToLower(branch_control.FoldExpression(new[1].(string))) - newUser := branch_control.FoldExpression(new[2].(string)) - newHost := strings.ToLower(branch_control.FoldExpression(new[3].(string))) - newPerms := branch_control.Permissions(new[4].(uint64)) + oldDatabase := strings.ToLower(branch_control.FoldExpression(old.GetValue(0).(string))) + oldBranch := strings.ToLower(branch_control.FoldExpression(old.GetValue(1).(string))) + oldUser := branch_control.FoldExpression(old.GetValue(2).(string)) + oldHost := strings.ToLower(branch_control.FoldExpression(old.GetValue(3).(string))) + newDatabase := strings.ToLower(branch_control.FoldExpression(new.GetValue(0).(string))) + newBranch := strings.ToLower(branch_control.FoldExpression(new.GetValue(1).(string))) + newUser := branch_control.FoldExpression(new.GetValue(2).(string)) + newHost := strings.ToLower(branch_control.FoldExpression(new.GetValue(3).(string))) + newPerms := branch_control.Permissions(new.GetValue(4).(uint64)) // Verify that the lengths of each expression fit within an uint16 if len(newDatabase) > math.MaxUint16 || len(newBranch) > math.MaxUint16 || len(newUser) > math.MaxUint16 || len(newHost) > math.MaxUint16 { @@ -246,7 +246,7 @@ func (tbl BranchControlTable) Update(ctx *sql.Context, old sql.Row, new sql.Row) return sql.NewUniqueKeyErr( fmt.Sprintf(`[%q, %q, %q, %q, %q]`, newDatabase, newBranch, newUser, newHost, permStr), true, - sql.Row{newDatabase, newBranch, newUser, newHost, permBits}) + sql.UntypedSqlRow{newDatabase, newBranch, newUser, newHost, permBits}) } } @@ -283,10 +283,10 @@ func (tbl BranchControlTable) Delete(ctx *sql.Context, row sql.Row) error { defer tbl.RWMutex.Unlock() // Database, Branch, and Host are case-insensitive, while User is case-sensitive - database := strings.ToLower(branch_control.FoldExpression(row[0].(string))) - branch := strings.ToLower(branch_control.FoldExpression(row[1].(string))) - user := branch_control.FoldExpression(row[2].(string)) - host := strings.ToLower(branch_control.FoldExpression(row[3].(string))) + database := strings.ToLower(branch_control.FoldExpression(row.GetValue(0).(string))) + branch := strings.ToLower(branch_control.FoldExpression(row.GetValue(1).(string))) + user := branch_control.FoldExpression(row.GetValue(2).(string)) + host := strings.ToLower(branch_control.FoldExpression(row.GetValue(3).(string))) // A nil session means we're not in the SQL context, so we allow the deletion in such a case if branchAwareSession := branch_control.GetBranchAwareSession(ctx); branchAwareSession != nil && diff --git a/go/libraries/doltcore/sqle/dtables/branch_namespace_control.go b/go/libraries/doltcore/sqle/dtables/branch_namespace_control.go index 1c77f66fb6a..4f3cc83ba65 100644 --- a/go/libraries/doltcore/sqle/dtables/branch_namespace_control.go +++ b/go/libraries/doltcore/sqle/dtables/branch_namespace_control.go @@ -113,7 +113,7 @@ func (tbl BranchNamespaceControlTable) PartitionRows(context *sql.Context, parti var rows []sql.Row for _, value := range tbl.Values { - rows = append(rows, sql.Row{ + rows = append(rows, sql.UntypedSqlRow{ value.Database, value.Branch, value.User, @@ -166,10 +166,10 @@ func (tbl BranchNamespaceControlTable) Insert(ctx *sql.Context, row sql.Row) err defer tbl.RWMutex.Unlock() // Database, Branch, and Host are case-insensitive, while user is case-sensitive - database := strings.ToLower(branch_control.FoldExpression(row[0].(string))) - branch := strings.ToLower(branch_control.FoldExpression(row[1].(string))) - user := branch_control.FoldExpression(row[2].(string)) - host := strings.ToLower(branch_control.FoldExpression(row[3].(string))) + database := strings.ToLower(branch_control.FoldExpression(row.GetValue(0).(string))) + branch := strings.ToLower(branch_control.FoldExpression(row.GetValue(1).(string))) + user := branch_control.FoldExpression(row.GetValue(2).(string)) + host := strings.ToLower(branch_control.FoldExpression(row.GetValue(3).(string))) // Verify that the lengths of each expression fit within an uint16 if len(database) > math.MaxUint16 || len(branch) > math.MaxUint16 || len(user) > math.MaxUint16 || len(host) > math.MaxUint16 { @@ -202,14 +202,14 @@ func (tbl BranchNamespaceControlTable) Update(ctx *sql.Context, old sql.Row, new defer tbl.RWMutex.Unlock() // Database, Branch, and Host are case-insensitive, while User is case-sensitive - oldDatabase := strings.ToLower(branch_control.FoldExpression(old[0].(string))) - oldBranch := strings.ToLower(branch_control.FoldExpression(old[1].(string))) - oldUser := branch_control.FoldExpression(old[2].(string)) - oldHost := strings.ToLower(branch_control.FoldExpression(old[3].(string))) - newDatabase := strings.ToLower(branch_control.FoldExpression(new[0].(string))) - newBranch := strings.ToLower(branch_control.FoldExpression(new[1].(string))) - newUser := branch_control.FoldExpression(new[2].(string)) - newHost := strings.ToLower(branch_control.FoldExpression(new[3].(string))) + oldDatabase := strings.ToLower(branch_control.FoldExpression(old.GetValue(0).(string))) + oldBranch := strings.ToLower(branch_control.FoldExpression(old.GetValue(1).(string))) + oldUser := branch_control.FoldExpression(old.GetValue(2).(string)) + oldHost := strings.ToLower(branch_control.FoldExpression(old.GetValue(3).(string))) + newDatabase := strings.ToLower(branch_control.FoldExpression(new.GetValue(0).(string))) + newBranch := strings.ToLower(branch_control.FoldExpression(new.GetValue(1).(string))) + newUser := branch_control.FoldExpression(new.GetValue(2).(string)) + newHost := strings.ToLower(branch_control.FoldExpression(new.GetValue(3).(string))) // Verify that the lengths of each expression fit within an uint16 if len(newDatabase) > math.MaxUint16 || len(newBranch) > math.MaxUint16 || len(newUser) > math.MaxUint16 || len(newHost) > math.MaxUint16 { @@ -222,7 +222,7 @@ func (tbl BranchNamespaceControlTable) Update(ctx *sql.Context, old sql.Row, new return sql.NewUniqueKeyErr( fmt.Sprintf(`[%q, %q, %q, %q]`, newDatabase, newBranch, newUser, newHost), true, - sql.Row{newDatabase, newBranch, newUser, newHost}) + sql.UntypedSqlRow{newDatabase, newBranch, newUser, newHost}) } } @@ -264,10 +264,10 @@ func (tbl BranchNamespaceControlTable) Delete(ctx *sql.Context, row sql.Row) err defer tbl.RWMutex.Unlock() // Database, Branch, and Host are case-insensitive, while User is case-sensitive - database := strings.ToLower(branch_control.FoldExpression(row[0].(string))) - branch := strings.ToLower(branch_control.FoldExpression(row[1].(string))) - user := branch_control.FoldExpression(row[2].(string)) - host := strings.ToLower(branch_control.FoldExpression(row[3].(string))) + database := strings.ToLower(branch_control.FoldExpression(row.GetValue(0).(string))) + branch := strings.ToLower(branch_control.FoldExpression(row.GetValue(1).(string))) + user := branch_control.FoldExpression(row.GetValue(2).(string)) + host := strings.ToLower(branch_control.FoldExpression(row.GetValue(3).(string))) // A nil session means we're not in the SQL context, so we allow the deletion in such a case if branchAwareSession := branch_control.GetBranchAwareSession(ctx); branchAwareSession != nil && @@ -302,7 +302,7 @@ func (tbl BranchNamespaceControlTable) insert(ctx context.Context, database, bra return sql.NewUniqueKeyErr( fmt.Sprintf(`[%q, %q, %q, %q]`, database, branch, user, host), true, - sql.Row{database, branch, user, host}) + sql.UntypedSqlRow{database, branch, user, host}) } // Add an entry to the binlog diff --git a/go/libraries/doltcore/sqle/dtables/column_diff_table.go b/go/libraries/doltcore/sqle/dtables/column_diff_table.go index ba6e6eb24d0..e2e2ce2ff93 100644 --- a/go/libraries/doltcore/sqle/dtables/column_diff_table.go +++ b/go/libraries/doltcore/sqle/dtables/column_diff_table.go @@ -565,7 +565,7 @@ func calculateColDelta(ctx *sql.Context, ddb *doltdb.DoltDB, delta *diff.TableDe fromIdx := diffTableCols.TagToIdx[fromColTag] toCol := delta.ToSch.GetAllCols().GetByIndex(toIdx) - cmp, err := toCol.TypeInfo.ToSqlType().Compare(r[toIdx], r[fromIdx]) + cmp, err := toCol.TypeInfo.ToSqlType().Compare(r.GetValue(toIdx), r.GetValue(fromIdx)) if err != nil { return nil, nil, err } diff --git a/go/libraries/doltcore/sqle/dtables/conflicts_tables_prolly.go b/go/libraries/doltcore/sqle/dtables/conflicts_tables_prolly.go index 3201c0d0bff..3a1eae9ebaf 100644 --- a/go/libraries/doltcore/sqle/dtables/conflicts_tables_prolly.go +++ b/go/libraries/doltcore/sqle/dtables/conflicts_tables_prolly.go @@ -205,8 +205,8 @@ func (itr *prollyConflictRowIter) Next(ctx *sql.Context) (sql.Row, error) { return nil, err } - r := make(sql.Row, itr.n) - r[0] = c.h.String() + r := make(sql.UntypedSqlRow, itr.n) + r.SetValue(0, c.h.String()) if !itr.keyless { for i := 0; i < itr.kd.Count(); i++ { @@ -215,13 +215,13 @@ func (itr *prollyConflictRowIter) Next(ctx *sql.Context) (sql.Row, error) { return nil, err } if c.bV != nil { - r[itr.b+i] = f + r.SetValue(itr.b+i, f) } if c.oV != nil { - r[itr.o+i] = f + r.SetValue(itr.o+i, f) } if c.tV != nil { - r[itr.t+i] = f + r.SetValue(itr.t+i, f) } } @@ -247,7 +247,7 @@ func (itr *prollyConflictRowIter) putConflictRowVals(ctx *sql.Context, c conf, r if err != nil { return err } - r[itr.b+itr.kd.Count()+i] = f + r.SetValue(itr.b+itr.kd.Count()+i, f) } } @@ -257,10 +257,10 @@ func (itr *prollyConflictRowIter) putConflictRowVals(ctx *sql.Context, c conf, r if err != nil { return err } - r[itr.o+itr.kd.Count()+i] = f + r.SetValue(itr.o+itr.kd.Count()+i, f) } } - r[itr.o+itr.kd.Count()+itr.oursVD.Count()] = getDiffType(c.bV, c.oV) + r.SetValue(itr.o+itr.kd.Count()+itr.oursVD.Count(), getDiffType(c.bV, c.oV)) if c.tV != nil { for i := 0; i < itr.theirsVD.Count(); i++ { @@ -268,11 +268,11 @@ func (itr *prollyConflictRowIter) putConflictRowVals(ctx *sql.Context, c conf, r if err != nil { return err } - r[itr.t+itr.kd.Count()+i] = f + r.SetValue(itr.t+itr.kd.Count()+i, f) } } - r[itr.t+itr.kd.Count()+itr.theirsVD.Count()] = getDiffType(c.bV, c.tV) - r[itr.t+itr.kd.Count()+itr.theirsVD.Count()+1] = c.id + r.SetValue(itr.t+itr.kd.Count()+itr.theirsVD.Count(), getDiffType(c.bV, c.tV)) + r.SetValue(itr.t+itr.kd.Count()+itr.theirsVD.Count()+1, c.id) return nil } @@ -291,63 +291,67 @@ func getDiffType(base val.Tuple, other val.Tuple) string { func (itr *prollyConflictRowIter) putKeylessConflictRowVals(ctx *sql.Context, c conf, r sql.Row) (err error) { ns := itr.baseRows.NodeStore() + var v interface{} if c.bV != nil { // Cardinality - r[itr.n-3], err = tree.GetField(ctx, itr.baseVD, 0, c.bV, ns) + v, err = tree.GetField(ctx, itr.baseVD, 0, c.bV, ns) if err != nil { return err } + r.SetValue(itr.n-3, v) for i := 0; i < itr.baseVD.Count()-1; i++ { f, err := tree.GetField(ctx, itr.baseVD, i+1, c.bV, ns) if err != nil { return err } - r[itr.b+i] = f + r.SetValue(itr.b+i, f) } } else { - r[itr.n-3] = uint64(0) + r.SetValue(itr.n-3, uint64(0)) } if c.oV != nil { - r[itr.n-2], err = tree.GetField(ctx, itr.oursVD, 0, c.oV, ns) + v, err = tree.GetField(ctx, itr.oursVD, 0, c.oV, ns) if err != nil { return err } + r.SetValue(itr.n-2, v) for i := 0; i < itr.oursVD.Count()-1; i++ { f, err := tree.GetField(ctx, itr.oursVD, i+1, c.oV, ns) if err != nil { return err } - r[itr.o+i] = f + r.SetValue(itr.o+i, f) } } else { - r[itr.n-2] = uint64(0) + r.SetValue(itr.n-2, uint64(0)) } - r[itr.o+itr.oursVD.Count()-1] = getDiffType(c.bV, c.oV) + r.SetValue(itr.o+itr.oursVD.Count()-1, getDiffType(c.bV, c.oV)) if c.tV != nil { - r[itr.n-1], err = tree.GetField(ctx, itr.theirsVD, 0, c.tV, ns) + v, err = tree.GetField(ctx, itr.theirsVD, 0, c.tV, ns) if err != nil { return err } + r.SetValue(itr.n-1, v) for i := 0; i < itr.theirsVD.Count()-1; i++ { f, err := tree.GetField(ctx, itr.theirsVD, i+1, c.tV, ns) if err != nil { return err } - r[itr.t+i] = f + r.SetValue(itr.t+i, f) } } else { - r[itr.n-1] = uint64(0) + r.SetValue(itr.n-1, uint64(0)) } o := itr.t + itr.theirsVD.Count() - 1 - r[o] = getDiffType(c.bV, c.tV) - r[itr.n-4] = c.id + r.SetValue(o, getDiffType(c.bV, c.tV)) + r.SetValue(itr.n-4, c.id) return nil } @@ -482,13 +486,13 @@ func (cu *prollyConflictOurTableUpdater) Update(ctx *sql.Context, oldRow sql.Row // Apply updates to columns prefixed with our_ // Updates to other columns are no-ops. - ourOldRow := make(sql.Row, len(cu.versionMappings.ourMapping)) - ourNewRow := make(sql.Row, len(cu.versionMappings.ourMapping)) + ourOldRow := make(sql.UntypedSqlRow, len(cu.versionMappings.ourMapping)) + ourNewRow := make(sql.UntypedSqlRow, len(cu.versionMappings.ourMapping)) for i, j := range cu.versionMappings.ourMapping { - ourOldRow[i] = oldRow[j] + ourOldRow[i] = oldRow.GetValue(j) } for i, j := range cu.versionMappings.ourMapping { - ourNewRow[i] = newRow[j] + ourNewRow[i] = newRow.GetValue(j) } return cu.srcUpdater.Update(ctx, ourOldRow, ourNewRow) @@ -566,7 +570,7 @@ func (cd *prollyConflictDeleter) Delete(ctx *sql.Context, r sql.Row) (err error) } // then the hash follows. It is the first column of the row and the second to last in the key - h := hash.Parse(r[0].(string)) + h := hash.Parse(r.GetValue(0).(string)) cd.kB.PutCommitAddr(cd.kd.Count()-2, h) // Finally the artifact type which is always a conflict @@ -584,11 +588,11 @@ func (cd *prollyConflictDeleter) Delete(ctx *sql.Context, r sql.Row) (err error) func (cd *prollyConflictDeleter) putPrimaryKeys(ctx *sql.Context, r sql.Row) error { // get keys from either base, ours, or theirs o := func() int { - if o := 1; r[o] != nil { + if o := 1; r.GetValue(o) != nil { return o - } else if o = 1 + cd.kd.Count() - 2 + cd.vd.Count(); r[o] != nil { + } else if o = 1 + cd.kd.Count() - 2 + cd.vd.Count(); r.GetValue(o) != nil { return o - } else if o = 1 + (cd.kd.Count()-2+cd.vd.Count())*2 + 1; r[o] != nil { + } else if o = 1 + (cd.kd.Count()-2+cd.vd.Count())*2 + 1; r.GetValue(o) != nil { return o } else { panic("neither base, ours, or theirs had a key") @@ -596,7 +600,7 @@ func (cd *prollyConflictDeleter) putPrimaryKeys(ctx *sql.Context, r sql.Row) err }() for i := 0; i < cd.kd.Count()-2; i++ { - err := tree.PutField(ctx, cd.ed.NodeStore(), cd.kB, i, r[o+i]) + err := tree.PutField(ctx, cd.ed.NodeStore(), cd.kB, i, r.GetValue(o+i)) if err != nil { return err @@ -608,17 +612,17 @@ func (cd *prollyConflictDeleter) putPrimaryKeys(ctx *sql.Context, r sql.Row) err func (cd *prollyConflictDeleter) putKeylessHash(ctx *sql.Context, r sql.Row) error { var rowVals sql.Row - if r[cd.ourDiffTypeIdx] == merge.ConflictDiffTypeAdded { + if r.GetValue(cd.ourDiffTypeIdx) == merge.ConflictDiffTypeAdded { // use our cols - rowVals = r[1+cd.baseColSize : 1+cd.baseColSize+cd.ourColSize] + rowVals = r.Subslice(1+cd.baseColSize, 1+cd.baseColSize+cd.ourColSize) } else { // use base cols - rowVals = r[1 : 1+cd.baseColSize] + rowVals = r.Subslice(1, 1+cd.baseColSize) } // init cardinality to 0 cd.vB.PutUint64(0, 0) - for i, v := range rowVals { + for i, v := range rowVals.Values() { err := tree.PutField(ctx, cd.ed.NodeStore(), cd.vB, i+1, v) if err != nil { return err diff --git a/go/libraries/doltcore/sqle/dtables/constraint_violations_prolly.go b/go/libraries/doltcore/sqle/dtables/constraint_violations_prolly.go index 8f70890b261..f7d8ed1c718 100644 --- a/go/libraries/doltcore/sqle/dtables/constraint_violations_prolly.go +++ b/go/libraries/doltcore/sqle/dtables/constraint_violations_prolly.go @@ -170,9 +170,9 @@ func (itr prollyCVIter) Next(ctx *sql.Context) (sql.Row, error) { additionalColumns++ } - r := make(sql.Row, itr.sch.GetAllCols().Size()+additionalColumns) - r[0] = art.SourceRootish.String() - r[1] = merge.MapCVType(art.ArtType) + r := make(sql.UntypedSqlRow, itr.sch.GetAllCols().Size()+additionalColumns) + r.SetValue(0, art.SourceRootish.String()) + r.SetValue(1, merge.MapCVType(art.ArtType)) var meta prolly.ConstraintViolationMeta err = json.Unmarshal(art.Metadata, &meta) @@ -180,37 +180,42 @@ func (itr prollyCVIter) Next(ctx *sql.Context) (sql.Row, error) { return nil, err } + var v interface{} o := 2 if !schema.IsKeyless(itr.sch) { for i := 0; i < itr.kd.Count(); i++ { - r[o+i], err = tree.GetField(ctx, itr.kd, i, art.SourceKey, itr.ns) + v, err = tree.GetField(ctx, itr.kd, i, art.SourceKey, itr.ns) if err != nil { return nil, err } + r.SetValue(o+i, v) } o += itr.kd.Count() for i := 0; i < itr.vd.Count(); i++ { - r[o+i], err = tree.GetField(ctx, itr.vd, i, meta.Value, itr.ns) + v, err = tree.GetField(ctx, itr.vd, i, meta.Value, itr.ns) if err != nil { return nil, err } + r.SetValue(o+i, v) } o += itr.vd.Count() } else { // For a keyless table, we still need a key to uniquely identify the row in the constraint // violation table, so we add in the unique hash for the row. - r[o], err = tree.GetField(ctx, itr.kd, 0, art.SourceKey, itr.ns) + v, err = tree.GetField(ctx, itr.kd, 0, art.SourceKey, itr.ns) if err != nil { return nil, err } + r.SetValue(o, v) o += 1 for i := 0; i < itr.vd.Count()-1; i++ { - r[o+i], err = tree.GetField(ctx, itr.vd, i+1, meta.Value, itr.ns) + v, err = tree.GetField(ctx, itr.vd, i+1, meta.Value, itr.ns) if err != nil { return nil, err } + r.SetValue(o+i, v) } o += itr.vd.Count() - 1 } @@ -222,28 +227,28 @@ func (itr prollyCVIter) Next(ctx *sql.Context) (sql.Row, error) { if err != nil { return nil, err } - r[o] = m + r.SetValue(o, m) case prolly.ArtifactTypeUniqueKeyViol: var m merge.UniqCVMeta err = json.Unmarshal(meta.VInfo, &m) if err != nil { return nil, err } - r[o] = m + r.SetValue(o, m) case prolly.ArtifactTypeNullViol: var m merge.NullViolationMeta err = json.Unmarshal(meta.VInfo, &m) if err != nil { return nil, err } - r[o] = m + r.SetValue(o, m) case prolly.ArtifactTypeChkConsViol: var m merge.CheckCVMeta err = json.Unmarshal(meta.VInfo, &m) if err != nil { return nil, err } - r[o] = m + r.SetValue(o, m) default: panic("json not implemented for artifact type") } @@ -267,18 +272,18 @@ func (d *prollyCVDeleter) Delete(ctx *sql.Context, r sql.Row) error { // The PK has 3+ fields: from_root_ish, violation_type, plus all PK fields from the source table. // If the source table is keyless and has no PK, then we use the unique row hash provided by keyless tables. for i := 0; i < d.kd.Count()-2; i++ { - err := tree.PutField(ctx, d.cvt.artM.NodeStore(), d.kb, i, r[i+2]) + err := tree.PutField(ctx, d.cvt.artM.NodeStore(), d.kb, i, r.GetValue(i+2)) if err != nil { return err } } // then the hash - h := hash.Parse(r[0].(string)) + h := hash.Parse(r.GetValue(0).(string)) d.kb.PutCommitAddr(d.kd.Count()-2, h) // Finally the artifact type - artType := merge.UnmapCVType(merge.CvType(r[1].(uint64))) + artType := merge.UnmapCVType(merge.CvType(r.GetValue(1).(uint64))) d.kb.PutUint8(d.kd.Count()-1, uint8(artType)) key := d.kb.Build(d.pool) diff --git a/go/libraries/doltcore/sqle/dtables/diff_iter.go b/go/libraries/doltcore/sqle/dtables/diff_iter.go index 464c7813751..677b8df9a4a 100644 --- a/go/libraries/doltcore/sqle/dtables/diff_iter.go +++ b/go/libraries/doltcore/sqle/dtables/diff_iter.go @@ -171,11 +171,11 @@ func (itr *ldDiffRowItr) Next(ctx *sql.Context) (sql.Row, error) { } if hasTo && hasFrom { - sqlRow = append(sqlRow, diffTypeModified) + sqlRow = sqlRow.Append(sql.NewUntypedRow(diffTypeModified)) } else if hasTo && !hasFrom { - sqlRow = append(sqlRow, diffTypeAdded) + sqlRow = sqlRow.Append(sql.NewUntypedRow(diffTypeAdded)) } else { - sqlRow = append(sqlRow, diffTypeRemoved) + sqlRow = sqlRow.Append(sql.NewUntypedRow(diffTypeRemoved)) } return sqlRow, nil @@ -411,7 +411,7 @@ func (itr prollyDiffIter) getDiffRowAndCardinality(ctx context.Context, d tree.D // getDiffTableRow returns a row for the diff table given the diff type and the row from the source and target tables. The // output schema is intended for dolt_diff_* tables and dolt_diff function. -func (itr prollyDiffIter) getDiffTableRow(ctx context.Context, dif tree.Diff) (row sql.Row, err error) { +func (itr prollyDiffIter) getDiffTableRow(ctx context.Context, dif tree.Diff) (sql.Row, error) { tLen := schemaSize(itr.targetToSch) fLen := schemaSize(itr.targetFromSch) @@ -421,10 +421,11 @@ func (itr prollyDiffIter) getDiffTableRow(ctx context.Context, dif tree.Diff) (r tLen = fLen } // 2 commit names, 2 commit dates, 1 diff_type - row = make(sql.Row, fLen+tLen+5) + row := make(sql.UntypedSqlRow, fLen+tLen+5) // todo (dhruv): implement warnings for row column value coercions. + var err error if dif.Type != tree.RemovedDiff { err = itr.toConverter.PutConverted(ctx, val.Tuple(dif.Key), val.Tuple(dif.To), row[0:tLen]) if err != nil { @@ -461,8 +462,7 @@ func (r *repeatingRowIter) Next(ctx context.Context) (sql.Row, error) { return nil, io.EOF } r.n-- - c := make(sql.Row, len(r.row)) - copy(c, r.row) + c := r.row.Copy() return c, nil } diff --git a/go/libraries/doltcore/sqle/dtables/prolly_row_conv.go b/go/libraries/doltcore/sqle/dtables/prolly_row_conv.go index d0f5714ccb2..950006d0c1d 100644 --- a/go/libraries/doltcore/sqle/dtables/prolly_row_conv.go +++ b/go/libraries/doltcore/sqle/dtables/prolly_row_conv.go @@ -102,7 +102,7 @@ func NewProllyRowConverter(inSch, outSch schema.Schema, warnFn rowconv.WarnFunct // PutConverted converts the |key| and |value| val.Tuple from |inSchema| to |outSchema| // and places the converted row in |dstRow|. -func (c ProllyRowConverter) PutConverted(ctx context.Context, key, value val.Tuple, dstRow []interface{}) error { +func (c ProllyRowConverter) PutConverted(ctx context.Context, key, value val.Tuple, dstRow sql.UntypedSqlRow) error { err := c.putFields(ctx, key, c.keyProj, c.keyDesc, c.pkTargetTypes, dstRow) if err != nil { return err @@ -111,7 +111,7 @@ func (c ProllyRowConverter) PutConverted(ctx context.Context, key, value val.Tup return c.putFields(ctx, value, c.valProj, c.valDesc, c.nonPkTargetTypes, dstRow) } -func (c ProllyRowConverter) putFields(ctx context.Context, tup val.Tuple, proj val.OrdinalMapping, desc val.TupleDesc, targetTypes []sql.Type, dstRow []interface{}) error { +func (c ProllyRowConverter) putFields(ctx context.Context, tup val.Tuple, proj val.OrdinalMapping, desc val.TupleDesc, targetTypes []sql.Type, dstRow sql.UntypedSqlRow) error { for i, j := range proj { if j == -1 { continue diff --git a/go/libraries/doltcore/sqle/dtables/query_catalog_table_test.go b/go/libraries/doltcore/sqle/dtables/query_catalog_table_test.go index 5e151406ba3..ff18305ee1a 100644 --- a/go/libraries/doltcore/sqle/dtables/query_catalog_table_test.go +++ b/go/libraries/doltcore/sqle/dtables/query_catalog_table_test.go @@ -60,7 +60,7 @@ func TestInsertIntoQueryCatalogTable(t *testing.T) { rows, err := sqle.ExecuteSelect(dEnv, root, "select display_order, query, name, description from "+doltdb.DoltQueryCatalogTableName) require.NoError(t, err) - expectedRows := []sql.Row{ + expectedRows := []sql.UntypedSqlRow{ {uint64(1), "select 1 from dual", "name", "description"}, } @@ -83,7 +83,7 @@ func TestInsertIntoQueryCatalogTable(t *testing.T) { rows, err = sqle.ExecuteSelect(dEnv, root, "select display_order, query, name, description from "+doltdb.DoltQueryCatalogTableName+" order by display_order") require.NoError(t, err) - expectedRows = []sql.Row{ + expectedRows = []sql.UntypedSqlRow{ {uint64(1), "select 1 from dual", "name", "description"}, {uint64(2), "select 2 from dual", "name2", "description2"}, } @@ -94,7 +94,7 @@ func TestInsertIntoQueryCatalogTable(t *testing.T) { require.NoError(t, err) for _, r := range rows { assert.NotEmpty(t, r) - assert.NotEmpty(t, r[0]) + assert.NotEmpty(t, r.GetValue(0)) } queryStr3 := "select 3 from dual" diff --git a/go/libraries/doltcore/sqle/dtables/table_of_tables_with_violations.go b/go/libraries/doltcore/sqle/dtables/table_of_tables_with_violations.go index f2d0948baa6..58fe286588f 100644 --- a/go/libraries/doltcore/sqle/dtables/table_of_tables_with_violations.go +++ b/go/libraries/doltcore/sqle/dtables/table_of_tables_with_violations.go @@ -93,7 +93,7 @@ func (totwv *TableOfTablesWithViolations) PartitionRows(ctx *sql.Context, part s if err != nil { return nil, err } - rows = append(rows, sql.Row{tblName.Name, n}) + rows = append(rows, sql.UntypedSqlRow{tblName.Name, n}) return sql.RowsToRowIter(rows...), nil } diff --git a/go/libraries/doltcore/sqle/dtables/unscoped_diff_table.go b/go/libraries/doltcore/sqle/dtables/unscoped_diff_table.go index 0e5999eb566..8c6ce1661ad 100644 --- a/go/libraries/doltcore/sqle/dtables/unscoped_diff_table.go +++ b/go/libraries/doltcore/sqle/dtables/unscoped_diff_table.go @@ -480,7 +480,7 @@ func commitFilterForDiffTableFilterExprs(filters []sql.Expression) (doltdb.Commi return false, err } for _, filter := range filters { - res, err := filter.Eval(sc, sql.Row{h.String(), meta.Name, meta.Time()}) + res, err := filter.Eval(sc, sql.UntypedSqlRow{h.String(), meta.Name, meta.Time()}) if err != nil { return false, err } diff --git a/go/libraries/doltcore/sqle/dtables/workspace_table.go b/go/libraries/doltcore/sqle/dtables/workspace_table.go index 875ba324b0b..fc19f376730 100644 --- a/go/libraries/doltcore/sqle/dtables/workspace_table.go +++ b/go/libraries/doltcore/sqle/dtables/workspace_table.go @@ -160,15 +160,15 @@ func (wtu *WorkspaceTableUpdater) Update(ctx *sql.Context, old sql.Row, new sql. // old and new are the same. Just use one. new = nil - toRow := old[3 : 3+schemaLen] - fromRow := old[3+schemaLen:] + toRow := old.Subslice(3, 3+schemaLen) + fromRow := old.Subslice(3+schemaLen, old.Len()) if !isStaged { toRow, fromRow = fromRow, toRow } // It's a delete if all the values in toRow are nil. isDelete := true - for _, val := range toRow { + for _, val := range toRow.Values() { if val != nil { isDelete = false break @@ -204,26 +204,26 @@ func (wtd *WorkspaceTableDeleter) StatementBegin(ctx *sql.Context) { } func (wtd *WorkspaceTableDeleter) Delete(c *sql.Context, row sql.Row) error { - isStaged := isTrue(row[stagedColumnIdx]) + isStaged := isTrue(row.GetValue(stagedColumnIdx)) if isStaged { return fmt.Errorf("cannot delete staged rows from workspace") } schemaLen := wtd.schemaLen - toRow := row[3 : 3+schemaLen] - fromRow := row[3+schemaLen:] + toRow := row.Subslice(3, 3+schemaLen) + fromRow := row.Subslice(3+schemaLen, row.Len()) // If to Row has any non-nil values, then we need to do an update. Otherwise, insert. wasDelete := true - for _, val := range toRow { + for _, val := range toRow.Values() { if val != nil { wasDelete = false break } } wasInsert := true - for _, val := range fromRow { + for _, val := range fromRow.Values() { if val != nil { wasInsert = false break @@ -288,21 +288,21 @@ func isTrue(value interface{}) bool { // column to TRUE or FALSE is the only update allowed, and any other update will result in 'valid' being false. If // valid is true, then 'staged' will be the value in the "staged" column of the new row. func validateWorkspaceUpdate(old, new sql.Row) (valid, staged bool) { - if len(old) != len(new) { + if old.Len() != new.Len() { return false, false } isStaged := false // Verify there are no changes in the columns other than the "staged" column. - for i := range new { + for i := 0; i < new.Len(); i++ { if i == stagedColumnIdx { - isStaged = isTrue(new[stagedColumnIdx]) + isStaged = isTrue(new.GetValue(stagedColumnIdx)) // skip the "staged" column. continue } - if old[i] != new[i] { + if old.GetValue(i) != new.GetValue(i) { return false, false } } @@ -631,7 +631,7 @@ func getWorkspaceTableRow( toConverter ProllyRowConverter, fromConverter ProllyRowConverter, dif tree.Diff, -) (row sql.Row, err error) { +) (sql.Row, error) { tLen := schemaSize(toSch) fLen := schemaSize(fromSch) @@ -641,8 +641,9 @@ func getWorkspaceTableRow( tLen = fLen } - row = make(sql.Row, 3+tLen+fLen) + row := make(sql.UntypedSqlRow, 3+tLen+fLen) + var err error row[0] = rowId row[1] = staged row[2] = diffTypeString(dif) diff --git a/go/libraries/doltcore/sqle/enginetest/blob_queries.go b/go/libraries/doltcore/sqle/enginetest/blob_queries.go index 7ef929a3ab0..d677aa83fc1 100644 --- a/go/libraries/doltcore/sqle/enginetest/blob_queries.go +++ b/go/libraries/doltcore/sqle/enginetest/blob_queries.go @@ -23,8 +23,8 @@ import ( var BigBlobQueries = []queries.WriteQueryTest{ { WriteQuery: "INSERT INTO blobt VALUES(4, LOAD_FILE('testdata/test1.png'))", - ExpectedWriteResult: []sql.Row{{types.NewOkResult(1)}}, + ExpectedWriteResult: []sql.UntypedSqlRow{{types.NewOkResult(1)}}, SelectQuery: "select sha1(b) from blobt where i = 4", - ExpectedSelect: []sql.Row{{"012bcb75a319f2913614a5170fc046fb6c49ee86"}}, + ExpectedSelect: []sql.UntypedSqlRow{{"012bcb75a319f2913614a5170fc046fb6c49ee86"}}, }, } diff --git a/go/libraries/doltcore/sqle/enginetest/branch_control_test.go b/go/libraries/doltcore/sqle/enginetest/branch_control_test.go index 14d3ca25a64..fba5a65c083 100644 --- a/go/libraries/doltcore/sqle/enginetest/branch_control_test.go +++ b/go/libraries/doltcore/sqle/enginetest/branch_control_test.go @@ -42,7 +42,7 @@ type BranchControlTestAssertion struct { User string Host string Query string - Expected []sql.Row + Expected []sql.UntypedSqlRow ExpectedErr *errors.Kind ExpectedErrStr string } @@ -612,13 +612,13 @@ var BranchControlTests = []BranchControlTest{ User: "testuser", Host: "localhost", Query: "CALL DOLT_BRANCH('otherbranch1');", - Expected: []sql.Row{{0}}, + Expected: []sql.UntypedSqlRow{{0}}, }, { // Prefix "other" is now locked by root User: "root", Host: "localhost", Query: "INSERT INTO dolt_branch_namespace_control VALUES ('%', 'other%', 'root', 'localhost');", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {types.NewOkResult(1)}, }, }, @@ -632,7 +632,7 @@ var BranchControlTests = []BranchControlTest{ User: "root", Host: "localhost", Query: "INSERT INTO dolt_branch_namespace_control VALUES ('%', 'other%', 'testuser', 'localhost');", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {types.NewOkResult(1)}, }, }, @@ -640,13 +640,13 @@ var BranchControlTests = []BranchControlTest{ User: "testuser", Host: "localhost", Query: "CALL DOLT_BRANCH('otherbranch2');", - Expected: []sql.Row{{0}}, + Expected: []sql.UntypedSqlRow{{0}}, }, { // Create a longer match, which takes precedence over shorter matches User: "root", Host: "localhost", Query: "INSERT INTO dolt_branch_namespace_control VALUES ('%', 'otherbranch%', 'root', 'localhost');", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {types.NewOkResult(1)}, }, }, @@ -660,13 +660,13 @@ var BranchControlTests = []BranchControlTest{ User: "testuser", Host: "localhost", Query: "CALL DOLT_BRANCH('other3');", - Expected: []sql.Row{{0}}, + Expected: []sql.UntypedSqlRow{{0}}, }, { User: "root", Host: "localhost", Query: "INSERT INTO dolt_branch_namespace_control VALUES ('%', 'otherbranch%', 'testuser', 'localhost');", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {types.NewOkResult(1)}, }, }, @@ -674,7 +674,7 @@ var BranchControlTests = []BranchControlTest{ User: "testuser", Host: "localhost", Query: "CALL DOLT_BRANCH('otherbranch3');", - Expected: []sql.Row{{0}}, + Expected: []sql.UntypedSqlRow{{0}}, }, }, }, @@ -714,7 +714,7 @@ var BranchControlTests = []BranchControlTest{ User: "a", Host: "localhost", Query: "INSERT INTO dolt_branch_control VALUES ('%', 'prefix1%', 'b', 'localhost', 'write');", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {types.NewOkResult(1)}, }, }, @@ -740,7 +740,7 @@ var BranchControlTests = []BranchControlTest{ User: "a", Host: "localhost", Query: "UPDATE dolt_branch_control SET permissions = 'admin' WHERE branch = 'prefix1%';", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {types.OkResult{RowsAffected: 1, Info: plan.UpdateInfo{Matched: 1, Updated: 1}}}, }, }, @@ -748,7 +748,7 @@ var BranchControlTests = []BranchControlTest{ User: "b", Host: "localhost", Query: "DELETE FROM dolt_branch_control WHERE branch = 'prefix1%';", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {types.NewOkResult(1)}, }, }, @@ -762,7 +762,7 @@ var BranchControlTests = []BranchControlTest{ User: "a", Host: "localhost", Query: "INSERT INTO dolt_branch_namespace_control VALUES ('%', 'prefix___', 'a', 'localhost');", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {types.NewOkResult(1)}, }, }, @@ -776,7 +776,7 @@ var BranchControlTests = []BranchControlTest{ User: "a", Host: "localhost", Query: "UPDATE dolt_branch_namespace_control SET branch = 'prefix%';", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {types.OkResult{RowsAffected: 1, Info: plan.UpdateInfo{Matched: 1, Updated: 1}}}, }, }, @@ -821,7 +821,7 @@ var BranchControlTests = []BranchControlTest{ User: "testuser", Host: "localhost", Query: "SELECT * FROM dolt_branch_control WHERE user = 'testuser';", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {"%", "%", "testuser", "localhost_1", "write"}, {"%", "%", "testuser", "localhost", "write"}, {"%", "%", "testuser", "localhost_4", "write"}, @@ -832,7 +832,7 @@ var BranchControlTests = []BranchControlTest{ User: "testuser", Host: "localhost", Query: "INSERT INTO test VALUES (1);", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {types.NewOkResult(1)}, }, }, @@ -840,7 +840,7 @@ var BranchControlTests = []BranchControlTest{ User: "root", Host: "localhost", Query: "DELETE FROM dolt_branch_control WHERE host = 'localhost_5';", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {types.NewOkResult(1)}, }, }, @@ -848,7 +848,7 @@ var BranchControlTests = []BranchControlTest{ User: "testuser", Host: "localhost", Query: "SELECT * FROM dolt_branch_control WHERE user = 'testuser';", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {"%", "%", "testuser", "localhost_1", "write"}, {"%", "%", "testuser", "localhost", "write"}, {"%", "%", "testuser", "localhost_4", "write"}, @@ -858,7 +858,7 @@ var BranchControlTests = []BranchControlTest{ User: "testuser", Host: "localhost", Query: "INSERT INTO test VALUES (2);", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {types.NewOkResult(1)}, }, }, @@ -866,7 +866,7 @@ var BranchControlTests = []BranchControlTest{ User: "root", Host: "localhost", Query: "DELETE FROM dolt_branch_control WHERE host = 'localhost_1';", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {types.NewOkResult(1)}, }, }, @@ -874,7 +874,7 @@ var BranchControlTests = []BranchControlTest{ User: "testuser", Host: "localhost", Query: "SELECT * FROM dolt_branch_control WHERE user = 'testuser';", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {"%", "%", "testuser", "localhost", "write"}, {"%", "%", "testuser", "localhost_4", "write"}, }, @@ -883,7 +883,7 @@ var BranchControlTests = []BranchControlTest{ User: "testuser", Host: "localhost", Query: "INSERT INTO test VALUES (3);", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {types.NewOkResult(1)}, }, }, @@ -891,7 +891,7 @@ var BranchControlTests = []BranchControlTest{ User: "root", Host: "localhost", Query: "DELETE FROM dolt_branch_control WHERE host = 'localhost_4';", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {types.NewOkResult(1)}, }, }, @@ -899,7 +899,7 @@ var BranchControlTests = []BranchControlTest{ User: "testuser", Host: "localhost", Query: "SELECT * FROM dolt_branch_control WHERE user = 'testuser';", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {"%", "%", "testuser", "localhost", "write"}, }, }, @@ -907,7 +907,7 @@ var BranchControlTests = []BranchControlTest{ User: "testuser", Host: "localhost", Query: "INSERT INTO test VALUES (4);", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {types.NewOkResult(1)}, }, }, @@ -915,7 +915,7 @@ var BranchControlTests = []BranchControlTest{ User: "root", Host: "localhost", Query: "DELETE FROM dolt_branch_control WHERE user = 'testuser' AND host = 'localhost';", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {types.NewOkResult(1)}, }, }, @@ -923,7 +923,7 @@ var BranchControlTests = []BranchControlTest{ User: "testuser", Host: "localhost", Query: "SELECT * FROM dolt_branch_control WHERE user = 'testuser';", - Expected: []sql.Row{}, + Expected: []sql.UntypedSqlRow{}, }, { User: "testuser", @@ -935,7 +935,7 @@ var BranchControlTests = []BranchControlTest{ User: "root", Host: "localhost", Query: "DELETE FROM dolt_branch_control;", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {types.NewOkResult(1)}, }, }, @@ -943,13 +943,13 @@ var BranchControlTests = []BranchControlTest{ User: "root", Host: "localhost", Query: "SELECT * FROM dolt_branch_control;", - Expected: []sql.Row{}, + Expected: []sql.UntypedSqlRow{}, }, { User: "root", Host: "localhost", Query: "INSERT INTO dolt_branch_control VALUES ('%', '%', 'root', '%', 'admin');", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {types.NewOkResult(1)}, }, }, @@ -957,7 +957,7 @@ var BranchControlTests = []BranchControlTest{ User: "root", Host: "localhost", Query: "SELECT * FROM dolt_branch_control;", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {"%", "%", "root", "%", "admin"}, }, }, @@ -992,7 +992,7 @@ var BranchControlTests = []BranchControlTest{ User: "root", Host: "localhost", Query: "INSERT INTO dolt_branch_control VALUES ('%', 'prefix2%', 'testuser', 'localhost', 'admin');", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {types.NewOkResult(1)}, }, }, @@ -1000,7 +1000,7 @@ var BranchControlTests = []BranchControlTest{ User: "testuser", Host: "localhost", Query: "SELECT * FROM dolt_branch_control WHERE user = 'testuser';", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {"%", "prefix", "testuser", "localhost", "admin"}, {"%", "prefix1%", "testuser", "localhost", "admin"}, {"%", "prefix2_", "testuser", "localhost", "admin"}, @@ -1030,7 +1030,7 @@ var BranchControlTests = []BranchControlTest{ User: "root", Host: "localhost", Query: "SELECT * FROM dolt_branch_control WHERE user = 'root';", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {"%", "%", "root", "localhost", "admin"}, }, }, @@ -1038,13 +1038,13 @@ var BranchControlTests = []BranchControlTest{ User: "root", Host: "localhost", Query: "CALL DOLT_BRANCH('new_root_branch');", - Expected: []sql.Row{{0}}, + Expected: []sql.UntypedSqlRow{{0}}, }, { User: "root", Host: "localhost", Query: "SELECT * FROM dolt_branch_control WHERE user = 'root';", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {"%", "%", "root", "localhost", "admin"}, }, }, @@ -1063,19 +1063,19 @@ var BranchControlTests = []BranchControlTest{ User: "testuser", Host: "localhost", Query: "SELECT * FROM dolt_branch_control WHERE user = 'testuser';", - Expected: []sql.Row{}, + Expected: []sql.UntypedSqlRow{}, }, { User: "testuser", Host: "localhost", Query: "CALL DOLT_BRANCH('otherbranch');", - Expected: []sql.Row{{0}}, + Expected: []sql.UntypedSqlRow{{0}}, }, { User: "testuser", Host: "localhost", Query: "SELECT * FROM dolt_branch_control WHERE user = 'testuser';", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {"mydb", "otherbranch", "testuser", "localhost", "admin"}, }, }, @@ -1096,7 +1096,7 @@ var BranchControlTests = []BranchControlTest{ User: "testuser", Host: "localhost", Query: "SELECT * FROM dolt_branch_control WHERE user = 'testuser';", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {"%", "otherbranch", "testuser", "localhost", "write"}, }, }, @@ -1110,13 +1110,13 @@ var BranchControlTests = []BranchControlTest{ User: "testuser", Host: "localhost", Query: "CALL DOLT_BRANCH('-m', 'otherbranch', 'newbranch');", - Expected: []sql.Row{{0}}, + Expected: []sql.UntypedSqlRow{{0}}, }, { User: "testuser", Host: "localhost", Query: "SELECT * FROM dolt_branch_control WHERE user = 'testuser';", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {"%", "otherbranch", "testuser", "localhost", "write"}, // Original entry remains {"mydb", "newbranch", "testuser", "localhost", "admin"}, // New entry is scoped specifically to db }, @@ -1137,7 +1137,7 @@ var BranchControlTests = []BranchControlTest{ User: "testuser", Host: "localhost", Query: "SELECT * FROM dolt_branch_control WHERE user = 'testuser';", - Expected: []sql.Row{}, + Expected: []sql.UntypedSqlRow{}, }, { User: "testuser", @@ -1149,13 +1149,13 @@ var BranchControlTests = []BranchControlTest{ User: "testuser", Host: "localhost", Query: "CALL DOLT_BRANCH('-c', 'otherbranch', 'newbranch');", - Expected: []sql.Row{{0}}, + Expected: []sql.UntypedSqlRow{{0}}, }, { User: "testuser", Host: "localhost", Query: "SELECT * FROM dolt_branch_control WHERE user = 'testuser';", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {"mydb", "newbranch", "testuser", "localhost", "admin"}, }, }, @@ -1181,13 +1181,13 @@ var BranchControlTests = []BranchControlTest{ User: "testuser", Host: "localhost", Query: "USE dba;", - Expected: []sql.Row{}, + Expected: []sql.UntypedSqlRow{}, }, { // On "dba"."main", which we have permissions for User: "testuser", Host: "localhost", Query: "CREATE TABLE test (pk BIGINT PRIMARY KEY);", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {types.NewOkResult(0)}, }, }, @@ -1195,7 +1195,7 @@ var BranchControlTests = []BranchControlTest{ User: "testuser", Host: "localhost", Query: "DROP TABLE test;", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {types.NewOkResult(0)}, }, }, @@ -1203,7 +1203,7 @@ var BranchControlTests = []BranchControlTest{ User: "testuser", Host: "localhost", Query: "CALL DOLT_CHECKOUT('other');", - Expected: []sql.Row{{0, "Switched to branch 'other'"}}, + Expected: []sql.UntypedSqlRow{{0, "Switched to branch 'other'"}}, }, { // On "dba"."other", which we do not have permissions for User: "testuser", @@ -1215,7 +1215,7 @@ var BranchControlTests = []BranchControlTest{ User: "testuser", Host: "localhost", Query: "USE dbb;", - Expected: []sql.Row{}, + Expected: []sql.UntypedSqlRow{}, }, { // On "dbb"."main", which we do not have permissions for User: "testuser", @@ -1227,13 +1227,13 @@ var BranchControlTests = []BranchControlTest{ User: "testuser", Host: "localhost", Query: "CALL DOLT_CHECKOUT('other');", - Expected: []sql.Row{{0, "Switched to branch 'other'"}}, + Expected: []sql.UntypedSqlRow{{0, "Switched to branch 'other'"}}, }, { // On "dbb"."other", which we do not have permissions for User: "testuser", Host: "localhost", Query: "CREATE TABLE test (pk BIGINT PRIMARY KEY);", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {types.NewOkResult(0)}, }, }, @@ -1264,13 +1264,13 @@ var BranchControlTests = []BranchControlTest{ User: "testuser", Host: "localhost", Query: "CALL DOLT_BRANCH('newbranch');", - Expected: []sql.Row{{0}}, + Expected: []sql.UntypedSqlRow{{0}}, }, { User: "testuser", Host: "localhost", Query: "SELECT * FROM dolt_branch_control WHERE user = 'testuser';", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {"mydb", "newbranch", "testuser", "localhost", "admin"}, }, }, @@ -1296,7 +1296,7 @@ var BranchControlTests = []BranchControlTest{ User: "a", Host: "localhost", Query: "INSERT INTO dolt_branch_control VALUES ('dba', 'dummy1', '%', '%', 'write');", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {types.NewOkResult(1)}, }, }, @@ -1328,7 +1328,7 @@ var BranchControlTests = []BranchControlTest{ User: "b", Host: "localhost", Query: "INSERT INTO dolt_branch_control VALUES ('dbb', 'dummy6', '%', '%', 'write');", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {types.NewOkResult(1)}, }, }, @@ -1336,7 +1336,7 @@ var BranchControlTests = []BranchControlTest{ User: "root", Host: "localhost", Query: "GRANT SUPER ON *.* TO a@localhost WITH GRANT OPTION;", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {types.NewOkResult(0)}, }, }, @@ -1344,7 +1344,7 @@ var BranchControlTests = []BranchControlTest{ User: "a", Host: "localhost", Query: "INSERT INTO dolt_branch_control VALUES ('db_', 'dummy7', '%', '%', 'write');", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {types.NewOkResult(1)}, }, }, @@ -1352,7 +1352,7 @@ var BranchControlTests = []BranchControlTest{ User: "root", Host: "localhost", Query: "SELECT * FROM dolt_branch_control;", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {"%", "%", "root", "localhost", "admin"}, {"dba", "dummy1", "%", "%", "write"}, {"dbb", "dummy6", "%", "%", "write"}, @@ -1449,7 +1449,7 @@ func TestBranchControlBlocks(t *testing.T) { enginetest.AssertErrWithCtx(t, engine, harness, userCtx, test.Query, nil, test.ExpectedErr) addUserQuery := "INSERT INTO dolt_branch_control VALUES ('%', 'main', 'testuser', 'localhost', 'write'), ('%', 'other', 'testuser', 'localhost', 'write');" - addUserQueryResults := []sql.Row{{types.NewOkResult(2)}} + addUserQueryResults := []sql.UntypedSqlRow{{types.NewOkResult(2)}} enginetest.TestQueryWithContext(t, rootCtx, engine, harness, addUserQuery, addUserQueryResults, nil, nil, nil) _, iter, _, err := engine.Query(userCtx, test.Query) @@ -1487,7 +1487,7 @@ func TestBranchControlBlocks(t *testing.T) { } addUserQuery := "INSERT INTO dolt_branch_control VALUES ('%', 'main', 'testuser', 'localhost', 'write');" - addUserQueryResults := []sql.Row{{types.NewOkResult(1)}} + addUserQueryResults := []sql.UntypedSqlRow{{types.NewOkResult(1)}} enginetest.TestQueryWithContext(t, rootCtx, engine, harness, addUserQuery, addUserQueryResults, nil, nil, nil) userCtx := enginetest.NewContextWithClient(harness, sql.Client{ @@ -1497,7 +1497,7 @@ func TestBranchControlBlocks(t *testing.T) { enginetest.AssertErrWithCtx(t, engine, harness, userCtx, test.Query, nil, test.ExpectedErr) addUserQuery = "INSERT INTO dolt_branch_control VALUES ('%', 'other', 'testuser', 'localhost', 'write');" - addUserQueryResults = []sql.Row{{types.NewOkResult(1)}} + addUserQueryResults = []sql.UntypedSqlRow{{types.NewOkResult(1)}} enginetest.TestQueryWithContext(t, rootCtx, engine, harness, addUserQuery, addUserQueryResults, nil, nil, nil) _, iter, _, err := engine.Query(userCtx, test.Query) diff --git a/go/libraries/doltcore/sqle/enginetest/ddl_queries.go b/go/libraries/doltcore/sqle/enginetest/ddl_queries.go index 65b7800201e..330d6afb13d 100755 --- a/go/libraries/doltcore/sqle/enginetest/ddl_queries.go +++ b/go/libraries/doltcore/sqle/enginetest/ddl_queries.go @@ -71,7 +71,7 @@ var SimpsonsSetup = []string{ `, } -var AllInitialSimpsonsCharacters = []sql.Row{ +var AllInitialSimpsonsCharacters = []sql.UntypedSqlRow{ {0, "Homer", "Simpson", 1, 40, 8.5, nil, nil}, {1, "Marge", "Simpson", 1, 38, 8.0, "00000000-0000-0000-0000-000000000001", uint(111)}, {2, "Bart", "Simpson", 0, 10, 9.0, "00000000-0000-0000-0000-000000000002", uint(222)}, @@ -91,7 +91,7 @@ var ModifyAndChangeColumnScripts = []queries.ScriptTest{ }, { Query: "show create table people", - Expected: []sql.Row{sql.Row{"people", "CREATE TABLE `people` (\n" + + Expected: []sql.UntypedSqlRow{sql.UntypedSqlRow{"people", "CREATE TABLE `people` (\n" + " `id` int NOT NULL,\n" + " `last_name` varchar(100) NOT NULL,\n" + " `first_name` varchar(163) NOT NULL,\n" + @@ -105,7 +105,7 @@ var ModifyAndChangeColumnScripts = []queries.ScriptTest{ }, { Query: "select * from people order by 1", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {0, "Simpson", "Homer", 1, 40, 8.5, nil, nil}, {1, "Simpson", "Marge", 1, 38, 8.0, "00000000-0000-0000-0000-000000000001", uint(111)}, {2, "Simpson", "Bart", 0, 10, 9.0, "00000000-0000-0000-0000-000000000002", uint(222)}, @@ -126,7 +126,7 @@ var ModifyAndChangeColumnScripts = []queries.ScriptTest{ }, { Query: "show create table people", - Expected: []sql.Row{sql.Row{"people", "CREATE TABLE `people` (\n" + + Expected: []sql.UntypedSqlRow{sql.UntypedSqlRow{"people", "CREATE TABLE `people` (\n" + " `first_name` varchar(163) NOT NULL,\n" + " `id` int NOT NULL,\n" + " `last_name` varchar(100) NOT NULL,\n" + @@ -140,7 +140,7 @@ var ModifyAndChangeColumnScripts = []queries.ScriptTest{ }, { Query: "select * from people order by id", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {"Homer", 0, "Simpson", 1, 40, 8.5, nil, nil}, {"Marge", 1, "Simpson", 1, 38, 8.0, "00000000-0000-0000-0000-000000000001", uint(111)}, {"Bart", 2, "Simpson", 0, 10, 9.0, "00000000-0000-0000-0000-000000000002", uint(222)}, @@ -161,7 +161,7 @@ var ModifyAndChangeColumnScripts = []queries.ScriptTest{ }, { Query: "show create table people", - Expected: []sql.Row{sql.Row{"people", "CREATE TABLE `people` (\n" + + Expected: []sql.UntypedSqlRow{sql.UntypedSqlRow{"people", "CREATE TABLE `people` (\n" + " `id` int NOT NULL,\n" + " `first_name` varchar(163),\n" + " `last_name` varchar(100) NOT NULL,\n" + @@ -189,7 +189,7 @@ var ModifyAndChangeColumnScripts = []queries.ScriptTest{ }, { Query: "show create table people", - Expected: []sql.Row{sql.Row{"people", "CREATE TABLE `people` (\n" + + Expected: []sql.UntypedSqlRow{sql.UntypedSqlRow{"people", "CREATE TABLE `people` (\n" + " `id` int NOT NULL,\n" + " `last_name` varchar(100) NOT NULL,\n" + " `christian_name` varchar(163) NOT NULL,\n" + @@ -203,7 +203,7 @@ var ModifyAndChangeColumnScripts = []queries.ScriptTest{ }, { Query: "select * from people order by id", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {0, "Simpson", "Homer", 1, 40, 8.5, nil, nil}, {1, "Simpson", "Marge", 1, 38, 8.0, "00000000-0000-0000-0000-000000000001", uint(111)}, {2, "Simpson", "Bart", 0, 10, 9.0, "00000000-0000-0000-0000-000000000002", uint(222)}, @@ -224,7 +224,7 @@ var ModifyAndChangeColumnScripts = []queries.ScriptTest{ }, { Query: "show create table people", - Expected: []sql.Row{sql.Row{"people", "CREATE TABLE `people` (\n" + + Expected: []sql.UntypedSqlRow{sql.UntypedSqlRow{"people", "CREATE TABLE `people` (\n" + " `christian_name` varchar(163) NOT NULL,\n" + " `id` int NOT NULL,\n" + " `last_name` varchar(100) NOT NULL,\n" + @@ -238,7 +238,7 @@ var ModifyAndChangeColumnScripts = []queries.ScriptTest{ }, { Query: "select * from people order by id", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {"Homer", 0, "Simpson", 1, 40, 8.5, nil, nil}, {"Marge", 1, "Simpson", 1, 38, 8.0, "00000000-0000-0000-0000-000000000001", uint(111)}, {"Bart", 2, "Simpson", 0, 10, 9.0, "00000000-0000-0000-0000-000000000002", uint(222)}, @@ -259,7 +259,7 @@ var ModifyAndChangeColumnScripts = []queries.ScriptTest{ }, { Query: "show create table people", - Expected: []sql.Row{sql.Row{"people", "CREATE TABLE `people` (\n" + + Expected: []sql.UntypedSqlRow{sql.UntypedSqlRow{"people", "CREATE TABLE `people` (\n" + " `id` int NOT NULL,\n" + " `first_name` varchar(163),\n" + " `last_name` varchar(100) NOT NULL,\n" + @@ -306,7 +306,7 @@ var ModifyAndChangeColumnScripts = []queries.ScriptTest{ Assertions: []queries.ScriptTestAssertion{ { Query: "show create table t", - Expected: []sql.Row{{"t", "CREATE TABLE `t` (\n `pk1` varchar(100) NOT NULL,\n `pkTwo` varchar(20) NOT NULL,\n PRIMARY KEY (`pk1`,`pkTwo`)\n) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_bin"}}, + Expected: []sql.UntypedSqlRow{{"t", "CREATE TABLE `t` (\n `pk1` varchar(100) NOT NULL,\n `pkTwo` varchar(20) NOT NULL,\n PRIMARY KEY (`pk1`,`pkTwo`)\n) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_bin"}}, }, }, }, @@ -326,7 +326,7 @@ var ModifyColumnTypeScripts = []queries.ScriptTest{ }, { Query: "show create table test", - Expected: []sql.Row{{"test", "CREATE TABLE `test` (\n" + + Expected: []sql.UntypedSqlRow{{"test", "CREATE TABLE `test` (\n" + " `pk` bigint NOT NULL,\n" + " `v1` int,\n" + " PRIMARY KEY (`pk`),\n" + @@ -335,11 +335,11 @@ var ModifyColumnTypeScripts = []queries.ScriptTest{ }, { Query: "select * from test order by pk", - Expected: []sql.Row{{0, 3}, {1, 2}}, + Expected: []sql.UntypedSqlRow{{0, 3}, {1, 2}}, }, { Query: "select * from test where v1 = 3", - Expected: []sql.Row{{0, 3}}, + Expected: []sql.UntypedSqlRow{{0, 3}}, }, }, }, @@ -356,7 +356,7 @@ var ModifyColumnTypeScripts = []queries.ScriptTest{ }, { Query: "show create table test", - Expected: []sql.Row{{"test", "CREATE TABLE `test` (\n" + + Expected: []sql.UntypedSqlRow{{"test", "CREATE TABLE `test` (\n" + " `pk` bigint NOT NULL,\n" + " `v1` varchar(20),\n" + " PRIMARY KEY (`pk`),\n" + @@ -365,11 +365,11 @@ var ModifyColumnTypeScripts = []queries.ScriptTest{ }, { Query: "select * from test order by pk", - Expected: []sql.Row{{0, "3"}, {1, "2"}}, + Expected: []sql.UntypedSqlRow{{0, "3"}, {1, "2"}}, }, { Query: "select * from test where v1 = '3'", - Expected: []sql.Row{{0, "3"}}, + Expected: []sql.UntypedSqlRow{{0, "3"}}, }, }, }, @@ -386,7 +386,7 @@ var ModifyColumnTypeScripts = []queries.ScriptTest{ }, { Query: "show create table test", - Expected: []sql.Row{{"test", "CREATE TABLE `test` (\n" + + Expected: []sql.UntypedSqlRow{{"test", "CREATE TABLE `test` (\n" + " `pk` bigint NOT NULL,\n" + " `v1` bigint,\n" + " PRIMARY KEY (`pk`),\n" + @@ -395,11 +395,11 @@ var ModifyColumnTypeScripts = []queries.ScriptTest{ }, { Query: "select * from test order by pk", - Expected: []sql.Row{{0, 3}, {1, 2}}, + Expected: []sql.UntypedSqlRow{{0, 3}, {1, 2}}, }, { Query: "select * from test where v1 = 3", - Expected: []sql.Row{{0, 3}}, + Expected: []sql.UntypedSqlRow{{0, 3}}, }, }, }, @@ -416,7 +416,7 @@ var ModifyColumnTypeScripts = []queries.ScriptTest{ }, { Query: "show create table test", - Expected: []sql.Row{{"test", "CREATE TABLE `test` (\n" + + Expected: []sql.UntypedSqlRow{{"test", "CREATE TABLE `test` (\n" + " `pk` varchar(20) NOT NULL,\n" + " `v1` bigint,\n" + " PRIMARY KEY (`pk`),\n" + @@ -425,11 +425,11 @@ var ModifyColumnTypeScripts = []queries.ScriptTest{ }, { Query: "select * from test order by pk", - Expected: []sql.Row{{"0", 3}, {"1", 2}}, + Expected: []sql.UntypedSqlRow{{"0", 3}, {"1", 2}}, }, { Query: "select * from test where v1 = 3", - Expected: []sql.Row{{"0", 3}}, + Expected: []sql.UntypedSqlRow{{"0", 3}}, }, }, }, @@ -445,7 +445,7 @@ var ModifyColumnTypeScripts = []queries.ScriptTest{ }, { Query: "show create table test", - Expected: []sql.Row{{"test", "CREATE TABLE `test` (\n" + + Expected: []sql.UntypedSqlRow{{"test", "CREATE TABLE `test` (\n" + " `pk` datetime(6) NOT NULL,\n" + " `v1` bit(20),\n" + " PRIMARY KEY (`pk`),\n" + @@ -454,7 +454,7 @@ var ModifyColumnTypeScripts = []queries.ScriptTest{ }, { Query: "select * from test order by pk", - Expected: []sql.Row{}, + Expected: []sql.UntypedSqlRow{}, }, }, }, @@ -535,7 +535,7 @@ var DropColumnScripts = []queries.ScriptTest{ }, { Query: "show create table people", - Expected: []sql.Row{{"people", "CREATE TABLE `people` (\n" + + Expected: []sql.UntypedSqlRow{{"people", "CREATE TABLE `people` (\n" + " `id` int NOT NULL,\n" + " `first_name` varchar(100) NOT NULL,\n" + " `last_name` varchar(100) NOT NULL,\n" + @@ -548,7 +548,7 @@ var DropColumnScripts = []queries.ScriptTest{ }, { Query: "select * from people order by 1", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {0, "Homer", "Simpson", 1, 40, nil, nil}, {1, "Marge", "Simpson", 1, 38, "00000000-0000-0000-0000-000000000001", uint(111)}, {2, "Bart", "Simpson", 0, 10, "00000000-0000-0000-0000-000000000002", uint(222)}, @@ -569,7 +569,7 @@ var DropColumnScripts = []queries.ScriptTest{ }, { Query: "show create table people", - Expected: []sql.Row{{"people", "CREATE TABLE `people` (\n" + + Expected: []sql.UntypedSqlRow{{"people", "CREATE TABLE `people` (\n" + " `id` int NOT NULL,\n" + " `first_name` varchar(100) NOT NULL,\n" + " `last_name` varchar(100) NOT NULL,\n" + @@ -582,7 +582,7 @@ var DropColumnScripts = []queries.ScriptTest{ }, { Query: "select * from people order by 1", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {0, "Homer", "Simpson", 1, 40, nil, nil}, {1, "Marge", "Simpson", 1, 38, "00000000-0000-0000-0000-000000000001", uint(111)}, {2, "Bart", "Simpson", 0, 10, "00000000-0000-0000-0000-000000000002", uint(222)}, @@ -603,7 +603,7 @@ var DropColumnScripts = []queries.ScriptTest{ }, { Query: "show create table people", - Expected: []sql.Row{{"people", "CREATE TABLE `people` (\n" + + Expected: []sql.UntypedSqlRow{{"people", "CREATE TABLE `people` (\n" + " `first_name` varchar(100) NOT NULL,\n" + " `last_name` varchar(100) NOT NULL,\n" + " `is_married` tinyint,\n" + @@ -615,7 +615,7 @@ var DropColumnScripts = []queries.ScriptTest{ }, { Query: "select * from people order by first_name", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {"Barney", "Gumble", 0, 40, 4.0, "00000000-0000-0000-0000-000000000005", uint(555)}, {"Bart", "Simpson", 0, 10, 9.0, "00000000-0000-0000-0000-000000000002", uint(222)}, {"Homer", "Simpson", 1, 40, 8.5, nil, nil}, @@ -642,7 +642,7 @@ var BrokenDDLScripts = []queries.ScriptTest{ }, { Query: "show create table test", - Expected: []sql.Row{{"test", "CREATE TABLE `test` (\n" + + Expected: []sql.UntypedSqlRow{{"test", "CREATE TABLE `test` (\n" + " `p2` int,\n" + " `c1` int,\n" + " `c2` int,\n" + @@ -651,11 +651,11 @@ var BrokenDDLScripts = []queries.ScriptTest{ }, { Query: "select * from test order by pk", - Expected: []sql.Row{{0, 3}, {1, 2}}, + Expected: []sql.UntypedSqlRow{{0, 3}, {1, 2}}, }, { Query: "select * from test where v1 = 3", - Expected: []sql.Row{{0, 3}}, + Expected: []sql.UntypedSqlRow{{0, 3}}, }, }, }, @@ -700,7 +700,7 @@ var BrokenDDLScripts = []queries.ScriptTest{ Assertions: []queries.ScriptTestAssertion{ { Query: "SELECT to_pk, to_commit, from_pk, from_commit, diff_type from dolt_diff(@Commit1, @Commit2, 't');", - Expected: []sql.Row{{1, "hi", nil, nil, "added"}}, + Expected: []sql.UntypedSqlRow{{1, "hi", nil, nil, "added"}}, }, }, }, @@ -747,7 +747,7 @@ var AddDropPrimaryKeysScripts = []queries.ScriptTest{ Assertions: []queries.ScriptTestAssertion{ { Query: "alter table parent drop primary key", - Expected: []sql.Row{{types.OkResult{RowsAffected: 0x0, InsertID: 0x0}}}, + Expected: []sql.UntypedSqlRow{{types.OkResult{RowsAffected: 0x0, InsertID: 0x0}}}, }, }, }, @@ -762,7 +762,7 @@ var AddDropPrimaryKeysScripts = []queries.ScriptTest{ Assertions: []queries.ScriptTestAssertion{ { Query: "alter table unrelated drop primary key", - Expected: []sql.Row{{types.OkResult{RowsAffected: 0x0, InsertID: 0x0}}}, + Expected: []sql.UntypedSqlRow{{types.OkResult{RowsAffected: 0x0, InsertID: 0x0}}}, }, }, }, diff --git a/go/libraries/doltcore/sqle/enginetest/dolt_branch_queries.go b/go/libraries/doltcore/sqle/enginetest/dolt_branch_queries.go index 9c613931571..33be7dd42c7 100755 --- a/go/libraries/doltcore/sqle/enginetest/dolt_branch_queries.go +++ b/go/libraries/doltcore/sqle/enginetest/dolt_branch_queries.go @@ -43,7 +43,7 @@ var ForeignKeyBranchTests = []queries.ScriptTest{ }, { Query: "SHOW CREATE TABLE child;", - Expected: []sql.Row{{"child", "CREATE TABLE `child` (\n" + + Expected: []sql.UntypedSqlRow{{"child", "CREATE TABLE `child` (\n" + " `id` int NOT NULL,\n" + " `v1` int,\n" + " `v2` int,\n" + @@ -62,7 +62,7 @@ var ForeignKeyBranchTests = []queries.ScriptTest{ }, { Query: "SHOW CREATE TABLE child;", - Expected: []sql.Row{{"child", "CREATE TABLE `child` (\n" + + Expected: []sql.UntypedSqlRow{{"child", "CREATE TABLE `child` (\n" + " `id` int NOT NULL,\n" + " `v1` int,\n" + " `v2` int,\n" + @@ -71,7 +71,7 @@ var ForeignKeyBranchTests = []queries.ScriptTest{ }, { Query: "insert into child values (1, 1, 1)", - Expected: []sql.Row{{types.OkResult{RowsAffected: 1}}}, + Expected: []sql.UntypedSqlRow{{types.OkResult{RowsAffected: 1}}}, }, { Query: "insert into `mydb/b1`.child values (1, 1, 1)", @@ -93,7 +93,7 @@ var ForeignKeyBranchTests = []queries.ScriptTest{ }, { Query: "SHOW CREATE TABLE child;", - Expected: []sql.Row{{"child", "CREATE TABLE `child` (\n" + + Expected: []sql.UntypedSqlRow{{"child", "CREATE TABLE `child` (\n" + " `id` int NOT NULL,\n" + " `v1` int,\n" + " `v2` int,\n" + @@ -112,7 +112,7 @@ var ForeignKeyBranchTests = []queries.ScriptTest{ }, { Query: "SHOW CREATE TABLE child;", - Expected: []sql.Row{{"child", "CREATE TABLE `child` (\n" + + Expected: []sql.UntypedSqlRow{{"child", "CREATE TABLE `child` (\n" + " `id` int NOT NULL,\n" + " `v1` int,\n" + " `v2` int,\n" + @@ -121,7 +121,7 @@ var ForeignKeyBranchTests = []queries.ScriptTest{ }, { Query: "insert into child values (1, 1, 1)", - Expected: []sql.Row{{types.OkResult{RowsAffected: 1}}}, + Expected: []sql.UntypedSqlRow{{types.OkResult{RowsAffected: 1}}}, }, }, }, @@ -138,7 +138,7 @@ var ForeignKeyBranchTests = []queries.ScriptTest{ { Query: "SHOW CREATE TABLE `mydb/b1`.child;", Skip: true, - Expected: []sql.Row{{"child", "CREATE TABLE `child` (\n" + + Expected: []sql.UntypedSqlRow{{"child", "CREATE TABLE `child` (\n" + " `id` int NOT NULL,\n" + " `v1` int,\n" + " `v2` int,\n" + @@ -155,7 +155,7 @@ var ForeignKeyBranchTests = []queries.ScriptTest{ { Query: "SHOW CREATE TABLE child;", Skip: true, - Expected: []sql.Row{{"child", "CREATE TABLE `child` (\n" + + Expected: []sql.UntypedSqlRow{{"child", "CREATE TABLE `child` (\n" + " `id` int NOT NULL,\n" + " `v1` int,\n" + " `v2` int,\n" + @@ -165,7 +165,7 @@ var ForeignKeyBranchTests = []queries.ScriptTest{ { Query: "insert into child values (1, 1, 1)", Skip: true, - Expected: []sql.Row{{types.OkResult{RowsAffected: 1}}}, + Expected: []sql.UntypedSqlRow{{types.OkResult{RowsAffected: 1}}}, }, }, }, @@ -189,7 +189,7 @@ var ViewBranchTests = []queries.ScriptTest{ }, { Query: "select * from v1", - Expected: []sql.Row{{3, 3}}, + Expected: []sql.UntypedSqlRow{{3, 3}}, }, { Query: "use mydb/main", @@ -201,7 +201,7 @@ var ViewBranchTests = []queries.ScriptTest{ }, { Query: "select * from `mydb/b1`.v1", - Expected: []sql.Row{{3, 3}}, + Expected: []sql.UntypedSqlRow{{3, 3}}, }, }, }, @@ -221,7 +221,7 @@ var ViewBranchTests = []queries.ScriptTest{ }, { Query: "select * from v1", - Expected: []sql.Row{{3, 3}}, + Expected: []sql.UntypedSqlRow{{3, 3}}, Skip: true, // https://github.com/dolthub/dolt/issues/6078 }, { @@ -235,7 +235,7 @@ var ViewBranchTests = []queries.ScriptTest{ }, { Query: "select * from `mydb/b1`.v1", - Expected: []sql.Row{{3, 3}}, + Expected: []sql.UntypedSqlRow{{3, 3}}, Skip: true, // https://github.com/dolthub/dolt/issues/6078 }, }, @@ -261,7 +261,7 @@ var DdlBranchTests = []queries.ScriptTest{ }, { Query: "select * from t2", - Expected: []sql.Row{{4, 4}}, + Expected: []sql.UntypedSqlRow{{4, 4}}, }, { Query: "use mydb/main", @@ -273,7 +273,7 @@ var DdlBranchTests = []queries.ScriptTest{ }, { Query: "select * from `mydb/b1`.t2", - Expected: []sql.Row{{4, 4}}, + Expected: []sql.UntypedSqlRow{{4, 4}}, }, }, }, @@ -294,7 +294,7 @@ var DdlBranchTests = []queries.ScriptTest{ }, { Query: "select * from t2", - Expected: []sql.Row{{4, 4}}, + Expected: []sql.UntypedSqlRow{{4, 4}}, }, { Query: "use mydb/main", @@ -306,7 +306,7 @@ var DdlBranchTests = []queries.ScriptTest{ }, { Query: "select * from `mydb/b1`.t2", - Expected: []sql.Row{{4, 4}}, + Expected: []sql.UntypedSqlRow{{4, 4}}, }, }, }, @@ -329,7 +329,7 @@ var DdlBranchTests = []queries.ScriptTest{ }, { Query: "select * from t2", - Expected: []sql.Row{{4, 4}}, + Expected: []sql.UntypedSqlRow{{4, 4}}, }, { Query: "use mydb/main", @@ -341,7 +341,7 @@ var DdlBranchTests = []queries.ScriptTest{ }, { Query: "select * from `mydb/b1`.t2", - Expected: []sql.Row{{4, 4}}, + Expected: []sql.UntypedSqlRow{{4, 4}}, }, }, }, @@ -356,15 +356,15 @@ var DdlBranchTests = []queries.ScriptTest{ Assertions: []queries.ScriptTestAssertion{ { Query: "alter table `mydb/b1`.t1 add column c int", - Expected: []sql.Row{{types.OkResult{RowsAffected: 0}}}, + Expected: []sql.UntypedSqlRow{{types.OkResult{RowsAffected: 0}}}, }, { Query: "select * from `mydb/b1`.t1", - Expected: []sql.Row{{1, 1, nil}, {2, 2, nil}, {3, 3, nil}}, + Expected: []sql.UntypedSqlRow{{1, 1, nil}, {2, 2, nil}, {3, 3, nil}}, }, { Query: "select * from t1", - Expected: []sql.Row{{1, 1}, {2, 2}, {3, 3}}, + Expected: []sql.UntypedSqlRow{{1, 1}, {2, 2}, {3, 3}}, }, }, }, @@ -379,15 +379,15 @@ var DdlBranchTests = []queries.ScriptTest{ Assertions: []queries.ScriptTestAssertion{ { Query: "alter table `mydb/b1`.t1 drop column b", - Expected: []sql.Row{{types.OkResult{RowsAffected: 0}}}, + Expected: []sql.UntypedSqlRow{{types.OkResult{RowsAffected: 0}}}, }, { Query: "select * from `mydb/b1`.t1", - Expected: []sql.Row{{1}, {2}, {3}}, + Expected: []sql.UntypedSqlRow{{1}, {2}, {3}}, }, { Query: "select * from t1", - Expected: []sql.Row{{1, 1}, {2, 2}, {3, 3}}, + Expected: []sql.UntypedSqlRow{{1, 1}, {2, 2}, {3, 3}}, }, }, }, @@ -402,15 +402,15 @@ var DdlBranchTests = []queries.ScriptTest{ Assertions: []queries.ScriptTestAssertion{ { Query: "alter table `mydb/b1`.t1 modify column b varchar(1) first", - Expected: []sql.Row{{types.OkResult{RowsAffected: 0}}}, + Expected: []sql.UntypedSqlRow{{types.OkResult{RowsAffected: 0}}}, }, { Query: "select * from `mydb/b1`.t1", - Expected: []sql.Row{{"1", 1}, {"2", 2}, {"3", 3}}, + Expected: []sql.UntypedSqlRow{{"1", 1}, {"2", 2}, {"3", 3}}, }, { Query: "select * from t1", - Expected: []sql.Row{{1, 1}, {2, 2}, {3, 3}}, + Expected: []sql.UntypedSqlRow{{1, 1}, {2, 2}, {3, 3}}, }, }, }, @@ -425,11 +425,11 @@ var DdlBranchTests = []queries.ScriptTest{ Assertions: []queries.ScriptTestAssertion{ { Query: "create index idx on `mydb/b1`.t1 (b)", - Expected: []sql.Row{{types.OkResult{RowsAffected: 0}}}, + Expected: []sql.UntypedSqlRow{{types.OkResult{RowsAffected: 0}}}, }, { Query: "show create table `mydb/b1`.t1", - Expected: []sql.Row{{"t1", "CREATE TABLE `t1` (\n" + + Expected: []sql.UntypedSqlRow{{"t1", "CREATE TABLE `t1` (\n" + " `a` int NOT NULL,\n" + " `b` int,\n" + " PRIMARY KEY (`a`),\n" + @@ -438,7 +438,7 @@ var DdlBranchTests = []queries.ScriptTest{ }, { Query: "show create table t1", - Expected: []sql.Row{{"t1", "CREATE TABLE `t1` (\n" + + Expected: []sql.UntypedSqlRow{{"t1", "CREATE TABLE `t1` (\n" + " `a` int NOT NULL,\n" + " `b` int,\n" + " PRIMARY KEY (`a`)\n" + @@ -446,11 +446,11 @@ var DdlBranchTests = []queries.ScriptTest{ }, { Query: "alter table `mydb/b1`.t1 drop index idx", - Expected: []sql.Row{{types.OkResult{RowsAffected: 0}}}, + Expected: []sql.UntypedSqlRow{{types.OkResult{RowsAffected: 0}}}, }, { Query: "show create table `mydb/b1`.t1", - Expected: []sql.Row{{"t1", "CREATE TABLE `t1` (\n" + + Expected: []sql.UntypedSqlRow{{"t1", "CREATE TABLE `t1` (\n" + " `a` int NOT NULL,\n" + " `b` int,\n" + " PRIMARY KEY (`a`)\n" + @@ -469,11 +469,11 @@ var DdlBranchTests = []queries.ScriptTest{ Assertions: []queries.ScriptTestAssertion{ { Query: "alter table `mydb/b1`.t1 add constraint chk1 check (b < 4)", - Expected: []sql.Row{{types.NewOkResult(0)}}, + Expected: []sql.UntypedSqlRow{{types.NewOkResult(0)}}, }, { Query: "show create table `mydb/b1`.t1", - Expected: []sql.Row{{"t1", "CREATE TABLE `t1` (\n" + + Expected: []sql.UntypedSqlRow{{"t1", "CREATE TABLE `t1` (\n" + " `a` int NOT NULL,\n" + " `b` int,\n" + " PRIMARY KEY (`a`),\n" + @@ -486,7 +486,7 @@ var DdlBranchTests = []queries.ScriptTest{ }, { Query: "show create table t1", - Expected: []sql.Row{{"t1", "CREATE TABLE `t1` (\n" + + Expected: []sql.UntypedSqlRow{{"t1", "CREATE TABLE `t1` (\n" + " `a` int NOT NULL,\n" + " `b` int,\n" + " PRIMARY KEY (`a`)\n" + @@ -494,15 +494,15 @@ var DdlBranchTests = []queries.ScriptTest{ }, { Query: "insert into t1 values (4, 4)", - Expected: []sql.Row{{types.OkResult{RowsAffected: 1}}}, + Expected: []sql.UntypedSqlRow{{types.OkResult{RowsAffected: 1}}}, }, { Query: "alter table `mydb/b1`.t1 drop constraint chk1", - Expected: []sql.Row{}, + Expected: []sql.UntypedSqlRow{}, }, { Query: "show create table `mydb/b1`.t1", - Expected: []sql.Row{{"t1", "CREATE TABLE `t1` (\n" + + Expected: []sql.UntypedSqlRow{{"t1", "CREATE TABLE `t1` (\n" + " `a` int NOT NULL,\n" + " `b` int,\n" + " PRIMARY KEY (`a`)\n" + diff --git a/go/libraries/doltcore/sqle/enginetest/dolt_engine_test.go b/go/libraries/doltcore/sqle/enginetest/dolt_engine_test.go index 78805998839..d43f625b477 100644 --- a/go/libraries/doltcore/sqle/enginetest/dolt_engine_test.go +++ b/go/libraries/doltcore/sqle/enginetest/dolt_engine_test.go @@ -81,7 +81,7 @@ func TestSingleQuery(t *testing.T) { var test queries.QueryTest test = queries.QueryTest{ Query: `show create table mytable`, - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {"mytable", "CREATE TABLE `mytable` (\n" + " `i` bigint NOT NULL,\n" + @@ -158,11 +158,11 @@ func TestSingleMergeScript(t *testing.T) { Assertions: []queries.ScriptTestAssertion{ { Query: "call dolt_merge('right');", - Expected: []sql.Row{{doltCommit, 0, 0}}, + Expected: []sql.UntypedSqlRow{{doltCommit, 0, 0}}, }, { Query: "select pk, col1, col2 from t;", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {1, 101, nil}, {2, 102, nil}, {3, 103, "3hello"}, @@ -192,11 +192,11 @@ func TestSingleMergeScript(t *testing.T) { // Assertions: []queries.ScriptTestAssertion{ // { // Query: "call dolt_merge('right');", - // Expected: []sql.Row{{doltCommit, 0, 0}}, + // Expected: []sql.UntypedSqlRow{{doltCommit, 0, 0}}, // }, // { // Query: "select pk, col1, col2 from t;", - // Expected: []sql.Row{ + // Expected: []sql.UntypedSqlRow{ // {1, 101, "1hello"}, // {2, 102, "2hello"}, // {3, 103, "3hello"}, @@ -224,11 +224,11 @@ func TestSingleMergeScript(t *testing.T) { // Assertions: []queries.ScriptTestAssertion{ // { // Query: "call dolt_merge('right');", - // Expected: []sql.Row{{doltCommit, 0, 0}}, + // Expected: []sql.UntypedSqlRow{{doltCommit, 0, 0}}, // }, // { // Query: "select * from t;", - // Expected: []sql.Row{{1, "hello"}, {2, "hi"}, {3, "hello"}}, + // Expected: []sql.UntypedSqlRow{{1, "hello"}, {2, "hi"}, {3, "hello"}}, // }, // }, // }, @@ -251,15 +251,15 @@ func TestSingleMergeScript(t *testing.T) { // Assertions: []queries.ScriptTestAssertion{ // { // Query: "call dolt_merge('right');", - // Expected: []sql.Row{{"", 0, 1}}, + // Expected: []sql.UntypedSqlRow{{"", 0, 1}}, // }, // { // Query: "select * from dolt_constraint_violations;", - // Expected: []sql.Row{{"t", uint64(1)}}, + // Expected: []sql.UntypedSqlRow{{"t", uint64(1)}}, // }, // { // Query: `select violation_type, pk, col1, violation_info like "\%NOT((col1 = concat('he','llo')))\%" from dolt_constraint_violations_t;`, - // Expected: []sql.Row{{uint64(3), 2, "hello", true}}, + // Expected: []sql.UntypedSqlRow{{uint64(3), 2, "hello", true}}, // }, // }, // }, @@ -305,7 +305,7 @@ func TestSingleQueryPrepared(t *testing.T) { var test queries.QueryTest test = queries.QueryTest{ Query: "explain select pk, c from dolt_history_t1 where pk = 3 and committer = 'someguy'", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {"Exchange"}, {" └─ Project(dolt_history_t1.pk, dolt_history_t1.c)"}, {" └─ Filter((dolt_history_t1.pk = 3) AND (dolt_history_t1.committer = 'someguy'))"}, @@ -338,20 +338,20 @@ func TestSingleScriptPrepared(t *testing.T) { Assertions: []queries.ScriptTestAssertion{ { Query: "select * from dolt_history_xy where commit_hash = (select dolt_log.commit_hash from dolt_log limit 1 offset 1) order by 1", - Expected: []sql.Row{ - sql.Row{0, 1, "itt2nrlkbl7jis4gt9aov2l32ctt08th", "billy bob", time.Date(1970, time.January, 1, 19, 0, 0, 0, time.Local)}, - sql.Row{2, 3, "itt2nrlkbl7jis4gt9aov2l32ctt08th", "billy bob", time.Date(1970, time.January, 1, 19, 0, 0, 0, time.Local)}, + Expected: []sql.UntypedSqlRow{ + {0, 1, "itt2nrlkbl7jis4gt9aov2l32ctt08th", "billy bob", time.Date(1970, time.January, 1, 19, 0, 0, 0, time.Local)}, + {2, 3, "itt2nrlkbl7jis4gt9aov2l32ctt08th", "billy bob", time.Date(1970, time.January, 1, 19, 0, 0, 0, time.Local)}, }, }, { Query: "select count(*) from dolt_history_xy where commit_hash = (select dolt_log.commit_hash from dolt_log limit 1 offset 1)", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {2}, }, }, { Query: "select count(*) from dolt_history_xy where commit_hash = 'itt2nrlkbl7jis4gt9aov2l32ctt08th'", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {2}, }, }, @@ -1357,7 +1357,7 @@ func TestSingleTransactionScript(t *testing.T) { }, { Query: "/* client a */ insert into t1 values (1, 1)", - Expected: []sql.Row{{gmstypes.NewOkResult(1)}}, + Expected: []sql.UntypedSqlRow{{gmstypes.NewOkResult(1)}}, }, { Query: "/* client a */ insert into t1 values (1, 2)", @@ -1365,15 +1365,15 @@ func TestSingleTransactionScript(t *testing.T) { }, { Query: "/* client a */ insert into t1 values (2, 2)", - Expected: []sql.Row{{gmstypes.NewOkResult(1)}}, + Expected: []sql.UntypedSqlRow{{gmstypes.NewOkResult(1)}}, }, { Query: "/* client a */ select * from t1 order by pk", - Expected: []sql.Row{{0, 0}, {1, 1}, {2, 2}}, + Expected: []sql.UntypedSqlRow{{0, 0}, {1, 1}, {2, 2}}, }, { Query: "/* client b */ select * from t1 order by pk", - Expected: []sql.Row{{0, 0}}, + Expected: []sql.UntypedSqlRow{{0, 0}}, }, { Query: "/* client a */ commit", @@ -1385,11 +1385,11 @@ func TestSingleTransactionScript(t *testing.T) { }, { Query: "/* client b */ select * from t1 order by pk", - Expected: []sql.Row{{0, 0}, {1, 1}, {2, 2}}, + Expected: []sql.UntypedSqlRow{{0, 0}, {1, 1}, {2, 2}}, }, { Query: "/* client a */ select * from t1 order by pk", - Expected: []sql.Row{{0, 0}, {1, 1}, {2, 2}}, + Expected: []sql.UntypedSqlRow{{0, 0}, {1, 1}, {2, 2}}, }, }, } @@ -1892,7 +1892,7 @@ func TestDoltStorageFormatPrepared(t *testing.T) { } h := newDoltHarness(t) defer h.Close() - enginetest.TestPreparedQuery(t, h, "SELECT dolt_storage_format()", []sql.Row{{expectedFormatString}}, nil) + enginetest.TestPreparedQuery(t, h, "SELECT dolt_storage_format()", []sql.UntypedSqlRow{{expectedFormatString}}, nil) } func TestThreeWayMergeWithSchemaChangeScripts(t *testing.T) { diff --git a/go/libraries/doltcore/sqle/enginetest/dolt_engine_tests.go b/go/libraries/doltcore/sqle/enginetest/dolt_engine_tests.go index b82a05ad88e..5388feff18f 100755 --- a/go/libraries/doltcore/sqle/enginetest/dolt_engine_tests.go +++ b/go/libraries/doltcore/sqle/enginetest/dolt_engine_tests.go @@ -136,7 +136,7 @@ func testAutoIncrementTrackerWithLockMode(t *testing.T, harness DoltEnginetestHa require.NoError(t, err) rows, err := sql.RowIterToRows(ctx, iter) require.NoError(t, err) - assert.Equal(t, rows, []sql.Row{{lockMode}}) + assert.Equal(t, sql.RowsToUntyped(rows), []sql.UntypedSqlRow{{lockMode}}) // Ordinarily QueryEngine.query manages transactions. // Since we can't use that for this test, we manually start a new transaction. @@ -195,7 +195,7 @@ func testAutoIncrementTrackerWithLockMode(t *testing.T, harness DoltEnginetestHa require.NoError(t, err) rows, err := sql.RowIterToRows(ctx, iter) require.NoError(t, err) - assert.Equal(t, rows, []sql.Row{{int64(64)}}) + assert.Equal(t, sql.RowsToUntyped(rows), []sql.UntypedSqlRow{{int64(64)}}) } // Verify that the insert operations are actually interleaved by inspecting the order that values were added to `timestamps` @@ -204,7 +204,7 @@ func testAutoIncrementTrackerWithLockMode(t *testing.T, harness DoltEnginetestHa require.NoError(t, err) rows, err := sql.RowIterToRows(ctx, iter) require.NoError(t, err) - assert.Equal(t, rows, []sql.Row{{true}}) + assert.Equal(t, sql.RowsToUntyped(rows), []sql.UntypedSqlRow{{true}}) } { @@ -212,7 +212,7 @@ func testAutoIncrementTrackerWithLockMode(t *testing.T, harness DoltEnginetestHa require.NoError(t, err) rows, err := sql.RowIterToRows(ctx, iter) require.NoError(t, err) - assert.Equal(t, rows, []sql.Row{{true}}) + assert.Equal(t, sql.RowsToUntyped(rows), []sql.UntypedSqlRow{{true}}) } } @@ -390,7 +390,7 @@ func RunDropEngineTest(t *testing.T, h DoltEnginetestHarness) { Assertions: []queries.ScriptTestAssertion{ { Query: "DROP DATABASE TeSt2DB", - Expected: []sql.Row{{gmstypes.OkResult{RowsAffected: 1}}}, + Expected: []sql.UntypedSqlRow{{gmstypes.OkResult{RowsAffected: 1}}}, }, { Query: "USE test2db", @@ -398,11 +398,11 @@ func RunDropEngineTest(t *testing.T, h DoltEnginetestHarness) { }, { Query: "USE TEST1DB", - Expected: []sql.Row{}, + Expected: []sql.UntypedSqlRow{}, }, { Query: "DROP DATABASE IF EXISTS test1DB", - Expected: []sql.Row{{gmstypes.OkResult{RowsAffected: 1}}}, + Expected: []sql.UntypedSqlRow{{gmstypes.OkResult{RowsAffected: 1}}}, }, { Query: "USE Test1db", @@ -701,36 +701,36 @@ func RunDoltRevisionDbScriptsTest(t *testing.T, h DoltEnginetestHarness) { rows, err := sql.RowIterToRows(ctx, iter) require.NoError(t, err) assert.Equal(t, 1, len(rows)) - commithash := rows[0][0].(string) + commithash := rows[0].GetValue(0).(string) scriptTest := queries.ScriptTest{ Name: "database revision specs: commit-qualified revision spec", Assertions: []queries.ScriptTestAssertion{ { Query: "show databases;", - Expected: []sql.Row{{"mydb"}, {"information_schema"}, {"mysql"}}, + Expected: []sql.UntypedSqlRow{{"mydb"}, {"information_schema"}, {"mysql"}}, }, { Query: "use mydb/" + commithash, - Expected: []sql.Row{}, + Expected: []sql.UntypedSqlRow{}, }, { Query: "select active_branch();", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {nil}, }, }, { Query: "select database();", - Expected: []sql.Row{{"mydb/" + commithash}}, + Expected: []sql.UntypedSqlRow{{"mydb/" + commithash}}, }, { Query: "show databases;", - Expected: []sql.Row{{"mydb"}, {"mydb/" + commithash}, {"information_schema"}, {"mysql"}}, + Expected: []sql.UntypedSqlRow{{"mydb"}, {"mydb/" + commithash}, {"information_schema"}, {"mysql"}}, }, { Query: "select * from t01", - Expected: []sql.Row{}, + Expected: []sql.UntypedSqlRow{}, }, { Query: "call dolt_reset();", @@ -738,27 +738,27 @@ func RunDoltRevisionDbScriptsTest(t *testing.T, h DoltEnginetestHarness) { }, { Query: "call dolt_checkout('main');", - Expected: []sql.Row{{0, "Switched to branch 'main'"}}, + Expected: []sql.UntypedSqlRow{{0, "Switched to branch 'main'"}}, }, { Query: "select database();", - Expected: []sql.Row{{"mydb"}}, + Expected: []sql.UntypedSqlRow{{"mydb"}}, }, { Query: "select active_branch();", - Expected: []sql.Row{{"main"}}, + Expected: []sql.UntypedSqlRow{{"main"}}, }, { Query: "use mydb;", - Expected: []sql.Row{}, + Expected: []sql.UntypedSqlRow{}, }, { Query: "select database();", - Expected: []sql.Row{{"mydb"}}, + Expected: []sql.UntypedSqlRow{{"mydb"}}, }, { Query: "show databases;", - Expected: []sql.Row{{"mydb"}, {"information_schema"}, {"mysql"}}, + Expected: []sql.UntypedSqlRow{{"mydb"}, {"information_schema"}, {"mysql"}}, }, }, } @@ -1638,7 +1638,7 @@ func RunAddDropPrimaryKeysTests(t *testing.T, harness DoltEnginetestHarness) { Assertions: []queries.ScriptTestAssertion{ { Query: "show create table test", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {"test", "CREATE TABLE `test` (\n" + " `id` int NOT NULL,\n" + " `c1` int,\n" + @@ -1688,7 +1688,7 @@ func RunAddDropPrimaryKeysTests(t *testing.T, harness DoltEnginetestHarness) { Assertions: []queries.ScriptTestAssertion{ { Query: "show create table test", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {"test", "CREATE TABLE `test` (\n" + " `id` int NOT NULL,\n" + " `c1` int,\n" + @@ -1700,7 +1700,7 @@ func RunAddDropPrimaryKeysTests(t *testing.T, harness DoltEnginetestHarness) { }, { Query: "select * from test order by id", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {1, 1}, {2, 2}, }, @@ -1765,7 +1765,7 @@ func RunAddDropPrimaryKeysTests(t *testing.T, harness DoltEnginetestHarness) { Assertions: []queries.ScriptTestAssertion{ { Query: "show create table test", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {"test", "CREATE TABLE `test` (\n" + " `id` int NOT NULL,\n" + " `c1` int,\n" + @@ -1775,7 +1775,7 @@ func RunAddDropPrimaryKeysTests(t *testing.T, harness DoltEnginetestHarness) { }, { Query: "select * from test order by id", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {1, 1}, {2, 2}, }, @@ -1827,7 +1827,7 @@ func RunDoltStorageFormatTests(t *testing.T, h DoltEnginetestHarness) { Assertions: []queries.ScriptTestAssertion{ { Query: "select dolt_storage_format()", - Expected: []sql.Row{{expectedFormatString}}, + Expected: []sql.UntypedSqlRow{{expectedFormatString}}, }, }, } diff --git a/go/libraries/doltcore/sqle/enginetest/dolt_harness.go b/go/libraries/doltcore/sqle/enginetest/dolt_harness.go index 22d4c8074c0..d5fbdc2253b 100644 --- a/go/libraries/doltcore/sqle/enginetest/dolt_harness.go +++ b/go/libraries/doltcore/sqle/enginetest/dolt_harness.go @@ -173,7 +173,7 @@ func (d *DoltHarness) resetScripts() []setup.SetupScript { _, res := enginetest.MustQuery(ctx, d.engine, "select schema_name from information_schema.schemata where schema_name not in ('information_schema');") var dbs []string for i := range res { - dbs = append(dbs, res[i][0].(string)) + dbs = append(dbs, res[i].GetValue(0).(string)) } var resetCmds []setup.SetupScript @@ -188,7 +188,7 @@ func (d *DoltHarness) resetScripts() []setup.SetupScript { fmt.Sprintf("select distinct table_name from information_schema.columns where extra = 'auto_increment' and table_schema = '%s';", db)) for _, tableNameRow := range aiTables { - tableName := tableNameRow[0].(string) + tableName := tableNameRow.GetValue(0).(string) // special handling for auto_increment_tbl, which is expected to start with particular values if strings.EqualFold(tableName, "auto_increment_tbl") { diff --git a/go/libraries/doltcore/sqle/enginetest/dolt_procedure_queries.go b/go/libraries/doltcore/sqle/enginetest/dolt_procedure_queries.go index c63c437c0c7..5b0af60a896 100755 --- a/go/libraries/doltcore/sqle/enginetest/dolt_procedure_queries.go +++ b/go/libraries/doltcore/sqle/enginetest/dolt_procedure_queries.go @@ -48,15 +48,15 @@ end }, { Query: "select * from t", - Expected: []sql.Row{{1, 1}, {2, 2}, {3, 3}, {4, 4}, {5, 5}, {6, 6}, {7, 7}, {8, 8}, {9, 9}, {10, 10}}, + Expected: []sql.UntypedSqlRow{{1, 1}, {2, 2}, {3, 3}, {4, 4}, {5, 5}, {6, 6}, {7, 7}, {8, 8}, {9, 9}, {10, 10}}, }, { Query: "select count(*) from dolt_log;", - Expected: []sql.Row{{13}}, // init, setup for test harness, initial commit in setup script, 10 commits in procedure + Expected: []sql.UntypedSqlRow{{13}}, // init, setup for test harness, initial commit in setup script, 10 commits in procedure }, { Query: "select * from t as of `HEAD~5`", - Expected: []sql.Row{{1, 1}, {2, 2}, {3, 3}, {4, 4}, {5, 5}}, + Expected: []sql.UntypedSqlRow{{1, 1}, {2, 2}, {3, 3}, {4, 4}, {5, 5}}, }, }, }, @@ -86,11 +86,11 @@ end }, { Query: "select name from dolt_branches order by 1", - Expected: []sql.Row{{"branch1"}, {"branch2"}, {"branch3"}, {"branch4"}, {"main"}}, + Expected: []sql.UntypedSqlRow{{"branch1"}, {"branch2"}, {"branch3"}, {"branch4"}, {"main"}}, }, { Query: "select * from t order by 1", - Expected: []sql.Row{{1, 1}, {2, 2}, {3, 3}, {4, 4}}, + Expected: []sql.UntypedSqlRow{{1, 1}, {2, 2}, {3, 3}, {4, 4}}, }, }, }, @@ -120,11 +120,11 @@ end }, { Query: "select name from dolt_branches order by 1", - Expected: []sql.Row{{"branch1"}, {"branch2"}, {"branch3"}, {"branch4"}, {"main"}}, + Expected: []sql.UntypedSqlRow{{"branch1"}, {"branch2"}, {"branch3"}, {"branch4"}, {"main"}}, }, { Query: "select * from t order by 1", - Expected: []sql.Row{{1, 1}, {2, 2}, {3, 3}, {4, 4}}, + Expected: []sql.UntypedSqlRow{{1, 1}, {2, 2}, {3, 3}, {4, 4}}, }, }, }, @@ -165,11 +165,11 @@ end }, { Query: "select name from dolt_branches order by 1", - Expected: []sql.Row{{"branch1"}, {"branch2"}, {"branch3"}, {"branch4"}, {"main"}}, + Expected: []sql.UntypedSqlRow{{"branch1"}, {"branch2"}, {"branch3"}, {"branch4"}, {"main"}}, }, { Query: "select * from t order by 1", - Expected: []sql.Row{{1, 1}, {2, 2}, {3, 3}, {4, 4}}, + Expected: []sql.UntypedSqlRow{{1, 1}, {2, 2}, {3, 3}, {4, 4}}, }, }, }, @@ -211,11 +211,11 @@ end }, { Query: "select name from dolt_branches order by 1", - Expected: []sql.Row{{"branch1"}, {"branch2"}, {"branch3"}, {"branch4"}, {"main"}}, + Expected: []sql.UntypedSqlRow{{"branch1"}, {"branch2"}, {"branch3"}, {"branch4"}, {"main"}}, }, { Query: "select * from t order by 1", - Expected: []sql.Row{{1, 1}, {2, 2}, {3, 3}, {4, 4}}, + Expected: []sql.UntypedSqlRow{{1, 1}, {2, 2}, {3, 3}, {4, 4}}, }, }, }, @@ -254,13 +254,13 @@ end Assertions: []queries.ScriptTestAssertion{ { Query: "insert into t values (1, 1);", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {gmstypes.OkResult{RowsAffected: 1, InsertID: 4}}, }, }, { Query: "select name from dolt_branches order by 1", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {"branch1"}, {"branch2"}, {"branch3"}, @@ -272,7 +272,7 @@ end // For some reason, calling stored procedures disables inserts Skip: true, Query: "select * from t2 order by 1", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {1, 1}, {2, 2}, {3, 3}, @@ -304,22 +304,22 @@ end { Query: "select active_branch()", Skip: true, - Expected: []sql.Row{{"main"}}, + Expected: []sql.UntypedSqlRow{{"main"}}, }, { Query: "select * from t order by 1", Skip: true, - Expected: []sql.Row{}, + Expected: []sql.UntypedSqlRow{}, }, { Query: "select name from dolt_branches order by 1", Skip: true, - Expected: []sql.Row{{"branch1"}, {"main"}}, + Expected: []sql.UntypedSqlRow{{"branch1"}, {"main"}}, }, { Query: "select * from `mydb/branch1`.t order by 1", Skip: true, - Expected: []sql.Row{{1, 100}}, + Expected: []sql.UntypedSqlRow{{1, 100}}, }, }, }, @@ -347,22 +347,22 @@ end { Query: "select active_branch()", Skip: true, - Expected: []sql.Row{{"main"}}, + Expected: []sql.UntypedSqlRow{{"main"}}, }, { Query: "select * from t order by 1", Skip: true, - Expected: []sql.Row{}, + Expected: []sql.UntypedSqlRow{}, }, { Query: "select name from dolt_branches order by 1", Skip: true, - Expected: []sql.Row{{"branch1"}, {"main"}}, + Expected: []sql.UntypedSqlRow{{"branch1"}, {"main"}}, }, { Query: "select * from `mydb/branch1`.t order by 1", Skip: true, - Expected: []sql.Row{{1, 100}}, + Expected: []sql.UntypedSqlRow{{1, 100}}, }, }, }, @@ -393,19 +393,19 @@ end }, { Query: "select active_branch()", - Expected: []sql.Row{{"main"}}, + Expected: []sql.UntypedSqlRow{{"main"}}, }, { Query: "select * from t order by 1", - Expected: []sql.Row{{1, 100}}, + Expected: []sql.UntypedSqlRow{{1, 100}}, }, { Query: "select name from dolt_branches order by 1", - Expected: []sql.Row{{"branch1"}, {"main"}}, + Expected: []sql.UntypedSqlRow{{"branch1"}, {"main"}}, }, { Query: "select * from `mydb/branch1`.t order by 1", - Expected: []sql.Row{{1, 100}, {2, 200}}, + Expected: []sql.UntypedSqlRow{{1, 100}, {2, 200}}, }, }, }, diff --git a/go/libraries/doltcore/sqle/enginetest/dolt_queries.go b/go/libraries/doltcore/sqle/enginetest/dolt_queries.go index 2b5a1985880..9a4b1238708 100644 --- a/go/libraries/doltcore/sqle/enginetest/dolt_queries.go +++ b/go/libraries/doltcore/sqle/enginetest/dolt_queries.go @@ -52,19 +52,19 @@ var ViewsWithAsOfScriptTest = queries.ScriptTest{ Assertions: []queries.ScriptTestAssertion{ { Query: "select * from v1", - Expected: []sql.Row{{1, "1"}, {2, "2"}, {1, "one"}, {2, "two"}}, + Expected: []sql.UntypedSqlRow{{1, "1"}, {2, "2"}, {1, "one"}, {2, "two"}}, }, { Query: "select * from v1 as of 'HEAD'", - Expected: []sql.Row{{1, "1"}, {2, "2"}, {1, "one"}, {2, "two"}}, + Expected: []sql.UntypedSqlRow{{1, "1"}, {2, "2"}, {1, "one"}, {2, "two"}}, }, { Query: "select * from v1 as of 'HEAD~1'", - Expected: []sql.Row{{1, "1"}, {2, "2"}, {1, "one"}, {2, "two"}}, + Expected: []sql.UntypedSqlRow{{1, "1"}, {2, "2"}, {1, "one"}, {2, "two"}}, }, { Query: "select * from v1 as of 'HEAD~2'", - Expected: []sql.Row{{1, "1"}, {2, "2"}}, + Expected: []sql.UntypedSqlRow{{1, "1"}, {2, "2"}}, }, { // At this point table t1 doesn't exist yet, so the view should return an error @@ -81,7 +81,7 @@ var ViewsWithAsOfScriptTest = queries.ScriptTest{ }, { Query: "select * from v1 as of HEAD", - Expected: []sql.Row{{1, "1"}, {2, "2"}, {1, "one"}, {2, "two"}}, + Expected: []sql.UntypedSqlRow{{1, "1"}, {2, "2"}, {1, "one"}, {2, "two"}}, }, { Query: "select * from v1 as of HEAD.ASDF", @@ -115,7 +115,7 @@ var ShowCreateTableScriptTests = []queries.ScriptTest{ }, { Query: "show create table a as of @Commit1;", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {"a", "CREATE TABLE `a` (\n" + " `pk` int NOT NULL,\n" + " `c1` int,\n" + @@ -126,7 +126,7 @@ var ShowCreateTableScriptTests = []queries.ScriptTest{ }, { Query: "show create table a as of @Commit2;", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {"a", "CREATE TABLE `a` (\n" + " `pk` int NOT NULL,\n" + " `c1` int,\n" + @@ -138,7 +138,7 @@ var ShowCreateTableScriptTests = []queries.ScriptTest{ }, { Query: "show create table a as of @Commit3;", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {"a", "CREATE TABLE `a` (\n" + " `pk` int NOT NULL,\n" + " `c2` varchar(20),\n" + @@ -150,7 +150,7 @@ var ShowCreateTableScriptTests = []queries.ScriptTest{ }, { Query: "show create table a as of HEAD;", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {"a", "CREATE TABLE `a` (\n" + " `pk` int NOT NULL,\n" + " `c2` varchar(20),\n" + @@ -181,7 +181,7 @@ var ShowCreateTableScriptTests = []queries.ScriptTest{ Assertions: []queries.ScriptTestAssertion{ { Query: "show create table tbl", - Expected: []sql.Row{{"tbl", "CREATE TABLE `tbl` (\n" + + Expected: []sql.UntypedSqlRow{{"tbl", "CREATE TABLE `tbl` (\n" + " `a` int NOT NULL,\n" + " `b` int NOT NULL DEFAULT '42',\n" + // " `c` int NOT NULL DEFAULT (24),\n" + // Ensure these match setup above. @@ -215,7 +215,7 @@ var ShowCreateTableScriptTests = []queries.ScriptTest{ Assertions: []queries.ScriptTestAssertion{ { Query: "show create table tbl", - Expected: []sql.Row{{"tbl", "CREATE TABLE `tbl` (\n" + + Expected: []sql.UntypedSqlRow{{"tbl", "CREATE TABLE `tbl` (\n" + " `a` int NOT NULL DEFAULT CURRENT_TIMESTAMP,\n" + // MySql preserves now as lower case. " `b` int NOT NULL DEFAULT '42',\n" + // " `c` int NOT NULL DEFAULT (24),\n" + // Ensure these match setup above. @@ -257,7 +257,7 @@ var ShowCreateTableScriptTests = []queries.ScriptTest{ }, { Query: "show create table child as of @Commit1;", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {"child", "CREATE TABLE `child` (\n" + " `pk` int NOT NULL,\n" + " `c1` int,\n" + @@ -271,7 +271,7 @@ var ShowCreateTableScriptTests = []queries.ScriptTest{ }, { Query: "show create table child as of @Commit2;", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {"child", "CREATE TABLE `child` (\n" + " `pk` int NOT NULL,\n" + " `c1` int,\n" + @@ -287,7 +287,7 @@ var ShowCreateTableScriptTests = []queries.ScriptTest{ }, { Query: "show create table child as of @Commit3;", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {"child", "CREATE TABLE `child` (\n" + " `pk` int NOT NULL,\n" + " `c3` int,\n" + @@ -301,7 +301,7 @@ var ShowCreateTableScriptTests = []queries.ScriptTest{ }, { Query: "show create table child as of HEAD;", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {"child", "CREATE TABLE `child` (\n" + " `pk` int NOT NULL,\n" + " `c3` int,\n" + @@ -340,14 +340,14 @@ var DescribeTableAsOfScriptTest = queries.ScriptTest{ }, { Query: "describe a as of @Commit1;", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {"pk", "int", "NO", "PRI", nil, ""}, {"c1", "int", "YES", "", nil, ""}, }, }, { Query: "describe a as of @Commit2;", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {"pk", "int", "NO", "PRI", nil, ""}, {"c1", "int", "YES", "", nil, ""}, {"c2", "varchar(20)", "YES", "", nil, ""}, @@ -355,14 +355,14 @@ var DescribeTableAsOfScriptTest = queries.ScriptTest{ }, { Query: "describe a as of @Commit3;", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {"pk", "int", "NO", "PRI", nil, ""}, {"c2", "varchar(20)", "YES", "", nil, ""}, }, }, { Query: "describe a as of HEAD;", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {"pk", "int", "NO", "PRI", nil, ""}, {"c2", "varchar(20)", "YES", "", nil, ""}, }, @@ -392,33 +392,33 @@ var DoltRevisionDbScripts = []queries.ScriptTest{ Assertions: []queries.ScriptTestAssertion{ { Query: "show databases;", - Expected: []sql.Row{{"mydb"}, {"information_schema"}, {"mysql"}}, + Expected: []sql.UntypedSqlRow{{"mydb"}, {"information_schema"}, {"mysql"}}, }, { Query: "use `mydb/tag1~`;", - Expected: []sql.Row{}, + Expected: []sql.UntypedSqlRow{}, }, { // The database name is always the requested name Query: "select database()", - Expected: []sql.Row{{"mydb/tag1~"}}, + Expected: []sql.UntypedSqlRow{{"mydb/tag1~"}}, }, { Query: "show databases;", - Expected: []sql.Row{{"mydb"}, {"mydb/tag1~"}, {"information_schema"}, {"mysql"}}, + Expected: []sql.UntypedSqlRow{{"mydb"}, {"mydb/tag1~"}, {"information_schema"}, {"mysql"}}, }, { // The branch is nil in the case of a non-branch revision DB Query: "select active_branch()", - Expected: []sql.Row{{nil}}, + Expected: []sql.UntypedSqlRow{{nil}}, }, { Query: "select * from t01;", - Expected: []sql.Row{{1, 1}, {2, 2}}, + Expected: []sql.UntypedSqlRow{{1, 1}, {2, 2}}, }, { Query: "select * from `mydb/tag1^`.t01;", - Expected: []sql.Row{{1, 1}, {2, 2}}, + Expected: []sql.UntypedSqlRow{{1, 1}, {2, 2}}, }, { // Only merge commits are valid for ^2 ancestor spec @@ -427,11 +427,11 @@ var DoltRevisionDbScripts = []queries.ScriptTest{ }, { Query: "select * from `mydb/tag1~1`.t01;", - Expected: []sql.Row{{1, 1}, {2, 2}}, + Expected: []sql.UntypedSqlRow{{1, 1}, {2, 2}}, }, { Query: "select * from `mydb/tag1~2`.t01;", - Expected: []sql.Row{}, + Expected: []sql.UntypedSqlRow{}, }, { Query: "select * from `mydb/tag1~3`.t01;", @@ -443,15 +443,15 @@ var DoltRevisionDbScripts = []queries.ScriptTest{ }, { Query: "select * from `mydb/branch1~`.t01;", - Expected: []sql.Row{{100, 100}, {200, 200}}, + Expected: []sql.UntypedSqlRow{{100, 100}, {200, 200}}, }, { Query: "select * from `mydb/branch1^`.t01;", - Expected: []sql.Row{{100, 100}, {200, 200}}, + Expected: []sql.UntypedSqlRow{{100, 100}, {200, 200}}, }, { Query: "select * from `mydb/branch1~2`.t01;", - Expected: []sql.Row{}, + Expected: []sql.UntypedSqlRow{}, }, { Query: "select * from `mydb/branch1~3`.t01;", @@ -474,29 +474,29 @@ var DoltRevisionDbScripts = []queries.ScriptTest{ Assertions: []queries.ScriptTestAssertion{ { Query: "show databases;", - Expected: []sql.Row{{"mydb"}, {"information_schema"}, {"mysql"}}, + Expected: []sql.UntypedSqlRow{{"mydb"}, {"information_schema"}, {"mysql"}}, }, { Query: "use mydb/tag1;", - Expected: []sql.Row{}, + Expected: []sql.UntypedSqlRow{}, }, { // The database name is always the requested name Query: "select database()", - Expected: []sql.Row{{"mydb/tag1"}}, + Expected: []sql.UntypedSqlRow{{"mydb/tag1"}}, }, { // The branch is nil in the case of a non-branch revision DB Query: "select active_branch()", - Expected: []sql.Row{{nil}}, + Expected: []sql.UntypedSqlRow{{nil}}, }, { Query: "show databases;", - Expected: []sql.Row{{"mydb"}, {"mydb/tag1"}, {"information_schema"}, {"mysql"}}, + Expected: []sql.UntypedSqlRow{{"mydb"}, {"mydb/tag1"}, {"information_schema"}, {"mysql"}}, }, { Query: "select * from t01;", - Expected: []sql.Row{{1, 1}, {2, 2}}, + Expected: []sql.UntypedSqlRow{{1, 1}, {2, 2}}, }, { Query: "call dolt_reset();", @@ -504,27 +504,27 @@ var DoltRevisionDbScripts = []queries.ScriptTest{ }, { Query: "call dolt_checkout('main');", - Expected: []sql.Row{{0, "Switched to branch 'main'"}}, + Expected: []sql.UntypedSqlRow{{0, "Switched to branch 'main'"}}, }, { Query: "select database();", - Expected: []sql.Row{{"mydb"}}, + Expected: []sql.UntypedSqlRow{{"mydb"}}, }, { Query: "select active_branch();", - Expected: []sql.Row{{"main"}}, + Expected: []sql.UntypedSqlRow{{"main"}}, }, { Query: "use mydb;", - Expected: []sql.Row{}, + Expected: []sql.UntypedSqlRow{}, }, { Query: "select database();", - Expected: []sql.Row{{"mydb"}}, + Expected: []sql.UntypedSqlRow{{"mydb"}}, }, { Query: "show databases;", - Expected: []sql.Row{{"mydb"}, {"information_schema"}, {"mysql"}}, + Expected: []sql.UntypedSqlRow{{"mydb"}, {"information_schema"}, {"mysql"}}, }, }, }, @@ -543,80 +543,80 @@ var DoltRevisionDbScripts = []queries.ScriptTest{ Assertions: []queries.ScriptTestAssertion{ { Query: "use mydb/branch1;", - Expected: []sql.Row{}, + Expected: []sql.UntypedSqlRow{}, }, { Query: "show databases;", - Expected: []sql.Row{{"mydb"}, {"mydb/branch1"}, {"information_schema"}, {"mysql"}}, + Expected: []sql.UntypedSqlRow{{"mydb"}, {"mydb/branch1"}, {"information_schema"}, {"mysql"}}, }, { // The database name is always the requested name Query: "select database()", - Expected: []sql.Row{{"mydb/branch1"}}, + Expected: []sql.UntypedSqlRow{{"mydb/branch1"}}, }, { Query: "select active_branch()", - Expected: []sql.Row{{"branch1"}}, + Expected: []sql.UntypedSqlRow{{"branch1"}}, }, { Query: "select * from t01", - Expected: []sql.Row{{1, 1}, {2, 2}}, + Expected: []sql.UntypedSqlRow{{1, 1}, {2, 2}}, }, { Query: "call dolt_checkout('main');", - Expected: []sql.Row{{0, "Switched to branch 'main'"}}, + Expected: []sql.UntypedSqlRow{{0, "Switched to branch 'main'"}}, }, { // TODO: the behavior here is a bit odd: when we call dolt_checkout, we change the current database to the // base database name. But we should also consider the connection string: if you connect to a revision // database, that database should always be visible. Query: "show databases;", - Expected: []sql.Row{{"mydb"}, {"information_schema"}, {"mysql"}}, + Expected: []sql.UntypedSqlRow{{"mydb"}, {"information_schema"}, {"mysql"}}, }, { Query: "select database();", - Expected: []sql.Row{{"mydb"}}, + Expected: []sql.UntypedSqlRow{{"mydb"}}, }, { Query: "use mydb/branch1;", - Expected: []sql.Row{}, + Expected: []sql.UntypedSqlRow{}, }, { Query: "call dolt_reset();", - Expected: []sql.Row{{0}}, + Expected: []sql.UntypedSqlRow{{0}}, }, { Query: "select database();", - Expected: []sql.Row{{"mydb/branch1"}}, + Expected: []sql.UntypedSqlRow{{"mydb/branch1"}}, }, { Query: "show databases;", - Expected: []sql.Row{{"mydb"}, {"mydb/branch1"}, {"information_schema"}, {"mysql"}}, + Expected: []sql.UntypedSqlRow{{"mydb"}, {"mydb/branch1"}, {"information_schema"}, {"mysql"}}, }, { // Create a table in the working set to verify the main db Query: "create table working_set_table(pk int primary key);", - Expected: []sql.Row{{types.NewOkResult(0)}}, + Expected: []sql.UntypedSqlRow{{types.NewOkResult(0)}}, }, { Query: "select table_name from dolt_diff where commit_hash='WORKING';", - Expected: []sql.Row{{"working_set_table"}}, + Expected: []sql.UntypedSqlRow{{"working_set_table"}}, }, { Query: "use mydb;", - Expected: []sql.Row{}, + Expected: []sql.UntypedSqlRow{}, }, { Query: "select table_name from dolt_diff where commit_hash='WORKING';", - Expected: []sql.Row{}, + Expected: []sql.UntypedSqlRow{}, }, { Query: "call dolt_checkout('branch1');", - Expected: []sql.Row{{0, "Switched to branch 'branch1'"}}, + Expected: []sql.UntypedSqlRow{{0, "Switched to branch 'branch1'"}}, }, { Query: "select table_name from dolt_diff where commit_hash='WORKING';", - Expected: []sql.Row{{"working_set_table"}}, + Expected: []sql.UntypedSqlRow{{"working_set_table"}}, }, }, }, @@ -629,39 +629,39 @@ var DoltRevisionDbScripts = []queries.ScriptTest{ Assertions: []queries.ScriptTestAssertion{ { Query: "select active_branch();", - Expected: []sql.Row{{"main"}}, + Expected: []sql.UntypedSqlRow{{"main"}}, }, { Query: "call dolt_checkout('-b', 'branch-to-delete');", - Expected: []sql.Row{{0, "Switched to branch 'branch-to-delete'"}}, + Expected: []sql.UntypedSqlRow{{0, "Switched to branch 'branch-to-delete'"}}, }, { Query: "select active_branch();", - Expected: []sql.Row{{"branch-to-delete"}}, + Expected: []sql.UntypedSqlRow{{"branch-to-delete"}}, }, { Query: "use `newtest/main`;", - Expected: []sql.Row{}, + Expected: []sql.UntypedSqlRow{}, }, { Query: "select active_branch();", - Expected: []sql.Row{{"main"}}, + Expected: []sql.UntypedSqlRow{{"main"}}, }, { Query: "call dolt_branch('-D', 'branch-to-delete');", - Expected: []sql.Row{{0}}, + Expected: []sql.UntypedSqlRow{{0}}, }, { Query: "select active_branch();", - Expected: []sql.Row{{"main"}}, + Expected: []sql.UntypedSqlRow{{"main"}}, }, { Query: "call dolt_checkout('-b', 'another-branch');", - Expected: []sql.Row{{0, "Switched to branch 'another-branch'"}}, + Expected: []sql.UntypedSqlRow{{0, "Switched to branch 'another-branch'"}}, }, { Query: "select active_branch();", - Expected: []sql.Row{{"another-branch"}}, + Expected: []sql.UntypedSqlRow{{"another-branch"}}, }, }, }, @@ -678,23 +678,23 @@ var DoltRevisionDbScripts = []queries.ScriptTest{ Assertions: []queries.ScriptTestAssertion{ { Query: "show databases;", - Expected: []sql.Row{{"mydb"}, {"information_schema"}, {"mysql"}}, + Expected: []sql.UntypedSqlRow{{"mydb"}, {"information_schema"}, {"mysql"}}, }, { Query: "use `mydb/main`;", - Expected: []sql.Row{}, + Expected: []sql.UntypedSqlRow{}, }, { Query: "select * from dolt_status", - Expected: []sql.Row{{"t01", false, "modified"}}, + Expected: []sql.UntypedSqlRow{{"t01", false, "modified"}}, }, { Query: "call dolt_checkout('t01')", - Expected: []sql.Row{{0, ""}}, + Expected: []sql.UntypedSqlRow{{0, ""}}, }, { Query: "select * from dolt_status", - // Expected: []sql.Row{}, + // Expected: []sql.UntypedSqlRow{}, SkipResultsCheck: true, // TODO: https://github.com/dolthub/dolt/issues/5816 }, }, @@ -712,21 +712,21 @@ var DoltScripts = []queries.ScriptTest{ Assertions: []queries.ScriptTestAssertion{ { Query: "SHOW TABLES;", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {"t1"}, }, }, { Query: "SELECT dolt_hashof_table('t1');", - Expected: []sql.Row{{"0lvgnnqah2lj1p6ilvfg0ssaec1v0jgk"}}, + Expected: []sql.UntypedSqlRow{{"0lvgnnqah2lj1p6ilvfg0ssaec1v0jgk"}}, }, { Query: "INSERT INTO t1 VALUES (1);", - Expected: []sql.Row{{types.OkResult{RowsAffected: 1}}}, + Expected: []sql.UntypedSqlRow{{types.OkResult{RowsAffected: 1}}}, }, { Query: "SELECT dolt_hashof_table('t1');", - Expected: []sql.Row{{"a2vkt9d1mtuhd90opbcseo5gqjae7tv6"}}, + Expected: []sql.UntypedSqlRow{{"a2vkt9d1mtuhd90opbcseo5gqjae7tv6"}}, }, { Query: "SELECT dolt_hashof_table('noexist');", @@ -752,11 +752,11 @@ var DoltScripts = []queries.ScriptTest{ Assertions: []queries.ScriptTestAssertion{ { Query: "SELECT to_pk, to_c1, from_pk, from_c1, diff_type FROM dolt_diff_test WHERE to_commit=\"WORKING\" and from_commit=hashof(\"main\") ORDER BY to_pk;", - Expected: []sql.Row{{2, 2, 2, 4, "modified"}}, + Expected: []sql.UntypedSqlRow{{2, 2, 2, 4, "modified"}}, }, { Query: "SELECT to_pk, to_c1, from_pk, from_c1, diff_type FROM dolt_diff_test WHERE from_commit=hashof(\"main\") ORDER BY to_pk;", - Expected: []sql.Row{{2, 2, 2, 4, "modified"}}, + Expected: []sql.UntypedSqlRow{{2, 2, 2, 4, "modified"}}, }, }, }, @@ -771,7 +771,7 @@ var DoltScripts = []queries.ScriptTest{ Assertions: []queries.ScriptTestAssertion{ { Query: "SHOW TABLES;", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {"t1"}, {"t2"}, {"t3"}, @@ -779,84 +779,84 @@ var DoltScripts = []queries.ScriptTest{ }, { Query: "SET @hashofdb = dolt_hashof_db();", - Expected: []sql.Row{{}}, + Expected: []sql.UntypedSqlRow{{}}, }, { Query: "SELECT @hashofdb = dolt_hashof_db('HEAD');", - Expected: []sql.Row{{true}}, + Expected: []sql.UntypedSqlRow{{true}}, }, { Query: "SELECT @hashofdb = dolt_hashof_db('STAGED');", - Expected: []sql.Row{{true}}, + Expected: []sql.UntypedSqlRow{{true}}, }, { Query: "SELECT @hashofdb = dolt_hashof_db('WORKING');", - Expected: []sql.Row{{true}}, + Expected: []sql.UntypedSqlRow{{true}}, }, { Query: "SELECT @hashofdb = dolt_hashof_db('main');", - Expected: []sql.Row{{true}}, + Expected: []sql.UntypedSqlRow{{true}}, }, { Query: "CALL dolt_checkout('-b','new');", - Expected: []sql.Row{{0, "Switched to branch 'new'"}}, + Expected: []sql.UntypedSqlRow{{0, "Switched to branch 'new'"}}, }, { Query: "SELECT @hashofdb = dolt_hashof_db('new');", - Expected: []sql.Row{{true}}, + Expected: []sql.UntypedSqlRow{{true}}, }, { Query: "INSERT INTO t1 VALUES (1);", - Expected: []sql.Row{{types.OkResult{RowsAffected: 1}}}, + Expected: []sql.UntypedSqlRow{{types.OkResult{RowsAffected: 1}}}, }, { Query: "SELECT @hashofdb = dolt_hashof_db();", - Expected: []sql.Row{{false}}, + Expected: []sql.UntypedSqlRow{{false}}, }, { Query: "SELECT @hashofdb = dolt_hashof_db('HEAD');", - Expected: []sql.Row{{true}}, + Expected: []sql.UntypedSqlRow{{true}}, }, { Query: "SELECT @hashofdb = dolt_hashof_db('STAGED');", - Expected: []sql.Row{{true}}, + Expected: []sql.UntypedSqlRow{{true}}, }, { Query: "SELECT @hashofdb = dolt_hashof_db('WORKING');", - Expected: []sql.Row{{false}}, + Expected: []sql.UntypedSqlRow{{false}}, }, { Query: "SELECT @hashofdb = dolt_hashof_db('main');", - Expected: []sql.Row{{true}}, + Expected: []sql.UntypedSqlRow{{true}}, }, { Query: "SELECT @hashofdb = dolt_hashof_db('new');", - Expected: []sql.Row{{true}}, + Expected: []sql.UntypedSqlRow{{true}}, }, { Query: "SET @hashofdb = dolt_hashof_db();", - Expected: []sql.Row{{}}, + Expected: []sql.UntypedSqlRow{{}}, }, { Query: "SELECT @hashofdb = dolt_hashof_db('STAGED');", - Expected: []sql.Row{{false}}, + Expected: []sql.UntypedSqlRow{{false}}, }, { Query: "CALL dolt_add('t1');", - Expected: []sql.Row{{int64(0)}}, + Expected: []sql.UntypedSqlRow{{int64(0)}}, }, { Query: "SELECT @hashofdb = dolt_hashof_db('STAGED');", - Expected: []sql.Row{{true}}, + Expected: []sql.UntypedSqlRow{{true}}, }, { Query: "SELECT @hashofdb = dolt_hashof_db('HEAD');", - Expected: []sql.Row{{false}}, + Expected: []sql.UntypedSqlRow{{false}}, }, { Query: "SELECT @hashofdb = dolt_hashof_db('new');", - Expected: []sql.Row{{false}}, + Expected: []sql.UntypedSqlRow{{false}}, }, { Query: "CALL dolt_commit('-m', 'added some rows to branch `new`');", @@ -864,37 +864,37 @@ var DoltScripts = []queries.ScriptTest{ }, { Query: "SELECT @hashofdb = dolt_hashof_db('HEAD');", - Expected: []sql.Row{{true}}, + Expected: []sql.UntypedSqlRow{{true}}, }, { Query: "SELECT @hashofdb = dolt_hashof_db('new');", - Expected: []sql.Row{{true}}, + Expected: []sql.UntypedSqlRow{{true}}, }, { Query: "SELECT @hashofdb = dolt_hashof_db('main');", - Expected: []sql.Row{{false}}, + Expected: []sql.UntypedSqlRow{{false}}, }, { Query: "INSERT INTO t2 VALUES (1);", - Expected: []sql.Row{{types.OkResult{RowsAffected: 1}}}, + Expected: []sql.UntypedSqlRow{{types.OkResult{RowsAffected: 1}}}, }, { Query: "SELECT @hashofdb = dolt_hashof_db();", - Expected: []sql.Row{{false}}, + Expected: []sql.UntypedSqlRow{{false}}, }, { Query: "SET @hashofdb = dolt_hashof_db();", - Expected: []sql.Row{{}}, + Expected: []sql.UntypedSqlRow{{}}, }, { Query: "create procedure proc1() SELECT * FROM t3;", - Expected: []sql.Row{{types.OkResult{}}}, + Expected: []sql.UntypedSqlRow{{types.OkResult{}}}, }, { Query: "SELECT @hashofdb = dolt_hashof_db();", - Expected: []sql.Row{{false}}, + Expected: []sql.UntypedSqlRow{{false}}, }, }, }, @@ -910,7 +910,7 @@ var DoltScripts = []queries.ScriptTest{ Query: "create table t2 (pk int primary key, c1 int, c2 int, " + "FOREIGN KEY (`c1`) REFERENCES `t1` (`pk`) ON DELETE CASCADE ON UPDATE CASCADE, " + "FOREIGN KEY (`c2`) REFERENCES `t1` (`pk`) ON DELETE CASCADE ON UPDATE CASCADE);", - Expected: []sql.Row{{types.NewOkResult(0)}}, + Expected: []sql.UntypedSqlRow{{types.NewOkResult(0)}}, }, }, }, @@ -950,42 +950,42 @@ var DoltScripts = []queries.ScriptTest{ Assertions: []queries.ScriptTestAssertion{ { Query: "select has_ancestor('main', @main1), has_ancestor('main', @main2), has_ancestor('main', @bone1), has_ancestor('main', @bone2), has_ancestor('main', @btwo1), has_ancestor('main', @onetwo1), has_ancestor('main', 'HEAD')", - Expected: []sql.Row{{true, true, false, false, false, false, false}}, + Expected: []sql.UntypedSqlRow{{true, true, false, false, false, false, false}}, }, { Query: "select has_ancestor('bone', @main1), has_ancestor('bone', @main2), has_ancestor('bone', @bone1), has_ancestor('bone', @bone2), has_ancestor('bone', @btwo1), has_ancestor('bone', @onetwo1), has_ancestor('bone', 'HEAD')", - Expected: []sql.Row{{true, false, true, true, false, false, true}}, + Expected: []sql.UntypedSqlRow{{true, false, true, true, false, false, true}}, }, { Query: "select has_ancestor('btwo', @main1), has_ancestor('btwo', @main2), has_ancestor('btwo', @bone1), has_ancestor('btwo', @bone2), has_ancestor('btwo', @btwo1), has_ancestor('btwo', @onetwo1), has_ancestor('btwo', 'HEAD')", - Expected: []sql.Row{{true, false, false, false, true, false, false}}, + Expected: []sql.UntypedSqlRow{{true, false, false, false, true, false, false}}, }, { Query: "select has_ancestor('onetwo', @main1), has_ancestor('onetwo', @main2), has_ancestor('onetwo', @bone1), has_ancestor('onetwo', @bone2), has_ancestor('onetwo', @btwo1), has_ancestor('onetwo', @onetwo1), has_ancestor('onetwo', 'HEAD')", - Expected: []sql.Row{{true, false, true, true, true, true, true}}, + Expected: []sql.UntypedSqlRow{{true, false, true, true, true, true, true}}, }, { Query: "select has_ancestor(commit_hash, 'btwo') from dolt_log where commit_hash = @onetwo1", - Expected: []sql.Row{}, + Expected: []sql.UntypedSqlRow{}, }, { Query: "select has_ancestor(commit_hash, 'btwo') from dolt_log as of 'onetwo' where commit_hash = @onetwo1", - Expected: []sql.Row{{true}}, + Expected: []sql.UntypedSqlRow{{true}}, }, { Query: "select has_ancestor('HEAD', 'tag_btwo1'), has_ancestor(@bone2, 'tag_btwo1'),has_ancestor(@onetwo1, 'tag_btwo1'), has_ancestor(@btwo1, 'tag_btwo1'), has_ancestor(@main2, 'tag_btwo1'), has_ancestor(@main1, 'tag_btwo1')", - Expected: []sql.Row{{false, false, true, true, false, false}}, + Expected: []sql.UntypedSqlRow{{false, false, true, true, false, false}}, }, { Query: "select has_ancestor('tag_btwo1', 'HEAD'), has_ancestor('tag_btwo1', @bone2), has_ancestor('tag_btwo1', @onetwo1), has_ancestor('tag_btwo1', @btwo1), has_ancestor('tag_btwo1', @main2), has_ancestor('tag_btwo1', @main1)", - Expected: []sql.Row{{false, false, false, true, false, true}}, + Expected: []sql.UntypedSqlRow{{false, false, false, true, false, true}}, }, { Query: "use `mydb/onetwo`;", }, { Query: "select has_ancestor(commit_hash, 'btwo') from dolt_log where commit_hash = @onetwo1", - Expected: []sql.Row{{true}}, + Expected: []sql.UntypedSqlRow{{true}}, }, }, }, @@ -999,36 +999,36 @@ var DoltScripts = []queries.ScriptTest{ Assertions: []queries.ScriptTestAssertion{ { Query: "select count(*) from t where d is not null", - Expected: []sql.Row{{2}}, + Expected: []sql.UntypedSqlRow{{2}}, }, { Query: "select count(*) from t where d is null", - Expected: []sql.Row{{2}}, + Expected: []sql.UntypedSqlRow{{2}}, }, { // Test the null-safe equals operator Query: "select count(*) from t where d <=> NULL", - Expected: []sql.Row{{2}}, + Expected: []sql.UntypedSqlRow{{2}}, }, { // Test the null-safe equals operator Query: "select count(*) from t where not(d <=> null)", - Expected: []sql.Row{{2}}, + Expected: []sql.UntypedSqlRow{{2}}, }, { // Test an IndexedJoin Query: "select count(ifnull(t.d, 1)) from t, t as t2 where t.d is not null and t.pk = t2.pk and t2.d is not null;", - Expected: []sql.Row{{2}}, + Expected: []sql.UntypedSqlRow{{2}}, }, { // Test an IndexedJoin Query: "select count(ifnull(t.d, 1)) from t, t as t2 where t.d is null and t.pk = t2.pk and t2.d is null;", - Expected: []sql.Row{{2}}, + Expected: []sql.UntypedSqlRow{{2}}, }, { // Test an IndexedJoin Query: "select count(ifnull(t.d, 1)) from t, t as t2 where t.d is null and t.pk = t2.pk and t2.d is not null;", - Expected: []sql.Row{{0}}, + Expected: []sql.UntypedSqlRow{{0}}, }, }, }, @@ -1040,11 +1040,11 @@ var DoltScripts = []queries.ScriptTest{ Assertions: []queries.ScriptTestAssertion{ { Query: "alter table t add index ```i```(c1);", - Expected: []sql.Row{{types.OkResult{}}}, + Expected: []sql.UntypedSqlRow{{types.OkResult{}}}, }, { Query: "show create table t;", - Expected: []sql.Row{{"t", + Expected: []sql.UntypedSqlRow{{"t", "CREATE TABLE `t` (\n" + " `pk` int NOT NULL,\n" + " `c1` int,\n" + @@ -1069,32 +1069,32 @@ var DoltScripts = []queries.ScriptTest{ Assertions: []queries.ScriptTestAssertion{ { Query: "SELECT c1 from indexedTable;", - Expected: []sql.Row{{"two"}}, + Expected: []sql.UntypedSqlRow{{"two"}}, ExpectedIndexes: []string{}, }, { Query: "SELECT c1 from indexedTable where c1 > 'o';", - Expected: []sql.Row{{"two"}}, + Expected: []sql.UntypedSqlRow{{"two"}}, ExpectedIndexes: []string{"c1_idx"}, }, { Query: "SELECT c1 from indexedTable as of @commit2;", - Expected: []sql.Row{{"two"}}, + Expected: []sql.UntypedSqlRow{{"two"}}, ExpectedIndexes: []string{}, }, { Query: "SELECT c1 from indexedTable as of @commit2 where c1 > 'o';", - Expected: []sql.Row{{"two"}}, + Expected: []sql.UntypedSqlRow{{"two"}}, ExpectedIndexes: []string{"c1_idx"}, }, { Query: "SELECT c1 from indexedTable as of @commit1;", - Expected: []sql.Row{{"one"}}, + Expected: []sql.UntypedSqlRow{{"one"}}, ExpectedIndexes: []string{}, }, { Query: "SELECT c1 from indexedTable as of @commit1 where c1 > 'o';", - Expected: []sql.Row{{"one"}}, + Expected: []sql.UntypedSqlRow{{"one"}}, ExpectedIndexes: []string{"c1_idx"}, }, }, @@ -1115,7 +1115,7 @@ var DoltScripts = []queries.ScriptTest{ { Query: "select a1.* from a as of @second_commit a1 " + "left join a as of @first_commit a2 on a1.pk = a2.pk where a2.pk is null order by 1", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {4, 4}, {5, 5}, {6, 6}, @@ -1124,7 +1124,7 @@ var DoltScripts = []queries.ScriptTest{ { Query: "select a1.* from a as of @second_commit a1 " + "left join a as of @second_commit a2 on a1.pk = a2.pk where a2.pk is null order by 1", - Expected: []sql.Row{}, + Expected: []sql.UntypedSqlRow{}, }, }, }, @@ -1141,7 +1141,7 @@ var DoltScripts = []queries.ScriptTest{ Assertions: []queries.ScriptTestAssertion{ { Query: "show create table t1", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {"t1", "CREATE TABLE `t1` (\n" + " `a` int NOT NULL,\n" + " `b` varchar(10) NOT NULL DEFAULT 'abc',\n" + @@ -1153,7 +1153,7 @@ var DoltScripts = []queries.ScriptTest{ }, { Query: "show create table t2", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {"t2", "CREATE TABLE `t2` (\n" + " `c` int NOT NULL,\n" + " `d` varchar(10),\n" + @@ -1174,13 +1174,13 @@ var DoltScripts = []queries.ScriptTest{ Assertions: []queries.ScriptTestAssertion{ { Query: "select count(*) from bigTable;", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {int32(10_000)}, }, }, { Query: "select * from bigTable order by pk limit 5 offset 9990;", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {int64(9990), int64(9990)}, {int64(9991), int64(9991)}, {int64(9992), int64(9992)}, @@ -1195,7 +1195,7 @@ var DoltScripts = []queries.ScriptTest{ Assertions: []queries.ScriptTestAssertion{ { Query: "SHOW CREATE PROCEDURE dolt_checkout;", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ { "dolt_checkout", "", @@ -1224,28 +1224,28 @@ var DoltScripts = []queries.ScriptTest{ Assertions: []queries.ScriptTestAssertion{ { Query: "select * from test as of 'HEAD~' where pk=?;", - Expected: []sql.Row{{0, 0}}, + Expected: []sql.UntypedSqlRow{{0, 0}}, Bindings: map[string]sqlparser.Expr{ "v1": sqlparser.NewIntVal([]byte("0")), }, }, { Query: "select * from test as of hashof('HEAD') where pk=?;", - Expected: []sql.Row{{1, 1, nil}}, + Expected: []sql.UntypedSqlRow{{1, 1, nil}}, Bindings: map[string]sqlparser.Expr{ "v1": sqlparser.NewIntVal([]byte("1")), }, }, { Query: "select * from test as of @Commit1 where pk=?;", - Expected: []sql.Row{{0, 0}}, + Expected: []sql.UntypedSqlRow{{0, 0}}, Bindings: map[string]sqlparser.Expr{ "v1": sqlparser.NewIntVal([]byte("0")), }, }, { Query: "select * from test as of @Commit2 where pk=?;", - Expected: []sql.Row{{0, 0, nil}}, + Expected: []sql.UntypedSqlRow{{0, 0, nil}}, Bindings: map[string]sqlparser.Expr{ "v1": sqlparser.NewIntVal([]byte("0")), }, @@ -1265,7 +1265,7 @@ var DoltScripts = []queries.ScriptTest{ Assertions: []queries.ScriptTestAssertion{ { Query: "SELECT pk, val, message FROM dolt_blame_t", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {"add", 5, "add rows"}, {"alt", 12, "add more rows"}, {"ctl", 3, "add more rows"}, @@ -1279,7 +1279,7 @@ var DoltScripts = []queries.ScriptTest{ { // Test case-insensitive table name Query: "SELECT count(*) FROM dolt_blame_T", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {8}, }, }, @@ -1297,7 +1297,7 @@ var DoltScripts = []queries.ScriptTest{ Assertions: []queries.ScriptTestAssertion{ { Query: "SELECT `p-k`, message FROM `dolt_blame_t-1`;", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {1, "adding table t-1"}, {2, "adding another row to t-1"}, }, @@ -1343,7 +1343,7 @@ var DoltScripts = []queries.ScriptTest{ { Query: "INSERT INTO `users_token` (`id`, `user_id`, `created`, `expires`, `key`, `write_enabled`, `description`) " + "VALUES ('acc2e157db2845a79221cc654b1dcecc', '1056443cc03446c592fa4c06bb06a1a6', '2022-08-30 18:27:21.948487', NULL, '0123456789abcdef0123456789abcdef01234567', 1, '');", - Expected: []sql.Row{{types.OkResult{RowsAffected: 0x1, InsertID: 0x0}}}, + Expected: []sql.UntypedSqlRow{{types.OkResult{RowsAffected: 0x1, InsertID: 0x0}}}, }, }, }, @@ -1357,7 +1357,7 @@ var DoltScripts = []queries.ScriptTest{ Assertions: []queries.ScriptTestAssertion{ { Query: "SELECT type, name, fragment FROM dolt_schemas ORDER BY 1, 2", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {"view", "view1", "CREATE VIEW view1 AS SELECT v1 FROM viewtest"}, {"view", "view2", "CREATE VIEW view2 AS SELECT v2 FROM viewtest"}, }, @@ -1372,7 +1372,7 @@ var DoltScripts = []queries.ScriptTest{ }, { Query: "SELECT type, name, fragment FROM dolt_schemas ORDER BY 1, 2", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {"view", "view2", "CREATE VIEW view2 AS SELECT v2 FROM viewtest"}, }, }, @@ -1382,7 +1382,7 @@ var DoltScripts = []queries.ScriptTest{ }, { Query: "SELECT type, name, fragment FROM dolt_schemas ORDER BY 1, 2", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {"view", "view1", "CREATE VIEW VIEW1 AS SELECT v1 FROM viewtest"}, {"view", "view2", "CREATE VIEW view2 AS SELECT v2 FROM viewtest"}, }, @@ -1404,23 +1404,23 @@ var DoltScripts = []queries.ScriptTest{ Assertions: []queries.ScriptTestAssertion{ { Query: "SELECT (hashof(@Commit1) = hashof(@Commit2))", - Expected: []sql.Row{{false}}, + Expected: []sql.UntypedSqlRow{{false}}, }, { Query: "SELECT (hashof(@Commit1) = hashof('HEAD~1'))", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {true}, }, }, { Query: "SELECT (hashof(@Commit2) = hashof('HEAD'))", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {true}, }, }, { Query: "SELECT (hashof(@Commit2) = hashof('main'))", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {true}, }, }, @@ -1471,21 +1471,21 @@ var DoltUserPrivTests = []queries.UserPrivilegeTest{ User: "root", Host: "localhost", Query: "GRANT SUPER ON *.* TO tester@localhost;", - Expected: []sql.Row{{types.NewOkResult(0)}}, + Expected: []sql.UntypedSqlRow{{types.NewOkResult(0)}}, }, { // Now that tester has SUPER privileges, they can execute dolt_purge_dropped_databases User: "tester", Host: "localhost", Query: "call dolt_purge_dropped_databases;", - Expected: []sql.Row{{0}}, + Expected: []sql.UntypedSqlRow{{0}}, }, { // Since root has SUPER privileges, they can execute dolt_purge_dropped_databases User: "root", Host: "localhost", Query: "call dolt_purge_dropped_databases;", - Expected: []sql.Row{{0}}, + Expected: []sql.UntypedSqlRow{{0}}, }, }, }, @@ -1569,21 +1569,21 @@ var DoltUserPrivTests = []queries.UserPrivilegeTest{ User: "root", Host: "localhost", Query: "GRANT SELECT ON mydb.test TO tester@localhost;", - Expected: []sql.Row{{types.NewOkResult(0)}}, + Expected: []sql.UntypedSqlRow{{types.NewOkResult(0)}}, }, { // After granting access to mydb.test, dolt_diff should work User: "tester", Host: "localhost", Query: "SELECT COUNT(*) FROM dolt_diff('main~', 'main', 'test');", - Expected: []sql.Row{{1}}, + Expected: []sql.UntypedSqlRow{{1}}, }, { // After granting access to mydb.test, dolt_diff with dots should work User: "tester", Host: "localhost", Query: "SELECT COUNT(*) FROM dolt_diff('main~..main', 'test');", - Expected: []sql.Row{{1}}, + Expected: []sql.UntypedSqlRow{{1}}, }, { // With access to the db, but not the table, dolt_diff should fail @@ -1688,7 +1688,7 @@ var DoltUserPrivTests = []queries.UserPrivilegeTest{ User: "root", Host: "localhost", Query: "REVOKE SELECT ON mydb.test from tester@localhost;", - Expected: []sql.Row{{types.NewOkResult(0)}}, + Expected: []sql.UntypedSqlRow{{types.NewOkResult(0)}}, }, { // After revoking access, dolt_diff should fail @@ -1709,77 +1709,77 @@ var DoltUserPrivTests = []queries.UserPrivilegeTest{ User: "root", Host: "localhost", Query: "GRANT SELECT ON mydb.* to tester@localhost;", - Expected: []sql.Row{{types.NewOkResult(0)}}, + Expected: []sql.UntypedSqlRow{{types.NewOkResult(0)}}, }, { // After granting access to the entire db, dolt_diff should work User: "tester", Host: "localhost", Query: "SELECT COUNT(*) FROM dolt_diff('main~', 'main', 'test');", - Expected: []sql.Row{{1}}, + Expected: []sql.UntypedSqlRow{{1}}, }, { // After granting access to the entire db, dolt_diff should work User: "tester", Host: "localhost", Query: "SELECT COUNT(*) FROM dolt_diff('main~..main', 'test');", - Expected: []sql.Row{{1}}, + Expected: []sql.UntypedSqlRow{{1}}, }, { // After granting access to the entire db, dolt_diff_stat should work User: "tester", Host: "localhost", Query: "SELECT COUNT(*) FROM dolt_diff_stat('main~', 'main');", - Expected: []sql.Row{{1}}, + Expected: []sql.UntypedSqlRow{{1}}, }, { // After granting access to the entire db, dolt_diff_stat with dots should work User: "tester", Host: "localhost", Query: "SELECT COUNT(*) FROM dolt_diff_stat('main~...main');", - Expected: []sql.Row{{1}}, + Expected: []sql.UntypedSqlRow{{1}}, }, { // After granting access to the entire db, dolt_diff_summary should work User: "tester", Host: "localhost", Query: "SELECT COUNT(*) FROM dolt_diff_summary('main~', 'main');", - Expected: []sql.Row{{1}}, + Expected: []sql.UntypedSqlRow{{1}}, }, { // After granting access to the entire db, dolt_diff_summary with dots should work User: "tester", Host: "localhost", Query: "SELECT COUNT(*) FROM dolt_diff_summary('main~...main');", - Expected: []sql.Row{{1}}, + Expected: []sql.UntypedSqlRow{{1}}, }, { // After granting access to the entire db, dolt_patch should work User: "tester", Host: "localhost", Query: "SELECT COUNT(*) FROM dolt_patch('main~', 'main');", - Expected: []sql.Row{{1}}, + Expected: []sql.UntypedSqlRow{{1}}, }, { // After granting access to the entire db, dolt_patch with dots should work User: "tester", Host: "localhost", Query: "SELECT COUNT(*) FROM dolt_patch('main~...main');", - Expected: []sql.Row{{1}}, + Expected: []sql.UntypedSqlRow{{1}}, }, { // After granting access to the entire db, dolt_log should work User: "tester", Host: "localhost", Query: "SELECT COUNT(*) FROM dolt_log('main');", - Expected: []sql.Row{{4}}, + Expected: []sql.UntypedSqlRow{{4}}, }, { // Revoke multi-table access User: "root", Host: "localhost", Query: "REVOKE SELECT ON mydb.* from tester@localhost;", - Expected: []sql.Row{{types.NewOkResult(0)}}, + Expected: []sql.UntypedSqlRow{{types.NewOkResult(0)}}, }, { // After revoking access, dolt_diff should fail @@ -1842,28 +1842,28 @@ var DoltUserPrivTests = []queries.UserPrivilegeTest{ User: "root", Host: "localhost", Query: "GRANT SELECT ON *.* to tester@localhost;", - Expected: []sql.Row{{types.NewOkResult(0)}}, + Expected: []sql.UntypedSqlRow{{types.NewOkResult(0)}}, }, { // After granting global access to *.*, dolt_diff should work User: "tester", Host: "localhost", Query: "SELECT COUNT(*) FROM dolt_diff('main~', 'main', 'test');", - Expected: []sql.Row{{1}}, + Expected: []sql.UntypedSqlRow{{1}}, }, { // After granting global access to *.*, dolt_diff should work User: "tester", Host: "localhost", Query: "SELECT COUNT(*) FROM dolt_diff('main~...main', 'test');", - Expected: []sql.Row{{1}}, + Expected: []sql.UntypedSqlRow{{1}}, }, { // Revoke global access User: "root", Host: "localhost", Query: "REVOKE ALL ON *.* from tester@localhost;", - Expected: []sql.Row{{types.NewOkResult(0)}}, + Expected: []sql.UntypedSqlRow{{types.NewOkResult(0)}}, }, { // After revoking global access, dolt_diff should fail @@ -1898,7 +1898,7 @@ var HistorySystemTableScriptTests = []queries.ScriptTest{ Assertions: []queries.ScriptTestAssertion{ { Query: "select count(*) from DOLT_HISTORY_t;", - Expected: []sql.Row{{0}}, + Expected: []sql.UntypedSqlRow{{0}}, }, }, }, @@ -1922,19 +1922,19 @@ var HistorySystemTableScriptTests = []queries.ScriptTest{ Assertions: []queries.ScriptTestAssertion{ { Query: "select count(*) from DOLT_HISTORY_foO1;", - Expected: []sql.Row{{10}}, + Expected: []sql.UntypedSqlRow{{10}}, }, { Query: "select n, de from dolt_history_foo1 where commit_hash=@Commit1;", - Expected: []sql.Row{{1, "Ein"}, {2, "Zwei"}, {3, "Drei"}}, + Expected: []sql.UntypedSqlRow{{1, "Ein"}, {2, "Zwei"}, {3, "Drei"}}, }, { Query: "select n, de from dolt_history_Foo1 where commit_hash=@Commit2;", - Expected: []sql.Row{{1, "Eins"}, {2, "Zwei"}, {3, "Drei"}}, + Expected: []sql.UntypedSqlRow{{1, "Eins"}, {2, "Zwei"}, {3, "Drei"}}, }, { Query: "select n, de from dolt_history_foo1 where commit_hash=@Commit3;", - Expected: []sql.Row{{1, "Eins"}, {2, "Zwei"}, {3, "Drei"}, {4, "Vier"}}, + Expected: []sql.UntypedSqlRow{{1, "Eins"}, {2, "Zwei"}, {3, "Drei"}, {4, "Vier"}}, }, }, }, @@ -1968,27 +1968,27 @@ var HistorySystemTableScriptTests = []queries.ScriptTest{ Assertions: []queries.ScriptTestAssertion{ { Query: "select count(*) from Dolt_History_t1;", - Expected: []sql.Row{{18}}, + Expected: []sql.UntypedSqlRow{{18}}, }, { Query: "select n, de, fr from dolt_history_T1 where commit_hash = @Commit1;", - Expected: []sql.Row{{1, "Eins", nil}, {2, "Zwei", nil}, {3, "Drei", nil}}, + Expected: []sql.UntypedSqlRow{{1, "Eins", nil}, {2, "Zwei", nil}, {3, "Drei", nil}}, }, { Query: "select de, fr from dolt_history_T1 where commit_hash = @Commit1;", - Expected: []sql.Row{{"Eins", nil}, {"Zwei", nil}, {"Drei", nil}}, + Expected: []sql.UntypedSqlRow{{"Eins", nil}, {"Zwei", nil}, {"Drei", nil}}, }, { Query: "select n, de, fr from dolt_history_T1 where commit_hash = @Commit2;", - Expected: []sql.Row{{1, "Eins", nil}, {2, "Zwei", nil}, {3, "Drei", nil}, {4, "Vier", "Quatre"}}, + Expected: []sql.UntypedSqlRow{{1, "Eins", nil}, {2, "Zwei", nil}, {3, "Drei", nil}, {4, "Vier", "Quatre"}}, }, { Query: "select n, de, fr from dolt_history_T1 where commit_hash = @Commit3;", - Expected: []sql.Row{{1, "Eins", "Un"}, {2, "Zwei", "Deux"}, {3, "Drei", nil}, {4, "Vier", "Quatre"}}, + Expected: []sql.UntypedSqlRow{{1, "Eins", "Un"}, {2, "Zwei", "Deux"}, {3, "Drei", nil}, {4, "Vier", "Quatre"}}, }, { Query: "select n, de, fr from dolt_history_T1 where commit_hash = @Commit4;", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {1, "Eins", "Un"}, {2, "Zwei, meine herren", "Deux"}, {3, "Drei, meine herren", nil}, @@ -1997,7 +1997,7 @@ var HistorySystemTableScriptTests = []queries.ScriptTest{ }, { Query: "select n, de, fr from dolt_history_T1 where commit_hash = @Commit5;", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {1, "Eins", "Un"}, {3, "Drei, meine herren", nil}, {4, "Vier, meine herren", "Quatre"}, @@ -2006,7 +2006,7 @@ var HistorySystemTableScriptTests = []queries.ScriptTest{ { Query: "select de, fr, commit_hash=@commit1, commit_hash=@commit2, commit_hash=@commit3, commit_hash=@commit4" + " from dolt_history_T1 where n=2 order by commit_date", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {"Zwei", nil, true, false, false, false}, {"Zwei", nil, false, true, false, false}, {"Zwei", "Deux", false, false, true, false}, @@ -2031,7 +2031,7 @@ var HistorySystemTableScriptTests = []queries.ScriptTest{ Assertions: []queries.ScriptTestAssertion{ { Query: "select pk, c, commit_hash = @Commit1, commit_hash = @Commit2 from dolt_history_t1", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {1, 2, false, true}, {3, 4, false, true}, {5, 6, false, true}, @@ -2042,7 +2042,7 @@ var HistorySystemTableScriptTests = []queries.ScriptTest{ }, { Query: "select pk, c from dolt_history_t1 order by pk", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {1, 2}, {1, 2}, {3, 4}, @@ -2053,7 +2053,7 @@ var HistorySystemTableScriptTests = []queries.ScriptTest{ }, { Query: "select pk, c from dolt_history_t1 order by pk, c", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {1, 2}, {1, 2}, {3, 4}, @@ -2064,20 +2064,20 @@ var HistorySystemTableScriptTests = []queries.ScriptTest{ }, { Query: "select pk, c from dolt_history_t1 where pk = 3", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {3, 4}, {3, 4}, }, }, { Query: "select pk, c from dolt_history_t1 where pk = 3 and commit_hash = @Commit2", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {3, 4}, }, }, { Query: "explain select pk, c from dolt_history_t1 where pk = 3", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {"Filter"}, {" ├─ (dolt_history_t1.pk = 3)"}, {" └─ IndexedTableAccess(dolt_history_t1)"}, @@ -2088,7 +2088,7 @@ var HistorySystemTableScriptTests = []queries.ScriptTest{ }, { Query: "explain select pk, c from dolt_history_t1 where pk = 3 and committer = 'someguy'", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {"Project"}, {" ├─ columns: [dolt_history_t1.pk, dolt_history_t1.c]"}, {" └─ Filter"}, @@ -2121,7 +2121,7 @@ var HistorySystemTableScriptTests = []queries.ScriptTest{ Assertions: []queries.ScriptTestAssertion{ { Query: "select pk, c from dolt_history_t1 order by pk", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {1, 2}, {1, 2}, {1, 2}, @@ -2138,7 +2138,7 @@ var HistorySystemTableScriptTests = []queries.ScriptTest{ }, { Query: "select pk, c from dolt_history_t1 where c = 4 order by pk", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {3, 4}, {3, 4}, {3, 4}, @@ -2146,13 +2146,13 @@ var HistorySystemTableScriptTests = []queries.ScriptTest{ }, { Query: "select pk, c from dolt_history_t1 where c = 10 order by pk", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {9, 10}, }, }, { Query: "explain select pk, c from dolt_history_t1 where c = 4", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {"Filter"}, {" ├─ (dolt_history_t1.c = 4)"}, {" └─ IndexedTableAccess(dolt_history_t1)"}, @@ -2163,7 +2163,7 @@ var HistorySystemTableScriptTests = []queries.ScriptTest{ }, { Query: "explain select pk, c from dolt_history_t1 where c = 10 and committer = 'someguy'", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {"Project"}, {" ├─ columns: [dolt_history_t1.pk, dolt_history_t1.c]"}, {" └─ Filter"}, @@ -2196,7 +2196,7 @@ var HistorySystemTableScriptTests = []queries.ScriptTest{ Assertions: []queries.ScriptTestAssertion{ { Query: "select count(*) from dolt_history_t;", - Expected: []sql.Row{{6}}, + Expected: []sql.UntypedSqlRow{{6}}, }, { // TODO: Instead of just spot checking the non-existence of c1, it would be useful to be able to @@ -2207,15 +2207,15 @@ var HistorySystemTableScriptTests = []queries.ScriptTest{ }, { Query: "select pk, c2 from dolt_history_t where commit_hash=@Commit1 order by pk;", - Expected: []sql.Row{{1, nil}, {4, nil}}, + Expected: []sql.UntypedSqlRow{{1, nil}, {4, nil}}, }, { Query: "select pk, c2 from dolt_history_t where commit_hash=@Commit2 order by pk;", - Expected: []sql.Row{{1, nil}, {4, nil}}, + Expected: []sql.UntypedSqlRow{{1, nil}, {4, nil}}, }, { Query: "select pk, c2 from dolt_history_t where commit_hash=@Commit3 order by pk;", - Expected: []sql.Row{{1, 2}, {4, 5}}, + Expected: []sql.UntypedSqlRow{{1, 2}, {4, 5}}, }, }, }, @@ -2240,16 +2240,16 @@ var HistorySystemTableScriptTests = []queries.ScriptTest{ Assertions: []queries.ScriptTestAssertion{ { Query: "select count(*) from dolt_history_t;", - Expected: []sql.Row{{6}}, + Expected: []sql.UntypedSqlRow{{6}}, }, // Can't represent the old schema in the current one, so it gets nil valued { Query: "select pk, c2 from dolt_history_t where commit_hash=@Commit2 order by pk;", - Expected: []sql.Row{{1, nil}, {4, nil}}, + Expected: []sql.UntypedSqlRow{{1, nil}, {4, nil}}, }, { Query: "select pk, c2 from dolt_history_t where commit_hash=@Commit4 order by pk;", - Expected: []sql.Row{{1, 3}, {4, 6}}, + Expected: []sql.UntypedSqlRow{{1, 3}, {4, 6}}, }, { // When filtering on a column from the original table, we use the primary index here, but if column @@ -2261,7 +2261,7 @@ var HistorySystemTableScriptTests = []queries.ScriptTest{ // we could consider using a different tuple descriptor based on the version of the row and // pull the data out and try to convert it to the new type. Query: "select pk, c1, c2 from dolt_history_t where pk=4;", - Expected: []sql.Row{{4, 5, 6}, {4, 5, nil}, {4, 5, nil}}, + Expected: []sql.UntypedSqlRow{{4, 5, 6}, {4, 5, nil}, {4, 5, nil}}, ExpectedWarning: 1246, ExpectedWarningsCount: 1, ExpectedWarningMessageSubstring: "Unable to convert field c2 in historical rows because " + @@ -2291,11 +2291,11 @@ var HistorySystemTableScriptTests = []queries.ScriptTest{ }, { Query: "select count(*) from dolt_history_T2;", - Expected: []sql.Row{{2}}, + Expected: []sql.UntypedSqlRow{{2}}, }, { Query: "select pk, c1, c2 from dolt_history_t2 where commit_hash != @Commit1;", - Expected: []sql.Row{{1, 2, "3"}, {4, 5, "6"}}, + Expected: []sql.UntypedSqlRow{{1, 2, "3"}, {4, 5, "6"}}, }, }, }, @@ -2327,7 +2327,7 @@ var HistorySystemTableScriptTests = []queries.ScriptTest{ // to use something like an iterator approach where it goes back sequentially until it detects // the current table doesn't exist any more and then stop. Query: "select count(*) from dolt_history_t;", - Expected: []sql.Row{{2}}, + Expected: []sql.UntypedSqlRow{{2}}, }, }, }, @@ -2345,15 +2345,15 @@ var HistorySystemTableScriptTests = []queries.ScriptTest{ Assertions: []queries.ScriptTestAssertion{ { Query: "select count(*) from dolt_history_t;", - Expected: []sql.Row{{6}}, // 2 + 4 + Expected: []sql.UntypedSqlRow{{6}}, // 2 + 4 }, { Query: "select count(*) from dolt_history_t AS OF 'head^';", - Expected: []sql.Row{{2}}, // 2 + Expected: []sql.UntypedSqlRow{{2}}, // 2 }, { Query: "select message from dolt_log;", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {"added values again"}, {"added values"}, {"creating table t"}, @@ -2378,7 +2378,7 @@ var HistorySystemTableScriptTests = []queries.ScriptTest{ Assertions: []queries.ScriptTestAssertion{ { Query: "select message from dolt_log AS OF 'head^';", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {"added values"}, {"creating table t"}, {"checkpoint enginetest database mydb"}, @@ -2399,7 +2399,7 @@ var HistorySystemTableScriptTests = []queries.ScriptTest{ Assertions: []queries.ScriptTestAssertion{ { Query: "select c1 from dolt_history_t;", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {"foo"}, }, }, @@ -2421,7 +2421,7 @@ var HistorySystemTableScriptTests = []queries.ScriptTest{ Assertions: []queries.ScriptTestAssertion{ { Query: "select count(x) from dolt_history_yx where x = 1;", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {3}, }, }, @@ -2443,7 +2443,7 @@ var HistorySystemTableScriptTests = []queries.ScriptTest{ Assertions: []queries.ScriptTestAssertion{ { Query: "select count(*) from dolt_history_xy where commit_hash = (select dolt_log.commit_hash from dolt_log limit 1 offset 1)", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {2}, }, }, @@ -2481,7 +2481,7 @@ ORDER BY dolt_history_xyz.x, dolt_history_xyz.y, dolt_history_xyz.z;`, - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {0, 1, 100, doltCommit}, {0, 1, 100, doltCommit}, {0, 1, 100, doltCommit}, @@ -2505,7 +2505,7 @@ FROM ORDER BY dolt_history_xyz.y, dolt_history_xyz.z;`, - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {1, 100, doltCommit}, {1, 100, doltCommit}, {1, 100, doltCommit}, @@ -2527,7 +2527,7 @@ FROM dolt_history_xyz.commit_hash = dolt_commits.commit_hash ORDER BY dolt_history_xyz.z;`, - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {100, doltCommit}, {100, doltCommit}, {100, doltCommit}, @@ -2546,7 +2546,7 @@ WHERE z IN ( LEFT JOIN dolt_commits ON dolt_history_xyz.commit_hash = dolt_commits.commit_hash );`, - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {100}, {200}, {300}, @@ -2560,25 +2560,25 @@ WHERE z IN ( Assertions: []queries.ScriptTestAssertion{ { Query: "select 'something' from dolt_log order by commit_hash;", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {"something"}, {"something"}, }, }, { Query: "select 'something' from dolt_diff order by commit_hash;", - Expected: []sql.Row{}, + Expected: []sql.UntypedSqlRow{}, }, { Query: "select 'something' from dolt_commits order by commit_hash;", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {"something"}, {"something"}, }, }, { Query: "select 'something' from dolt_commit_ancestors order by commit_hash;", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {"something"}, {"something"}, }, @@ -2604,7 +2604,7 @@ var BrokenHistorySystemTableScriptTests = []queries.ScriptTest{ Assertions: []queries.ScriptTestAssertion{ { Query: "select message from dolt_log AS OF 'head^';", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {"added values"}, {"creating table t"}, {"checkpoint enginetest database mydb"}, @@ -2636,11 +2636,11 @@ var DoltCheckoutScripts = []queries.ScriptTest{ Assertions: []queries.ScriptTestAssertion{ { Query: "select active_branch();", - Expected: []sql.Row{{"main"}}, + Expected: []sql.UntypedSqlRow{{"main"}}, }, { Query: "select * from t;", - Expected: []sql.Row{{1, 1}}, + Expected: []sql.UntypedSqlRow{{1, 1}}, }, { Query: "call dolt_checkout('b2');", @@ -2648,11 +2648,11 @@ var DoltCheckoutScripts = []queries.ScriptTest{ }, { Query: "select active_branch();", - Expected: []sql.Row{{"b2"}}, + Expected: []sql.UntypedSqlRow{{"b2"}}, }, { Query: "select * from t;", - Expected: []sql.Row{{2, 2}}, + Expected: []sql.UntypedSqlRow{{2, 2}}, }, { Query: "call dolt_checkout('b3');", @@ -2660,11 +2660,11 @@ var DoltCheckoutScripts = []queries.ScriptTest{ }, { Query: "select active_branch();", - Expected: []sql.Row{{"b3"}}, + Expected: []sql.UntypedSqlRow{{"b3"}}, }, { Query: "select * from t;", - Expected: []sql.Row{{3, 3}}, + Expected: []sql.UntypedSqlRow{{3, 3}}, }, { Query: "call dolt_checkout('main');", @@ -2672,11 +2672,11 @@ var DoltCheckoutScripts = []queries.ScriptTest{ }, { Query: "select active_branch();", - Expected: []sql.Row{{"main"}}, + Expected: []sql.UntypedSqlRow{{"main"}}, }, { Query: "select * from t;", - Expected: []sql.Row{{1, 1}}, + Expected: []sql.UntypedSqlRow{{1, 1}}, }, }, }, @@ -2693,7 +2693,7 @@ var DoltCheckoutScripts = []queries.ScriptTest{ Assertions: []queries.ScriptTestAssertion{ { Query: "select active_branch();", - Expected: []sql.Row{{"b2"}}, + Expected: []sql.UntypedSqlRow{{"b2"}}, }, { Query: "call dolt_checkout('main');", @@ -2701,7 +2701,7 @@ var DoltCheckoutScripts = []queries.ScriptTest{ }, { Query: "select * from t;", - Expected: []sql.Row{{1, 1}}, + Expected: []sql.UntypedSqlRow{{1, 1}}, }, { Query: "call dolt_checkout('b2');", @@ -2709,11 +2709,11 @@ var DoltCheckoutScripts = []queries.ScriptTest{ }, { Query: "select active_branch();", - Expected: []sql.Row{{"b2"}}, + Expected: []sql.UntypedSqlRow{{"b2"}}, }, { Query: "select * from t order by 1;", - Expected: []sql.Row{{1, 1}, {2, 2}}, + Expected: []sql.UntypedSqlRow{{1, 1}, {2, 2}}, }, }, }, @@ -2736,11 +2736,11 @@ var DoltCheckoutScripts = []queries.ScriptTest{ }, { Query: "select active_branch();", - Expected: []sql.Row{{"testbr"}}, + Expected: []sql.UntypedSqlRow{{"testbr"}}, }, { Query: "select * from t order by s;", - Expected: []sql.Row{{"foo"}}, + Expected: []sql.UntypedSqlRow{{"foo"}}, }, { Query: "call dolt_checkout('main');", @@ -2748,11 +2748,11 @@ var DoltCheckoutScripts = []queries.ScriptTest{ }, { Query: "select active_branch();", - Expected: []sql.Row{{"main"}}, + Expected: []sql.UntypedSqlRow{{"main"}}, }, { Query: "select * from t order by s;", - Expected: []sql.Row{{"bar"}, {"baz"}, {"foo"}}, + Expected: []sql.UntypedSqlRow{{"bar"}, {"baz"}, {"foo"}}, }, { Query: "call dolt_checkout('-B', 'testbr', 'main~1');", @@ -2760,11 +2760,11 @@ var DoltCheckoutScripts = []queries.ScriptTest{ }, { Query: "select active_branch();", - Expected: []sql.Row{{"testbr"}}, + Expected: []sql.UntypedSqlRow{{"testbr"}}, }, { Query: "select * from t order by s;", - Expected: []sql.Row{{"bar"}, {"foo"}}, + Expected: []sql.UntypedSqlRow{{"bar"}, {"foo"}}, }, }, }, @@ -2784,11 +2784,11 @@ var DoltCheckoutScripts = []queries.ScriptTest{ Assertions: []queries.ScriptTestAssertion{ { Query: "select active_branch();", - Expected: []sql.Row{{"testbr"}}, + Expected: []sql.UntypedSqlRow{{"testbr"}}, }, { Query: "select * from t order by s;", - Expected: []sql.Row{{"bar"}, {"foo"}, {"qux"}}, // Dirty working set + Expected: []sql.UntypedSqlRow{{"bar"}, {"foo"}, {"qux"}}, // Dirty working set }, { Query: "call dolt_checkout('main');", @@ -2796,7 +2796,7 @@ var DoltCheckoutScripts = []queries.ScriptTest{ }, { Query: "select * from t order by s;", - Expected: []sql.Row{{"bar"}, {"baz"}, {"foo"}}, + Expected: []sql.UntypedSqlRow{{"bar"}, {"baz"}, {"foo"}}, }, { Query: "call dolt_checkout('-B', 'testbr', 'main~1');", @@ -2804,11 +2804,11 @@ var DoltCheckoutScripts = []queries.ScriptTest{ }, { Query: "select active_branch();", - Expected: []sql.Row{{"testbr"}}, + Expected: []sql.UntypedSqlRow{{"testbr"}}, }, { Query: "select * from t order by s;", - Expected: []sql.Row{{"bar"}, {"foo"}}, // Dirty working set was forcefully overwritten + Expected: []sql.UntypedSqlRow{{"bar"}, {"foo"}}, // Dirty working set was forcefully overwritten }, }, }, @@ -2832,11 +2832,11 @@ var DoltCheckoutScripts = []queries.ScriptTest{ Assertions: []queries.ScriptTestAssertion{ { Query: "select active_branch();", - Expected: []sql.Row{{"main"}}, + Expected: []sql.UntypedSqlRow{{"main"}}, }, { Query: "select * from t;", - Expected: []sql.Row{{1, 1}}, + Expected: []sql.UntypedSqlRow{{1, 1}}, }, { Query: "use `mydb/b2`;", @@ -2844,11 +2844,11 @@ var DoltCheckoutScripts = []queries.ScriptTest{ }, { Query: "select active_branch();", - Expected: []sql.Row{{"b2"}}, + Expected: []sql.UntypedSqlRow{{"b2"}}, }, { Query: "select * from t;", - Expected: []sql.Row{{2, 2}}, + Expected: []sql.UntypedSqlRow{{2, 2}}, }, { Query: "use `mydb/b3`;", @@ -2856,11 +2856,11 @@ var DoltCheckoutScripts = []queries.ScriptTest{ }, { Query: "select active_branch();", - Expected: []sql.Row{{"b3"}}, + Expected: []sql.UntypedSqlRow{{"b3"}}, }, { Query: "select * from t;", - Expected: []sql.Row{{3, 3}}, + Expected: []sql.UntypedSqlRow{{3, 3}}, }, { Query: "use `mydb/main`", @@ -2868,11 +2868,11 @@ var DoltCheckoutScripts = []queries.ScriptTest{ }, { Query: "select active_branch();", - Expected: []sql.Row{{"main"}}, + Expected: []sql.UntypedSqlRow{{"main"}}, }, { Query: "select * from t;", - Expected: []sql.Row{{1, 1}}, + Expected: []sql.UntypedSqlRow{{1, 1}}, }, { Query: "use `mydb`", @@ -2880,11 +2880,11 @@ var DoltCheckoutScripts = []queries.ScriptTest{ }, { Query: "select active_branch();", - Expected: []sql.Row{{"main"}}, + Expected: []sql.UntypedSqlRow{{"main"}}, }, { Query: "select * from t;", - Expected: []sql.Row{{1, 1}}, + Expected: []sql.UntypedSqlRow{{1, 1}}, }, { Query: "call dolt_checkout('b2');", @@ -2896,7 +2896,7 @@ var DoltCheckoutScripts = []queries.ScriptTest{ }, { Query: "select active_branch();", - Expected: []sql.Row{{"b3"}}, + Expected: []sql.UntypedSqlRow{{"b3"}}, }, // Since b2 was the last branch checked out with dolt_checkout, it's what mydb resolves to { @@ -2905,11 +2905,11 @@ var DoltCheckoutScripts = []queries.ScriptTest{ }, { Query: "select active_branch();", - Expected: []sql.Row{{"b2"}}, + Expected: []sql.UntypedSqlRow{{"b2"}}, }, { Query: "select * from t;", - Expected: []sql.Row{{2, 2}}, + Expected: []sql.UntypedSqlRow{{2, 2}}, }, }, }, @@ -2933,11 +2933,11 @@ var DoltCheckoutScripts = []queries.ScriptTest{ Assertions: []queries.ScriptTestAssertion{ { Query: "select active_branch();", - Expected: []sql.Row{{"main"}}, + Expected: []sql.UntypedSqlRow{{"main"}}, }, { Query: "select * from t;", - Expected: []sql.Row{{1, 1}}, + Expected: []sql.UntypedSqlRow{{1, 1}}, }, { Query: "use `mydb/b2`;", @@ -2945,15 +2945,15 @@ var DoltCheckoutScripts = []queries.ScriptTest{ }, { Query: "select active_branch();", - Expected: []sql.Row{{"b2"}}, + Expected: []sql.UntypedSqlRow{{"b2"}}, }, { Query: "select * from t;", - Expected: []sql.Row{{2, 2}}, + Expected: []sql.UntypedSqlRow{{2, 2}}, }, { Query: "select * from mydb.t;", - Expected: []sql.Row{{1, 1}}, + Expected: []sql.UntypedSqlRow{{1, 1}}, }, { Query: "use `mydb/b3`;", @@ -2961,19 +2961,19 @@ var DoltCheckoutScripts = []queries.ScriptTest{ }, { Query: "select active_branch();", - Expected: []sql.Row{{"b3"}}, + Expected: []sql.UntypedSqlRow{{"b3"}}, }, { Query: "select * from t;", - Expected: []sql.Row{{3, 3}}, + Expected: []sql.UntypedSqlRow{{3, 3}}, }, { Query: "select * from mydb.t;", - Expected: []sql.Row{{1, 1}}, + Expected: []sql.UntypedSqlRow{{1, 1}}, }, { Query: "select * from `mydb/b2`.t;", - Expected: []sql.Row{{2, 2}}, + Expected: []sql.UntypedSqlRow{{2, 2}}, }, { Query: "use `mydb/main`", @@ -2981,19 +2981,19 @@ var DoltCheckoutScripts = []queries.ScriptTest{ }, { Query: "select active_branch();", - Expected: []sql.Row{{"main"}}, + Expected: []sql.UntypedSqlRow{{"main"}}, }, { Query: "select * from t;", - Expected: []sql.Row{{1, 1}}, + Expected: []sql.UntypedSqlRow{{1, 1}}, }, { Query: "select * from mydb.t;", - Expected: []sql.Row{{1, 1}}, + Expected: []sql.UntypedSqlRow{{1, 1}}, }, { Query: "select * from `mydb/b3`.t;", - Expected: []sql.Row{{3, 3}}, + Expected: []sql.UntypedSqlRow{{3, 3}}, }, { Query: "use `mydb`", @@ -3001,15 +3001,15 @@ var DoltCheckoutScripts = []queries.ScriptTest{ }, { Query: "select active_branch();", - Expected: []sql.Row{{"main"}}, + Expected: []sql.UntypedSqlRow{{"main"}}, }, { Query: "select * from t;", - Expected: []sql.Row{{1, 1}}, + Expected: []sql.UntypedSqlRow{{1, 1}}, }, { Query: "select * from `mydb/main`.t;", - Expected: []sql.Row{{1, 1}}, + Expected: []sql.UntypedSqlRow{{1, 1}}, }, { Query: "call dolt_checkout('b2');", @@ -3021,12 +3021,12 @@ var DoltCheckoutScripts = []queries.ScriptTest{ }, { Query: "select active_branch();", - Expected: []sql.Row{{"b3"}}, + Expected: []sql.UntypedSqlRow{{"b3"}}, }, // Since b2 was the last branch checked out with dolt_checkout, it's what mydb resolves to { Query: "select * from `mydb`.t;", - Expected: []sql.Row{{2, 2}}, + Expected: []sql.UntypedSqlRow{{2, 2}}, }, { Query: "use `mydb`", @@ -3034,11 +3034,11 @@ var DoltCheckoutScripts = []queries.ScriptTest{ }, { Query: "select active_branch();", - Expected: []sql.Row{{"b2"}}, + Expected: []sql.UntypedSqlRow{{"b2"}}, }, { Query: "select * from t;", - Expected: []sql.Row{{2, 2}}, + Expected: []sql.UntypedSqlRow{{2, 2}}, }, }, }, @@ -3066,7 +3066,7 @@ var DoltCheckoutScripts = []queries.ScriptTest{ }, { Query: "select active_branch();", - Expected: []sql.Row{{"b2"}}, + Expected: []sql.UntypedSqlRow{{"b2"}}, }, { @@ -3075,23 +3075,23 @@ var DoltCheckoutScripts = []queries.ScriptTest{ }, { Query: "select active_branch();", - Expected: []sql.Row{{"main"}}, + Expected: []sql.UntypedSqlRow{{"main"}}, }, { Query: "insert into t values (4, 4);", - Expected: []sql.Row{{types.OkResult{RowsAffected: 1}}}, + Expected: []sql.UntypedSqlRow{{types.OkResult{RowsAffected: 1}}}, }, { Query: "select * from t order by 1;", - Expected: []sql.Row{{1, 1}, {4, 4}}, + Expected: []sql.UntypedSqlRow{{1, 1}, {4, 4}}, }, { Query: "select * from `mydb/main`.t order by 1;", - Expected: []sql.Row{{1, 1}, {4, 4}}, + Expected: []sql.UntypedSqlRow{{1, 1}, {4, 4}}, }, { Query: "select * from `mydb/b2`.t order by 1;", - Expected: []sql.Row{{2, 2}}, + Expected: []sql.UntypedSqlRow{{2, 2}}, }, }, }, @@ -3117,19 +3117,19 @@ var DoltCheckoutScripts = []queries.ScriptTest{ Assertions: []queries.ScriptTestAssertion{ { Query: "select active_branch();", - Expected: []sql.Row{{"main"}}, + Expected: []sql.UntypedSqlRow{{"main"}}, }, { Query: "insert into t values (4, 4);", - Expected: []sql.Row{{types.OkResult{RowsAffected: 1}}}, + Expected: []sql.UntypedSqlRow{{types.OkResult{RowsAffected: 1}}}, }, { Query: "select * from t order by 1;", - Expected: []sql.Row{{1, 1}, {4, 4}}, + Expected: []sql.UntypedSqlRow{{1, 1}, {4, 4}}, }, { Query: "select * from `mydb/main`.t order by 1;", - Expected: []sql.Row{{1, 1}, {4, 4}}, + Expected: []sql.UntypedSqlRow{{1, 1}, {4, 4}}, }, { Query: "select * from `mydb/b2`.t order by 1;", @@ -3149,7 +3149,7 @@ var DoltCheckoutScripts = []queries.ScriptTest{ Assertions: []queries.ScriptTestAssertion{ { Query: "use mydb/b1", - Expected: []sql.Row{}, + Expected: []sql.UntypedSqlRow{}, }, { Query: "use mydb/b2", @@ -3157,7 +3157,7 @@ var DoltCheckoutScripts = []queries.ScriptTest{ }, { Query: "use mydb/tag1", - Expected: []sql.Row{}, + Expected: []sql.UntypedSqlRow{}, }, { Query: "use mydb/tag2", @@ -3200,137 +3200,137 @@ var DoltCheckoutScripts = []queries.ScriptTest{ Assertions: []queries.ScriptTestAssertion{ { Query: "call dolt_checkout('HEAD~', '--', 't1')", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {0, ""}, }, }, { Query: "select * from t1 order by 1", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {1, 1}, }, }, { Query: "select * from t2 order by 1", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {2, 2}, {4, 4}, }, }, { Query: "select * from dolt_status", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {"t1", true, "modified"}, }, }, { Query: "call dolt_reset('--hard')", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {0}, }, }, { Query: "call dolt_checkout('HEAD~', '--', 't2')", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {0, ""}, }, }, { Query: "select * from t1 order by 1", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {1, 1}, {3, 3}, }, }, { Query: "select * from t2 order by 1", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {2, 2}, }, }, { Query: "select * from dolt_status", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {"t2", true, "modified"}, }, }, { Query: "call dolt_reset('--hard')", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {0}, }, }, { Query: "call dolt_checkout('b1', 't2', 't1')", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {0, ""}, }, }, { Query: "select * from t1 order by 1", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {1, 1}, }, }, { Query: "select * from t2 order by 1", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {2, 2}, }, }, { Query: "call dolt_reset('--hard')", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {0}, }, }, { Query: "call dolt_checkout('tag1', '.')", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {0, ""}, }, }, { Query: "select * from t1 order by 1", - Expected: []sql.Row{}, + Expected: []sql.UntypedSqlRow{}, }, { Query: "select * from t2 order by 1", - Expected: []sql.Row{}, + Expected: []sql.UntypedSqlRow{}, }, { Query: "select * from dolt_status", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {"t1", true, "modified"}, {"t2", true, "modified"}, }, }, { Query: "call dolt_reset('--hard')", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {0}, }, }, { Query: "SET @commit1 = (select commit_hash from dolt_log order by date desc limit 1);", - Expected: []sql.Row{{}}, + Expected: []sql.UntypedSqlRow{{}}, }, { Query: "call dolt_checkout(@commit1, 't1')", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {0, ""}, }, }, { Query: "select * from t1 order by 1", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {1, 1}, {3, 3}, }, }, { Query: "call dolt_reset('--hard')", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {0}, }, }, @@ -3386,11 +3386,11 @@ var DoltInfoSchemaScripts = []queries.ScriptTest{ Assertions: []queries.ScriptTestAssertion{ { Query: "select active_branch();", - Expected: []sql.Row{{"main"}}, + Expected: []sql.UntypedSqlRow{{"main"}}, }, { Query: "select column_name from information_schema.columns where table_schema = 'mydb' and table_name = 't' order by 1;", - Expected: []sql.Row{{"a"}, {"b"}}, + Expected: []sql.UntypedSqlRow{{"a"}, {"b"}}, }, { Query: "call dolt_checkout('b2');", @@ -3398,11 +3398,11 @@ var DoltInfoSchemaScripts = []queries.ScriptTest{ }, { Query: "select active_branch();", - Expected: []sql.Row{{"b2"}}, + Expected: []sql.UntypedSqlRow{{"b2"}}, }, { Query: "select column_name from information_schema.columns where table_schema = 'mydb' and table_name = 't' order by 1;", - Expected: []sql.Row{{"a"}, {"b"}, {"c"}}, + Expected: []sql.UntypedSqlRow{{"a"}, {"b"}, {"c"}}, }, { Query: "call dolt_checkout('b3');", @@ -3410,11 +3410,11 @@ var DoltInfoSchemaScripts = []queries.ScriptTest{ }, { Query: "select active_branch();", - Expected: []sql.Row{{"b3"}}, + Expected: []sql.UntypedSqlRow{{"b3"}}, }, { Query: "select column_name from information_schema.columns where table_schema = 'mydb' and table_name = 't' order by 1;", - Expected: []sql.Row{{"a"}, {"b"}, {"d"}}, + Expected: []sql.UntypedSqlRow{{"a"}, {"b"}, {"d"}}, }, }, }, @@ -3432,11 +3432,11 @@ var DoltInfoSchemaScripts = []queries.ScriptTest{ Assertions: []queries.ScriptTestAssertion{ { Query: "select active_branch();", - Expected: []sql.Row{{"main"}}, + Expected: []sql.UntypedSqlRow{{"main"}}, }, { Query: "/* main */ select column_name from information_schema.columns where table_schema = 'mydb' and table_name = 't' order by 1;", - Expected: []sql.Row{{"a"}, {"b"}}, + Expected: []sql.UntypedSqlRow{{"a"}, {"b"}}, }, { Query: "use mydb/b2;", @@ -3444,15 +3444,15 @@ var DoltInfoSchemaScripts = []queries.ScriptTest{ }, { Query: "select active_branch();", - Expected: []sql.Row{{"b2"}}, + Expected: []sql.UntypedSqlRow{{"b2"}}, }, { Query: "/* b2 */ select column_name from information_schema.columns where table_schema = 'mydb' and table_name = 't' order by 1;", - Expected: []sql.Row{{"a"}, {"b"}}, + Expected: []sql.UntypedSqlRow{{"a"}, {"b"}}, }, { Query: "select column_name from information_schema.columns where table_schema = 'mydb/b2' and table_name = 't' order by 1;", - Expected: []sql.Row{{"a"}, {"b"}, {"c"}}, + Expected: []sql.UntypedSqlRow{{"a"}, {"b"}, {"c"}}, }, { Query: "use mydb/b3;", @@ -3460,15 +3460,15 @@ var DoltInfoSchemaScripts = []queries.ScriptTest{ }, { Query: "select active_branch();", - Expected: []sql.Row{{"b3"}}, + Expected: []sql.UntypedSqlRow{{"b3"}}, }, { Query: "/* b3 */ select column_name from information_schema.columns where table_schema = 'mydb' and table_name = 't' order by 1;", - Expected: []sql.Row{{"a"}, {"b"}}, + Expected: []sql.UntypedSqlRow{{"a"}, {"b"}}, }, { Query: "select column_name from information_schema.columns where table_schema = 'mydb/b3' and table_name = 't' order by 1;", - Expected: []sql.Row{{"a"}, {"b"}, {"d"}}, + Expected: []sql.UntypedSqlRow{{"a"}, {"b"}, {"d"}}, }, }, }, @@ -3487,11 +3487,11 @@ var DoltInfoSchemaScripts = []queries.ScriptTest{ Assertions: []queries.ScriptTestAssertion{ { Query: "select active_branch();", - Expected: []sql.Row{{"main"}}, + Expected: []sql.UntypedSqlRow{{"main"}}, }, { Query: "/* main */ select column_name from information_schema.columns where table_schema = 'mydb' and table_name = 't' order by 1;", - Expected: []sql.Row{{"a"}, {"b"}}, + Expected: []sql.UntypedSqlRow{{"a"}, {"b"}}, }, { Query: "use mydb/b2;", @@ -3499,19 +3499,19 @@ var DoltInfoSchemaScripts = []queries.ScriptTest{ }, { Query: "select active_branch();", - Expected: []sql.Row{{"b2"}}, + Expected: []sql.UntypedSqlRow{{"b2"}}, }, { Query: "/* b2 */ select column_name from information_schema.columns where table_schema = 'mydb' and table_name = 't' order by 1;", - Expected: []sql.Row{{"a"}, {"b"}}, + Expected: []sql.UntypedSqlRow{{"a"}, {"b"}}, }, { Query: "select column_name from information_schema.columns where table_schema = 'mydb/b2' and table_name = 't' order by 1;", - Expected: []sql.Row{{"a"}, {"b"}, {"c"}}, + Expected: []sql.UntypedSqlRow{{"a"}, {"b"}, {"c"}}, }, { Query: "select count(*) from information_schema.columns where table_schema = 'mydb/b3' and table_name = 't' order by 1;", - Expected: []sql.Row{{0}}, + Expected: []sql.UntypedSqlRow{{0}}, }, }, }, @@ -3535,11 +3535,11 @@ var DoltInfoSchemaScripts = []queries.ScriptTest{ Assertions: []queries.ScriptTestAssertion{ { Query: "select active_branch();", - Expected: []sql.Row{{"main"}}, + Expected: []sql.UntypedSqlRow{{"main"}}, }, { Query: "select column_name from information_schema.columns where table_schema = 'mydb' and table_name = 't' order by 1;", - Expected: []sql.Row{{"a"}, {"b"}}, + Expected: []sql.UntypedSqlRow{{"a"}, {"b"}}, }, { Query: "use mydb/t2;", @@ -3547,11 +3547,11 @@ var DoltInfoSchemaScripts = []queries.ScriptTest{ }, { Query: "select active_branch();", - Expected: []sql.Row{{nil}}, + Expected: []sql.UntypedSqlRow{{nil}}, }, { Query: "select column_name from information_schema.columns where table_schema = 'mydb/t2' and table_name = 't' order by 1;", - Expected: []sql.Row{{"a"}, {"b"}, {"c"}}, + Expected: []sql.UntypedSqlRow{{"a"}, {"b"}, {"c"}}, }, { Query: "use mydb/t3;", @@ -3559,11 +3559,11 @@ var DoltInfoSchemaScripts = []queries.ScriptTest{ }, { Query: "select active_branch();", - Expected: []sql.Row{{nil}}, + Expected: []sql.UntypedSqlRow{{nil}}, }, { Query: "select column_name from information_schema.columns where table_schema = 'mydb/t3' and table_name = 't' order by 1;", - Expected: []sql.Row{{"a"}, {"b"}, {"d"}}, + Expected: []sql.UntypedSqlRow{{"a"}, {"b"}, {"d"}}, }, }, }, @@ -3575,11 +3575,11 @@ var DoltBranchScripts = []queries.ScriptTest{ Assertions: []queries.ScriptTestAssertion{ { Query: "CALL DOLT_BRANCH('myNewBranch1')", - Expected: []sql.Row{{0}}, + Expected: []sql.UntypedSqlRow{{0}}, }, { Query: "SELECT COUNT(*) FROM DOLT_BRANCHES WHERE NAME='myNewBranch1';", - Expected: []sql.Row{{1}}, + Expected: []sql.UntypedSqlRow{{1}}, }, { // Trying to recreate that branch fails without the force flag @@ -3588,7 +3588,7 @@ var DoltBranchScripts = []queries.ScriptTest{ }, { Query: "CALL DOLT_BRANCH('-f', 'myNewBranch1')", - Expected: []sql.Row{{0}}, + Expected: []sql.UntypedSqlRow{{0}}, }, }, }, @@ -3609,11 +3609,11 @@ var DoltBranchScripts = []queries.ScriptTest{ Assertions: []queries.ScriptTestAssertion{ { Query: "CALL DOLT_BRANCH('myNewBranch1')", - Expected: []sql.Row{{0}}, + Expected: []sql.UntypedSqlRow{{0}}, }, { Query: "CALL DOLT_BRANCH('myNewBranch2')", - Expected: []sql.Row{{0}}, + Expected: []sql.UntypedSqlRow{{0}}, }, { // Renaming to an existing name fails without the force flag @@ -3622,11 +3622,11 @@ var DoltBranchScripts = []queries.ScriptTest{ }, { Query: "CALL DOLT_BRANCH('-mf', 'myNewBranch1', 'myNewBranch2')", - Expected: []sql.Row{{0}}, + Expected: []sql.UntypedSqlRow{{0}}, }, { Query: "CALL DOLT_BRANCH('-m', 'myNewBranch2', 'myNewBranch3')", - Expected: []sql.Row{{0}}, + Expected: []sql.UntypedSqlRow{{0}}, }, { Query: "CALL DOLT_BRANCH('-m', 'myNewBranch3', 'HEAD')", @@ -3658,11 +3658,11 @@ var DoltBranchScripts = []queries.ScriptTest{ }, { Query: "CALL DOLT_BRANCH('-c', 'myNewBranch1', 'myNewBranch2')", - Expected: []sql.Row{{0}}, + Expected: []sql.UntypedSqlRow{{0}}, }, { Query: "SELECT COUNT(*) FROM DOLT_BRANCHES WHERE NAME='myNewBranch2';", - Expected: []sql.Row{{1}}, + Expected: []sql.UntypedSqlRow{{1}}, }, { Query: "CALL DOLT_BRANCH('-c', 'myNewBranch1', 'myNewBranch2')", @@ -3670,7 +3670,7 @@ var DoltBranchScripts = []queries.ScriptTest{ }, { Query: "CALL DOLT_BRANCH('-cf', 'myNewBranch1', 'myNewBranch2')", - Expected: []sql.Row{{0}}, + Expected: []sql.UntypedSqlRow{{0}}, }, { Query: "CALL DOLT_BRANCH('-c', 'myNewBranch1', 'HEAD')", @@ -3704,15 +3704,15 @@ var DoltBranchScripts = []queries.ScriptTest{ }, { Query: "CALL DOLT_BRANCH('-d', 'myNewBranch1')", - Expected: []sql.Row{{0}}, + Expected: []sql.UntypedSqlRow{{0}}, }, { Query: "SELECT COUNT(*) FROM DOLT_BRANCHES WHERE NAME='myNewBranch1'", - Expected: []sql.Row{{0}}, + Expected: []sql.UntypedSqlRow{{0}}, }, { Query: "CALL DOLT_BRANCH('-d', 'myNewBranch2', 'myNewBranch3')", - Expected: []sql.Row{{0}}, + Expected: []sql.UntypedSqlRow{{0}}, }, { // Trying to delete a branch with unpushed changes fails without force option @@ -3721,7 +3721,7 @@ var DoltBranchScripts = []queries.ScriptTest{ }, { Query: "CALL DOLT_BRANCH('-df', 'myNewBranchWithCommit')", - Expected: []sql.Row{{0}}, + Expected: []sql.UntypedSqlRow{{0}}, }, }, }, @@ -3736,23 +3736,23 @@ var DoltBranchScripts = []queries.ScriptTest{ Assertions: []queries.ScriptTestAssertion{ { Query: "show tables", - Expected: []sql.Row{{"a"}}, + Expected: []sql.UntypedSqlRow{{"a"}}, }, { Query: "CALL DOLT_CHECKOUT('-b', 'newBranch', 'head~1')", - Expected: []sql.Row{{0, "Switched to branch 'newBranch'"}}, + Expected: []sql.UntypedSqlRow{{0, "Switched to branch 'newBranch'"}}, }, { Query: "show tables", - Expected: []sql.Row{}, + Expected: []sql.UntypedSqlRow{}, }, { Query: "CALL DOLT_CHECKOUT('-b', 'newBranch2', @commit1)", - Expected: []sql.Row{{0, "Switched to branch 'newBranch2'"}}, + Expected: []sql.UntypedSqlRow{{0, "Switched to branch 'newBranch2'"}}, }, { Query: "show tables", - Expected: []sql.Row{{"a"}}, + Expected: []sql.UntypedSqlRow{{"a"}}, }, { Query: "CALL DOLT_CHECKOUT('-b', 'otherBranch', 'unknownCommit')", @@ -3766,23 +3766,23 @@ var DoltBranchScripts = []queries.ScriptTest{ Assertions: []queries.ScriptTestAssertion{ { Query: "select count(*) from dolt_branches where name='-b';", - Expected: []sql.Row{{0}}, + Expected: []sql.UntypedSqlRow{{0}}, }, { Query: "call dolt_branch('--', '-b');", - Expected: []sql.Row{{0}}, + Expected: []sql.UntypedSqlRow{{0}}, }, { Query: "select count(*) from dolt_branches where name='-b';", - Expected: []sql.Row{{1}}, + Expected: []sql.UntypedSqlRow{{1}}, }, { Query: "call dolt_branch('-d', '-f', '--', '-b');", - Expected: []sql.Row{{0}}, + Expected: []sql.UntypedSqlRow{{0}}, }, { Query: "select count(*) from dolt_branches where name='-b';", - Expected: []sql.Row{{0}}, + Expected: []sql.UntypedSqlRow{{0}}, }, }, }, @@ -3801,11 +3801,11 @@ var DoltBranchScripts = []queries.ScriptTest{ Assertions: []queries.ScriptTestAssertion{ { Query: "select * from `mydb/b1`.t join t", - Expected: []sql.Row{{1, 1}, {1, 2}}, + Expected: []sql.UntypedSqlRow{{1, 1}, {1, 2}}, }, { Query: "select * from `mydb/b1`.t join `mydb/main`.t", - Expected: []sql.Row{{1, 1}, {1, 2}}, + Expected: []sql.UntypedSqlRow{{1, 1}, {1, 2}}, }, }, }, @@ -3876,16 +3876,16 @@ var DoltResetTestScripts = []queries.ScriptTest{ Assertions: []queries.ScriptTestAssertion{ { Query: "start transaction;", - Expected: []sql.Row{}, + Expected: []sql.UntypedSqlRow{}, }, { Query: "call dolt_reset('--hard', 'HEAD~');", - Expected: []sql.Row{{0}}, + Expected: []sql.UntypedSqlRow{{0}}, }, { // dolt_status should be empty after a hard reset Query: "select * from dolt_status", - Expected: []sql.Row{}, + Expected: []sql.UntypedSqlRow{}, }, }, }, @@ -3899,16 +3899,16 @@ var DoltResetTestScripts = []queries.ScriptTest{ Assertions: []queries.ScriptTestAssertion{ { Query: "start transaction;", - Expected: []sql.Row{}, + Expected: []sql.UntypedSqlRow{}, }, { Query: "call dolt_reset('--soft', 'HEAD~');", - Expected: []sql.Row{{0}}, + Expected: []sql.UntypedSqlRow{{0}}, }, { // dolt_status should only show the unstaged table t being added Query: "select * from dolt_status", - Expected: []sql.Row{{"t", false, "new table"}}, + Expected: []sql.UntypedSqlRow{{"t", false, "new table"}}, }, }, }, @@ -3922,16 +3922,16 @@ var DoltResetTestScripts = []queries.ScriptTest{ Assertions: []queries.ScriptTestAssertion{ { Query: "start transaction;", - Expected: []sql.Row{}, + Expected: []sql.UntypedSqlRow{}, }, { Query: "call dolt_reset('HEAD~');", - Expected: []sql.Row{{0}}, + Expected: []sql.UntypedSqlRow{{0}}, }, { // dolt_status should only show the unstaged table t being added Query: "select * from dolt_status", - Expected: []sql.Row{{"t", false, "new table"}}, + Expected: []sql.UntypedSqlRow{{"t", false, "new table"}}, }, }, }, @@ -3967,11 +3967,11 @@ var DoltGC = []queries.ScriptTest{ }, { Query: "CALL DOLT_GC('--shallow');", - Expected: []sql.Row{{1}}, + Expected: []sql.UntypedSqlRow{{1}}, }, { Query: "CALL DOLT_GC();", - Expected: []sql.Row{{1}}, + Expected: []sql.UntypedSqlRow{{1}}, }, { Query: "CALL DOLT_GC();", @@ -4154,7 +4154,7 @@ var LogTableFunctionScriptTests = []queries.ScriptTest{ Assertions: []queries.ScriptTestAssertion{ { Query: "SELECT message from dolt_log();", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {"inserting into t"}, {"creating table t"}, {"Initialize data repository"}, @@ -4162,7 +4162,7 @@ var LogTableFunctionScriptTests = []queries.ScriptTest{ }, { Query: "SELECT message from dolt_log('main');", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {"inserting into t"}, {"creating table t"}, {"Initialize data repository"}, @@ -4170,14 +4170,14 @@ var LogTableFunctionScriptTests = []queries.ScriptTest{ }, { Query: "SELECT message from dolt_log(@Commit1);", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {"creating table t"}, {"Initialize data repository"}, }, }, { Query: "SELECT message from dolt_log(@Commit2);", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {"inserting into t"}, {"creating table t"}, {"Initialize data repository"}, @@ -4185,7 +4185,7 @@ var LogTableFunctionScriptTests = []queries.ScriptTest{ }, { Query: "SELECT message from dolt_log(@Commit3);", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {"inserting into t again"}, {"inserting into t"}, {"creating table t"}, @@ -4194,7 +4194,7 @@ var LogTableFunctionScriptTests = []queries.ScriptTest{ }, { Query: "SELECT message from dolt_log('new-branch');", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {"inserting into t again"}, {"inserting into t"}, {"creating table t"}, @@ -4203,14 +4203,14 @@ var LogTableFunctionScriptTests = []queries.ScriptTest{ }, { Query: "SELECT message from dolt_log('main^');", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {"creating table t"}, {"Initialize data repository"}, }, }, { Query: "SELECT message from dolt_log('main') join dolt_diff(@Commit1, @Commit2, 't') where commit_hash = to_commit;", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {"inserting into t"}, {"inserting into t"}, }, @@ -4250,83 +4250,83 @@ var LogTableFunctionScriptTests = []queries.ScriptTest{ Assertions: []queries.ScriptTestAssertion{ { Query: "SELECT count(*) from dolt_log('^main', 'new-branch');", - Expected: []sql.Row{{2}}, // 4, 3 + Expected: []sql.UntypedSqlRow{{2}}, // 4, 3 }, { Query: "SELECT count(*) from dolt_log('main..new-branch');", - Expected: []sql.Row{{2}}, // 4, 3 + Expected: []sql.UntypedSqlRow{{2}}, // 4, 3 }, { Query: "SELECT count(*) from dolt_log('main...new-branch');", - Expected: []sql.Row{{3}}, // 5, 4, 3 + Expected: []sql.UntypedSqlRow{{3}}, // 5, 4, 3 }, { Query: "SELECT count(*) from dolt_log('new-branch', '--not', 'main');", - Expected: []sql.Row{{2}}, // 4, 3 + Expected: []sql.UntypedSqlRow{{2}}, // 4, 3 }, { Query: "SELECT count(*) from dolt_log('new-branch', '^main');", - Expected: []sql.Row{{2}}, // 4, 3 + Expected: []sql.UntypedSqlRow{{2}}, // 4, 3 }, { Query: "SELECT count(*) from dolt_log('^new-branch', 'main');", - Expected: []sql.Row{{1}}, // 5 + Expected: []sql.UntypedSqlRow{{1}}, // 5 }, { Query: "SELECT count(*) from dolt_log('main', '--not', 'new-branch');", - Expected: []sql.Row{{1}}, // 5 + Expected: []sql.UntypedSqlRow{{1}}, // 5 }, { Query: "SELECT count(*) from dolt_log('^main', 'main');", - Expected: []sql.Row{{0}}, + Expected: []sql.UntypedSqlRow{{0}}, }, { Query: "SELECT count(*) from dolt_log('main..main');", - Expected: []sql.Row{{0}}, + Expected: []sql.UntypedSqlRow{{0}}, }, { Query: "SELECT count(*) from dolt_log('main...main');", - Expected: []sql.Row{{0}}, + Expected: []sql.UntypedSqlRow{{0}}, }, { Query: "SELECT count(*) from dolt_log('main', '--not', 'main');", - Expected: []sql.Row{{0}}, + Expected: []sql.UntypedSqlRow{{0}}, }, { Query: "SELECT count(*) from dolt_log('^main~', 'main');", - Expected: []sql.Row{{1}}, + Expected: []sql.UntypedSqlRow{{1}}, }, { Query: "SELECT count(*) from dolt_log('^main^', 'main');", - Expected: []sql.Row{{1}}, // 5 + Expected: []sql.UntypedSqlRow{{1}}, // 5 }, { Query: "SELECT count(*) from dolt_log('^main', 'main^');", - Expected: []sql.Row{{0}}, + Expected: []sql.UntypedSqlRow{{0}}, }, { Query: "SELECT count(*) from dolt_log('^main', @Commit3);", - Expected: []sql.Row{{1}}, + Expected: []sql.UntypedSqlRow{{1}}, }, { Query: "SELECT count(*) from dolt_log('^new-branch', @Commit5);", - Expected: []sql.Row{{1}}, // 5 + Expected: []sql.UntypedSqlRow{{1}}, // 5 }, { Query: "SELECT count(*) from dolt_log(@Commit3, '--not', @Commit2);", - Expected: []sql.Row{{1}}, // 3 + Expected: []sql.UntypedSqlRow{{1}}, // 3 }, { Query: "SELECT count(*) from dolt_log(@Commit4, '--not', @Commit2);", - Expected: []sql.Row{{2}}, // 4, 3 + Expected: []sql.UntypedSqlRow{{2}}, // 4, 3 }, { Query: "SELECT count(*) from dolt_log('^main', '^new-branch');", - Expected: []sql.Row{{0}}, + Expected: []sql.UntypedSqlRow{{0}}, }, { Query: "SELECT count(*) from dolt_log('^main', '--not', 'new-branch');", - Expected: []sql.Row{{0}}, + Expected: []sql.UntypedSqlRow{{0}}, }, }, }, @@ -4351,7 +4351,7 @@ var LogTableFunctionScriptTests = []queries.ScriptTest{ Assertions: []queries.ScriptTestAssertion{ { Query: "SELECT commit_hash = @Commit2, commit_hash = @Commit1, committer, email, message from dolt_log();", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {true, false, "root", "root@localhost", "inserting into t"}, {false, true, "root", "root@localhost", "creating table t"}, {false, false, "billy bob", "bigbillieb@fake.horse", "Initialize data repository"}, @@ -4359,15 +4359,15 @@ var LogTableFunctionScriptTests = []queries.ScriptTest{ }, { Query: "SELECT commit_hash = @Commit2, committer, email, message from dolt_log('main') limit 1;", - Expected: []sql.Row{{true, "root", "root@localhost", "inserting into t"}}, + Expected: []sql.UntypedSqlRow{{true, "root", "root@localhost", "inserting into t"}}, }, { Query: "SELECT commit_hash = @Commit3, committer, email, message from dolt_log('new-branch') limit 1;", - Expected: []sql.Row{{true, "John Doe", "johndoe@example.com", "inserting into t again"}}, + Expected: []sql.UntypedSqlRow{{true, "John Doe", "johndoe@example.com", "inserting into t again"}}, }, { Query: "SELECT commit_hash = @Commit1, committer, email, message from dolt_log(@Commit1) limit 1;", - Expected: []sql.Row{{true, "root", "root@localhost", "creating table t"}}, + Expected: []sql.UntypedSqlRow{{true, "root", "root@localhost", "creating table t"}}, }, }, }, @@ -4404,21 +4404,21 @@ var LogTableFunctionScriptTests = []queries.ScriptTest{ Assertions: []queries.ScriptTestAssertion{ { Query: "SELECT commit_hash = @Commit4, commit_hash = @Commit3, committer, email, message from dolt_log('^main', 'new-branch');", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {true, false, "John Doe", "johndoe@example.com", "inserting into t 4"}, {false, true, "John Doe", "johndoe@example.com", "inserting into t 3"}, }, }, { Query: "SELECT commit_hash = @Commit4, commit_hash = @Commit3, committer, email, message from dolt_log('main..new-branch');", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {true, false, "John Doe", "johndoe@example.com", "inserting into t 4"}, {false, true, "John Doe", "johndoe@example.com", "inserting into t 3"}, }, }, { Query: "SELECT commit_hash = @Commit5, commit_hash = @Commit4, commit_hash = @Commit3, committer, email, message from dolt_log('main...new-branch');", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {true, false, false, "root", "root@localhost", "inserting into t 5"}, {false, true, false, "John Doe", "johndoe@example.com", "inserting into t 4"}, {false, false, true, "John Doe", "johndoe@example.com", "inserting into t 3"}, @@ -4426,49 +4426,49 @@ var LogTableFunctionScriptTests = []queries.ScriptTest{ }, { Query: "SELECT commit_hash = @Commit4, commit_hash = @Commit3, committer, email, message from dolt_log('new-branch', '--not', 'main');", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {true, false, "John Doe", "johndoe@example.com", "inserting into t 4"}, {false, true, "John Doe", "johndoe@example.com", "inserting into t 3"}, }, }, { Query: "SELECT commit_hash = @Commit4, commit_hash = @Commit3, committer, email, message from dolt_log('new-branch', '^main');", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {true, false, "John Doe", "johndoe@example.com", "inserting into t 4"}, {false, true, "John Doe", "johndoe@example.com", "inserting into t 3"}, }, }, { Query: "SELECT commit_hash = @Commit5, committer, email, message from dolt_log('^new-branch', 'main');", - Expected: []sql.Row{{true, "root", "root@localhost", "inserting into t 5"}}, + Expected: []sql.UntypedSqlRow{{true, "root", "root@localhost", "inserting into t 5"}}, }, { Query: "SELECT * from dolt_log('^main', 'main');", - Expected: []sql.Row{}, + Expected: []sql.UntypedSqlRow{}, }, { Query: "SELECT commit_hash = @Commit5, committer, email, message from dolt_log('^main~', 'main');", - Expected: []sql.Row{{true, "root", "root@localhost", "inserting into t 5"}}, + Expected: []sql.UntypedSqlRow{{true, "root", "root@localhost", "inserting into t 5"}}, }, { Query: "SELECT commit_hash = @Commit5, committer, email, message from dolt_log( 'main', '--not', 'main~');", - Expected: []sql.Row{{true, "root", "root@localhost", "inserting into t 5"}}, + Expected: []sql.UntypedSqlRow{{true, "root", "root@localhost", "inserting into t 5"}}, }, { Query: "SELECT commit_hash = @Commit3, committer, email, message from dolt_log('^main', @Commit3);", - Expected: []sql.Row{{true, "John Doe", "johndoe@example.com", "inserting into t 3"}}, + Expected: []sql.UntypedSqlRow{{true, "John Doe", "johndoe@example.com", "inserting into t 3"}}, }, { Query: "SELECT commit_hash = @Commit3, committer, email, message from dolt_log(@Commit3, '--not', @Commit2);", - Expected: []sql.Row{{true, "John Doe", "johndoe@example.com", "inserting into t 3"}}, + Expected: []sql.UntypedSqlRow{{true, "John Doe", "johndoe@example.com", "inserting into t 3"}}, }, { Query: "SELECT commit_hash = @Commit5, committer, email, message from dolt_log('^new-branch', @Commit5);", - Expected: []sql.Row{{true, "root", "root@localhost", "inserting into t 5"}}, + Expected: []sql.UntypedSqlRow{{true, "root", "root@localhost", "inserting into t 5"}}, }, { Query: "SELECT commit_hash = @Commit5, committer, email, message from dolt_log(@Commit5, '--not', @Commit4);", - Expected: []sql.Row{{true, "root", "root@localhost", "inserting into t 5"}}, + Expected: []sql.UntypedSqlRow{{true, "root", "root@localhost", "inserting into t 5"}}, }, }, }, @@ -4503,7 +4503,7 @@ var LogTableFunctionScriptTests = []queries.ScriptTest{ Assertions: []queries.ScriptTestAssertion{ { Query: "select message from dolt_log('branchB', 'branchA');", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {"commit 3 BRANCHA [3A]"}, {"commit 1 BRANCHB [1B]"}, {"commit 2 BRANCHA [2A]"}, @@ -4515,7 +4515,7 @@ var LogTableFunctionScriptTests = []queries.ScriptTest{ }, { Query: "select message from dolt_log('main', 'branchA');", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {"commit 3 BRANCHA [3A]"}, {"commit 2 BRANCHA [2A]"}, {"commit 3 AFTER [3M]"}, @@ -4527,7 +4527,7 @@ var LogTableFunctionScriptTests = []queries.ScriptTest{ }, { Query: "select message from dolt_log('main', 'branchB', 'branchA');", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {"commit 3 BRANCHA [3A]"}, {"commit 1 BRANCHB [1B]"}, {"commit 2 BRANCHA [2A]"}, @@ -4540,27 +4540,27 @@ var LogTableFunctionScriptTests = []queries.ScriptTest{ }, { Query: "select message from dolt_log('branchB', 'main', '^branchA');", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {"commit 1 BRANCHB [1B]"}, {"commit 3 AFTER [3M]"}, }, }, { Query: "select message from dolt_log('branchB', 'main', '--not', 'branchA');", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {"commit 1 BRANCHB [1B]"}, {"commit 3 AFTER [3M]"}, }, }, { Query: "select message from dolt_log('branchB', 'main', '^branchA', '^main');", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {"commit 1 BRANCHB [1B]"}, }, }, { Query: "select message from dolt_log('tagM..branchB');", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {"commit 1 BRANCHB [1B]"}, {"commit 2 BRANCHA [2A]"}, {"commit 1 BRANCHA [1A]"}, @@ -4568,7 +4568,7 @@ var LogTableFunctionScriptTests = []queries.ScriptTest{ }, { Query: "select message from dolt_log('HEAD..branchB');", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {"commit 1 BRANCHB [1B]"}, {"commit 2 BRANCHA [2A]"}, {"commit 1 BRANCHA [1A]"}, @@ -4614,7 +4614,7 @@ var LogTableFunctionScriptTests = []queries.ScriptTest{ Assertions: []queries.ScriptTestAssertion{ { Query: "select message from dolt_log('--tables', 'test');", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {"inserted 2 into test [6M]"}, {"merged test-branch [4M]"}, {"inserted 1 into test [3M]"}, @@ -4624,20 +4624,20 @@ var LogTableFunctionScriptTests = []queries.ScriptTest{ }, { Query: "select message from dolt_log('--tables', 'test2');", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {"created table test2 [2M]"}, }, }, { Query: "select message from dolt_log('--tables', 'test3')", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {"dropped table test3 [5M]"}, {"created table test3 [2TB]"}, }, }, { Query: "select message from dolt_log('--tables', 'test,test2');", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {"inserted 2 into test [6M]"}, {"merged test-branch [4M]"}, {"inserted 1 into test [3M]"}, @@ -4648,7 +4648,7 @@ var LogTableFunctionScriptTests = []queries.ScriptTest{ }, { Query: "select message from dolt_log('test-branch', '--tables', 'test');", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {"inserted 0 into test [1TB]"}, {"created table test [1M]"}, }, @@ -4682,63 +4682,63 @@ var LogTableFunctionScriptTests = []queries.ScriptTest{ Assertions: []queries.ScriptTestAssertion{ { Query: "SELECT committer, email, message from dolt_log('--merges');", - Expected: []sql.Row{{"root", "root@localhost", "Merge branch 'branch2' into main"}}, + Expected: []sql.UntypedSqlRow{{"root", "root@localhost", "Merge branch 'branch2' into main"}}, }, { Query: "SELECT committer, email, message from dolt_log('--min-parents', '2');", - Expected: []sql.Row{{"root", "root@localhost", "Merge branch 'branch2' into main"}}, + Expected: []sql.UntypedSqlRow{{"root", "root@localhost", "Merge branch 'branch2' into main"}}, }, { Query: "SELECT committer, email, message from dolt_log('main', '--min-parents', '2');", - Expected: []sql.Row{{"root", "root@localhost", "Merge branch 'branch2' into main"}}, + Expected: []sql.UntypedSqlRow{{"root", "root@localhost", "Merge branch 'branch2' into main"}}, }, { Query: "SELECT count(*) from dolt_log('main');", - Expected: []sql.Row{{5}}, + Expected: []sql.UntypedSqlRow{{5}}, }, { Query: "SELECT count(*) from dolt_log('main', '--min-parents', '1');", // Should show everything except first commit - Expected: []sql.Row{{4}}, + Expected: []sql.UntypedSqlRow{{4}}, }, { Query: "SELECT count(*) from dolt_log('main', '--min-parents', '1', '--merges');", // --merges overrides --min-parents - Expected: []sql.Row{{1}}, + Expected: []sql.UntypedSqlRow{{1}}, }, { Query: "SELECT committer, email, message from dolt_log('branch1..main', '--min-parents', '2');", - Expected: []sql.Row{{"root", "root@localhost", "Merge branch 'branch2' into main"}}, + Expected: []sql.UntypedSqlRow{{"root", "root@localhost", "Merge branch 'branch2' into main"}}, }, { Query: "SELECT count(*) from dolt_log('--min-parents', '5');", - Expected: []sql.Row{{0}}, + Expected: []sql.UntypedSqlRow{{0}}, }, { Query: "SELECT message, SUBSTRING_INDEX(parents, ', ', 1) = @Commit2, SUBSTRING_INDEX(parents, ', ', -1) = @Commit3 from dolt_log('main', '--parents', '--merges');", - Expected: []sql.Row{{"Merge branch 'branch2' into main", true, true}}, // shows two parents for merge commit + Expected: []sql.UntypedSqlRow{{"Merge branch 'branch2' into main", true, true}}, // shows two parents for merge commit }, { Query: "SELECT commit_hash = @Commit3, parents = @Commit1 from dolt_log('branch2', '--parents') LIMIT 1;", // shows one parent for non-merge commit - Expected: []sql.Row{{true, true}}, + Expected: []sql.UntypedSqlRow{{true, true}}, }, { Query: "SELECT message, SUBSTRING_INDEX(parents, ', ', 1) = @Commit2, SUBSTRING_INDEX(parents, ', ', -1) = @Commit3 from dolt_log('branch1..main', '--parents', '--merges') LIMIT 1;", - Expected: []sql.Row{{"Merge branch 'branch2' into main", true, true}}, + Expected: []sql.UntypedSqlRow{{"Merge branch 'branch2' into main", true, true}}, }, { Query: "SELECT commit_hash = @Commit2, parents = @Commit1 from dolt_log('branch2..branch1', '--parents') LIMIT 1;", - Expected: []sql.Row{{true, true}}, + Expected: []sql.UntypedSqlRow{{true, true}}, }, { Query: "SELECT refs from dolt_log('--decorate', 'short') LIMIT 1;", - Expected: []sql.Row{{"HEAD -> main, tag: v1"}}, + Expected: []sql.UntypedSqlRow{{"HEAD -> main, tag: v1"}}, }, { Query: "SELECT refs from dolt_log('--decorate', 'full') LIMIT 1;", - Expected: []sql.Row{{"HEAD -> refs/heads/main, tag: refs/tags/v1"}}, + Expected: []sql.UntypedSqlRow{{"HEAD -> refs/heads/main, tag: refs/tags/v1"}}, }, { Query: "SELECT commit_hash = @Commit2, parents = @Commit1, refs from dolt_log('branch2..branch1', '--parents', '--decorate', 'short') LIMIT 1;", - Expected: []sql.Row{{true, true, "HEAD -> branch1"}}, + Expected: []sql.UntypedSqlRow{{true, true, "HEAD -> branch1"}}, }, }, }, @@ -4753,7 +4753,7 @@ var LargeJsonObjectScriptTests = []queries.ScriptTest{ Assertions: []queries.ScriptTestAssertion{ { Query: `insert into t set j= concat('[', repeat('"word",', 10000000), '"word"]')`, - Expected: []sql.Row{{types.OkResult{RowsAffected: 1}}}, + Expected: []sql.UntypedSqlRow{{types.OkResult{RowsAffected: 1}}}, }, }, }, @@ -4783,19 +4783,19 @@ var DoltTagTestScripts = []queries.ScriptTest{ Assertions: []queries.ScriptTestAssertion{ { Query: "CALL DOLT_TAG('v1', 'HEAD')", - Expected: []sql.Row{{0}}, + Expected: []sql.UntypedSqlRow{{0}}, }, { Query: "SELECT tag_name, IF(CHAR_LENGTH(tag_hash) < 0, NULL, 'not null'), tagger, email, IF(date IS NULL, NULL, 'not null'), message from dolt_tags", - Expected: []sql.Row{{"v1", "not null", "billy bob", "bigbillieb@fake.horse", "not null", ""}}, + Expected: []sql.UntypedSqlRow{{"v1", "not null", "billy bob", "bigbillieb@fake.horse", "not null", ""}}, }, { Query: "CALL DOLT_TAG('v2', '-m', 'create tag v2')", - Expected: []sql.Row{{0}}, + Expected: []sql.UntypedSqlRow{{0}}, }, { Query: "SELECT tag_name, message from dolt_tags", - Expected: []sql.Row{{"v1", ""}, {"v2", "create tag v2"}}, + Expected: []sql.UntypedSqlRow{{"v1", ""}, {"v2", "create tag v2"}}, }, }, }, @@ -4813,23 +4813,23 @@ var DoltTagTestScripts = []queries.ScriptTest{ Assertions: []queries.ScriptTestAssertion{ { Query: "SELECT tag_name, message from dolt_tags", - Expected: []sql.Row{{"v1", "create tag v1"}, {"v2", "create tag v2"}, {"v3", "create tag v3"}}, + Expected: []sql.UntypedSqlRow{{"v1", "create tag v1"}, {"v2", "create tag v2"}, {"v3", "create tag v3"}}, }, { Query: "CALL DOLT_TAG('-d','v1')", - Expected: []sql.Row{{0}}, + Expected: []sql.UntypedSqlRow{{0}}, }, { Query: "SELECT tag_name, message from dolt_tags", - Expected: []sql.Row{{"v2", "create tag v2"}, {"v3", "create tag v3"}}, + Expected: []sql.UntypedSqlRow{{"v2", "create tag v2"}, {"v3", "create tag v3"}}, }, { Query: "CALL DOLT_TAG('-d','v2','v3')", - Expected: []sql.Row{{0}}, + Expected: []sql.UntypedSqlRow{{0}}, }, { Query: "SELECT tag_name, message from dolt_tags", - Expected: []sql.Row{}, + Expected: []sql.UntypedSqlRow{}, }, }, }, @@ -4847,27 +4847,27 @@ var DoltTagTestScripts = []queries.ScriptTest{ Assertions: []queries.ScriptTestAssertion{ { Query: "CALL DOLT_TAG('v1','HEAD')", - Expected: []sql.Row{{0}}, + Expected: []sql.UntypedSqlRow{{0}}, }, { Query: "CALL DOLT_CHECKOUT('-b','other','HEAD^')", - Expected: []sql.Row{{0, "Switched to branch 'other'"}}, + Expected: []sql.UntypedSqlRow{{0, "Switched to branch 'other'"}}, }, { Query: "INSERT INTO test VALUES (8), (9)", - Expected: []sql.Row{{types.OkResult{RowsAffected: 2}}}, + Expected: []sql.UntypedSqlRow{{types.OkResult{RowsAffected: 2}}}, }, { Query: "CALL DOLT_COMMIT('-am','made changes in other')", - Expected: []sql.Row{{doltCommit}}, + Expected: []sql.UntypedSqlRow{{doltCommit}}, }, { Query: "CALL DOLT_MERGE('v1')", - Expected: []sql.Row{{doltCommit, 0, 0, "merge successful"}}, + Expected: []sql.UntypedSqlRow{{doltCommit, 0, 0, "merge successful"}}, }, { Query: "SELECT * FROM test", - Expected: []sql.Row{{1}, {2}, {3}, {8}, {9}}, + Expected: []sql.UntypedSqlRow{{1}, {2}, {3}, {8}, {9}}, }, }, }, @@ -4883,13 +4883,13 @@ var DoltTagTestScripts = []queries.ScriptTest{ Assertions: []queries.ScriptTestAssertion{ { Query: "SELECT tag_name FROM dolt_tags", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {"ABC"}, }, }, { Query: "select * from test;", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {0}, {1}, {2}, @@ -4897,11 +4897,11 @@ var DoltTagTestScripts = []queries.ScriptTest{ }, { Query: "use mydb/abc;", - Expected: []sql.Row{}, + Expected: []sql.UntypedSqlRow{}, }, { Query: "select * from test;", - Expected: []sql.Row{}, + Expected: []sql.UntypedSqlRow{}, }, }, }, @@ -4917,13 +4917,13 @@ var DoltTagTestScripts = []queries.ScriptTest{ Assertions: []queries.ScriptTestAssertion{ { Query: "SELECT tag_name FROM dolt_tags", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {"v1"}, }, }, { Query: "select * from test;", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {0}, {1}, {2}, @@ -4943,11 +4943,11 @@ var DoltRemoteTestScripts = []queries.ScriptTest{ Assertions: []queries.ScriptTestAssertion{ { Query: "CALL DOLT_REMOTE('add','origin','file://../test')", - Expected: []sql.Row{{0}}, + Expected: []sql.UntypedSqlRow{{0}}, }, { Query: "SELECT name, IF(CHAR_LENGTH(url) < 0, NULL, 'not null'), fetch_specs, params FROM DOLT_REMOTES", - Expected: []sql.Row{{"origin", "not null", types.MustJSON(`["refs/heads/*:refs/remotes/origin/*"]`), types.MustJSON(`{}`)}}, + Expected: []sql.UntypedSqlRow{{"origin", "not null", types.MustJSON(`["refs/heads/*:refs/remotes/origin/*"]`), types.MustJSON(`{}`)}}, }, { Query: "CALL DOLT_REMOTE()", @@ -4972,17 +4972,17 @@ var DoltRemoteTestScripts = []queries.ScriptTest{ Assertions: []queries.ScriptTestAssertion{ { Query: "SELECT name, IF(CHAR_LENGTH(url) < 0, NULL, 'not null'), fetch_specs, params FROM DOLT_REMOTES", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {"origin1", "not null", types.MustJSON(`["refs/heads/*:refs/remotes/origin1/*"]`), types.MustJSON(`{}`)}, {"origin2", "not null", types.MustJSON(`["refs/heads/*:refs/remotes/origin2/*"]`), types.MustJSON(`{}`)}}, }, { Query: "CALL DOLT_REMOTE('remove','origin2')", - Expected: []sql.Row{{0}}, + Expected: []sql.UntypedSqlRow{{0}}, }, { Query: "SELECT name, IF(CHAR_LENGTH(url) < 0, NULL, 'not null'), fetch_specs, params FROM DOLT_REMOTES", - Expected: []sql.Row{{"origin1", "not null", types.MustJSON(`["refs/heads/*:refs/remotes/origin1/*"]`), types.MustJSON(`{}`)}}, + Expected: []sql.UntypedSqlRow{{"origin1", "not null", types.MustJSON(`["refs/heads/*:refs/remotes/origin1/*"]`), types.MustJSON(`{}`)}}, }, // 'origin1' remote must exist in order this error to be returned; otherwise, no error from EOF { @@ -4999,23 +4999,23 @@ var DoltRemoteTestScripts = []queries.ScriptTest{ Assertions: []queries.ScriptTestAssertion{ { Query: "use one;", - Expected: []sql.Row{}, + Expected: []sql.UntypedSqlRow{}, }, { Query: "CALL DOLT_REMOTE('add','test01','file:///foo');", - Expected: []sql.Row{{0}}, + Expected: []sql.UntypedSqlRow{{0}}, }, { Query: "select count(*) from dolt_remotes where name='test01';", - Expected: []sql.Row{{1}}, + Expected: []sql.UntypedSqlRow{{1}}, }, { Query: "use mydb;", - Expected: []sql.Row{}, + Expected: []sql.UntypedSqlRow{}, }, { Query: "select count(*) from dolt_remotes where name='test01';", - Expected: []sql.Row{{0}}, + Expected: []sql.UntypedSqlRow{{0}}, }, }, }, @@ -5039,39 +5039,39 @@ var DoltUndropTestScripts = []queries.ScriptTest{ Assertions: []queries.ScriptTestAssertion{ { Query: "show databases;", - Expected: []sql.Row{{"information_schema"}, {"mydb"}, {"mysql"}, {"one"}, {"two"}}, + Expected: []sql.UntypedSqlRow{{"information_schema"}, {"mydb"}, {"mysql"}, {"one"}, {"two"}}, }, { Query: "drop database one;", - Expected: []sql.Row{{types.NewOkResult(1)}}, + Expected: []sql.UntypedSqlRow{{types.NewOkResult(1)}}, }, { Query: "show databases;", - Expected: []sql.Row{{"information_schema"}, {"mydb"}, {"mysql"}, {"two"}}, + Expected: []sql.UntypedSqlRow{{"information_schema"}, {"mydb"}, {"mysql"}, {"two"}}, }, { Query: "call dolt_undrop('one');", - Expected: []sql.Row{{0}}, + Expected: []sql.UntypedSqlRow{{0}}, }, { Query: "show databases;", - Expected: []sql.Row{{"information_schema"}, {"mydb"}, {"mysql"}, {"one"}, {"two"}}, + Expected: []sql.UntypedSqlRow{{"information_schema"}, {"mydb"}, {"mysql"}, {"one"}, {"two"}}, }, { Query: "use one;", - Expected: []sql.Row{}, + Expected: []sql.UntypedSqlRow{}, }, { Query: "select * from one.t1;", - Expected: []sql.Row{{1}}, + Expected: []sql.UntypedSqlRow{{1}}, }, { Query: "select * from two.t2;", - Expected: []sql.Row{{2}}, + Expected: []sql.UntypedSqlRow{{2}}, }, { Query: "drop database one;", - Expected: []sql.Row{{types.NewOkResult(1)}}, + Expected: []sql.UntypedSqlRow{{types.NewOkResult(1)}}, }, { Query: "call dolt_undrop;", @@ -5079,11 +5079,11 @@ var DoltUndropTestScripts = []queries.ScriptTest{ }, { Query: "call dolt_purge_dropped_databases;", - Expected: []sql.Row{{0}}, + Expected: []sql.UntypedSqlRow{{0}}, }, { Query: "show databases;", - Expected: []sql.Row{{"information_schema"}, {"mydb"}, {"mysql"}, {"two"}}, + Expected: []sql.UntypedSqlRow{{"information_schema"}, {"mydb"}, {"mysql"}, {"two"}}, }, { Query: "call dolt_undrop;", @@ -5133,7 +5133,7 @@ var DoltReflogTestScripts = []queries.ScriptTest{ Assertions: []queries.ScriptTestAssertion{ { Query: "select ref, commit_hash, commit_message from dolt_reflog();", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {"refs/tags/tag1", doltCommit, "inserting row 3"}, {"refs/heads/branch1", doltCommit, "inserting row 3"}, {"refs/heads/branch1", doltCommit, "inserting row 2"}, @@ -5168,11 +5168,11 @@ var DoltReflogTestScripts = []queries.ScriptTest{ Assertions: []queries.ScriptTestAssertion{ { Query: "select * from dolt_reflog('doesNotExist');", - Expected: []sql.Row{}, + Expected: []sql.UntypedSqlRow{}, }, { Query: "select ref, commit_hash, commit_message from dolt_reflog('refs/heads/main')", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {"refs/heads/main", doltCommit, "inserting row 1"}, {"refs/heads/main", doltCommit, "creating table t1"}, {"refs/heads/main", doltCommit, "Initialize data repository"}, @@ -5180,14 +5180,14 @@ var DoltReflogTestScripts = []queries.ScriptTest{ }, { // ref is case-insensitive Query: "select ref, commit_hash, commit_message from dolt_reflog('reFS/Heads/MaIn')", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {"refs/heads/main", doltCommit, "inserting row 1"}, {"refs/heads/main", doltCommit, "creating table t1"}, {"refs/heads/main", doltCommit, "Initialize data repository"}, }, }, { Query: "select ref, commit_hash, commit_message from dolt_reflog('main')", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {"refs/heads/main", doltCommit, "inserting row 1"}, {"refs/heads/main", doltCommit, "creating table t1"}, {"refs/heads/main", doltCommit, "Initialize data repository"}, @@ -5195,62 +5195,62 @@ var DoltReflogTestScripts = []queries.ScriptTest{ }, { // ref is case-insensitive Query: "select ref, commit_hash, commit_message from dolt_reflog('MaIN')", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {"refs/heads/main", doltCommit, "inserting row 1"}, {"refs/heads/main", doltCommit, "creating table t1"}, {"refs/heads/main", doltCommit, "Initialize data repository"}, }, }, { Query: "select ref, commit_hash, commit_message from dolt_reflog('refs/heads/branch1')", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {"refs/heads/branch1", doltCommit, "inserting row 3"}, {"refs/heads/branch1", doltCommit, "inserting row 2"}, {"refs/heads/branch1", doltCommit, "inserting row 1"}, }, }, { Query: "select ref, commit_hash, commit_message from dolt_reflog('branch1')", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {"refs/heads/branch1", doltCommit, "inserting row 3"}, {"refs/heads/branch1", doltCommit, "inserting row 2"}, {"refs/heads/branch1", doltCommit, "inserting row 1"}, }, }, { Query: "select ref, commit_hash, commit_message from dolt_reflog('refs/tags/tag1')", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {"refs/tags/tag1", doltCommit, "inserting row 3"}, {"refs/tags/tag1", doltCommit, "inserting row 1"}, }, }, { // ref is case-insensitive Query: "select ref, commit_hash, commit_message from dolt_reflog('Refs/TAGs/taG1')", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {"refs/tags/tag1", doltCommit, "inserting row 3"}, {"refs/tags/tag1", doltCommit, "inserting row 1"}, }, }, { Query: "select ref, commit_hash, commit_message from dolt_reflog('tag1')", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {"refs/tags/tag1", doltCommit, "inserting row 3"}, {"refs/tags/tag1", doltCommit, "inserting row 1"}, }, }, { // ref is case-insensitive Query: "select ref, commit_hash, commit_message from dolt_reflog('tAG1')", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {"refs/tags/tag1", doltCommit, "inserting row 3"}, {"refs/tags/tag1", doltCommit, "inserting row 1"}, }, }, { // checkout main, so we can delete branch1 Query: "call dolt_checkout('main');", - Expected: []sql.Row{{0, "Switched to branch 'main'"}}, + Expected: []sql.UntypedSqlRow{{0, "Switched to branch 'main'"}}, }, { // delete branch branch1 and make sure we can still query it in reflog Query: "call dolt_branch('-D', 'branch1')", - Expected: []sql.Row{{0}}, + Expected: []sql.UntypedSqlRow{{0}}, }, { Query: "select ref, commit_hash, commit_message from dolt_reflog('branch1')", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {"refs/heads/branch1", doltCommit, "inserting row 3"}, {"refs/heads/branch1", doltCommit, "inserting row 2"}, {"refs/heads/branch1", doltCommit, "inserting row 1"}, @@ -5258,10 +5258,10 @@ var DoltReflogTestScripts = []queries.ScriptTest{ }, { // delete tag tag1 and make sure we can still query it in reflog Query: "call dolt_tag('-d', 'tag1')", - Expected: []sql.Row{{0}}, + Expected: []sql.UntypedSqlRow{{0}}, }, { Query: "select ref, commit_hash, commit_message from dolt_reflog('tag1')", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {"refs/tags/tag1", doltCommit, "inserting row 3"}, {"refs/tags/tag1", doltCommit, "inserting row 1"}, }, @@ -5273,19 +5273,19 @@ var DoltReflogTestScripts = []queries.ScriptTest{ Assertions: []queries.ScriptTestAssertion{ { Query: "select ref, commit_hash, commit_message from dolt_reflog('main')", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {"refs/heads/main", doltCommit, "Initialize data repository"}, }, }, { Query: "call dolt_gc();", - Expected: []sql.Row{{0}}, + Expected: []sql.UntypedSqlRow{{0}}, }, { // Calling dolt_gc() invalidates the session, so we have to ask this assertion to create a new session NewSession: true, Query: "select ref, commit_hash, commit_message from dolt_reflog('main')", - Expected: []sql.Row{}, + Expected: []sql.UntypedSqlRow{}, }, }, }, @@ -5303,7 +5303,7 @@ var DoltReflogTestScripts = []queries.ScriptTest{ Assertions: []queries.ScriptTestAssertion{ { Query: "select ref, commit_hash, commit_message from dolt_reflog('main')", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {"refs/heads/main", doltCommit, "inserting row 2"}, {"refs/heads/main", doltCommit, "inserting row 1"}, {"refs/heads/main", doltCommit, "creating table t1"}, @@ -5312,13 +5312,13 @@ var DoltReflogTestScripts = []queries.ScriptTest{ }, { Query: "call dolt_gc();", - Expected: []sql.Row{{0}}, + Expected: []sql.UntypedSqlRow{{0}}, }, { // Calling dolt_gc() invalidates the session, so we have to force this test to create a new session NewSession: true, Query: "select ref, commit_hash, commit_message from dolt_reflog('main')", - Expected: []sql.Row{}, + Expected: []sql.UntypedSqlRow{}, }, }, }, @@ -5338,11 +5338,11 @@ var DoltAutoIncrementTests = []queries.ScriptTest{ Assertions: []queries.ScriptTestAssertion{ { Query: "insert into t (b) values (1), (2)", - Expected: []sql.Row{{types.OkResult{RowsAffected: 2, InsertID: 1}}}, + Expected: []sql.UntypedSqlRow{{types.OkResult{RowsAffected: 2, InsertID: 1}}}, }, { Query: "call dolt_commit('-am', 'two values on main')", - Expected: []sql.Row{{doltCommit}}, + Expected: []sql.UntypedSqlRow{{doltCommit}}, }, { Query: "call dolt_checkout('branch1')", @@ -5350,18 +5350,18 @@ var DoltAutoIncrementTests = []queries.ScriptTest{ }, { Query: "insert into t (b) values (3), (4)", - Expected: []sql.Row{{types.OkResult{RowsAffected: 2, InsertID: 3}}}, + Expected: []sql.UntypedSqlRow{{types.OkResult{RowsAffected: 2, InsertID: 3}}}, }, { Query: "select * from t order by a", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {3, 3}, {4, 4}, }, }, { Query: "call dolt_commit('-am', 'two values on branch1')", - Expected: []sql.Row{{doltCommit}}, + Expected: []sql.UntypedSqlRow{{doltCommit}}, }, { Query: "call dolt_checkout('branch2')", @@ -5369,11 +5369,11 @@ var DoltAutoIncrementTests = []queries.ScriptTest{ }, { Query: "insert into t (b) values (5), (6)", - Expected: []sql.Row{{types.OkResult{RowsAffected: 2, InsertID: 5}}}, + Expected: []sql.UntypedSqlRow{{types.OkResult{RowsAffected: 2, InsertID: 5}}}, }, { Query: "select * from t order by a", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {5, 5}, {6, 6}, }, @@ -5400,7 +5400,7 @@ var DoltAutoIncrementTests = []queries.ScriptTest{ Assertions: []queries.ScriptTestAssertion{ { Query: "drop table t", - Expected: []sql.Row{{types.NewOkResult(0)}}, + Expected: []sql.UntypedSqlRow{{types.NewOkResult(0)}}, }, { Query: "call dolt_checkout('main')", @@ -5409,11 +5409,11 @@ var DoltAutoIncrementTests = []queries.ScriptTest{ { // highest value in any branch is 6 Query: "insert into t (b) values (7), (8)", - Expected: []sql.Row{{types.OkResult{RowsAffected: 2, InsertID: 7}}}, + Expected: []sql.UntypedSqlRow{{types.OkResult{RowsAffected: 2, InsertID: 7}}}, }, { Query: "select * from t order by a", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {1, 1}, {2, 2}, {7, 7}, @@ -5422,7 +5422,7 @@ var DoltAutoIncrementTests = []queries.ScriptTest{ }, { Query: "drop table t", - Expected: []sql.Row{{types.NewOkResult(0)}}, + Expected: []sql.UntypedSqlRow{{types.NewOkResult(0)}}, }, { Query: "call dolt_checkout('branch2')", @@ -5431,11 +5431,11 @@ var DoltAutoIncrementTests = []queries.ScriptTest{ { // highest value in any branch is still 6 (dropped table above) Query: "insert into t (b) values (7), (8)", - Expected: []sql.Row{{types.OkResult{RowsAffected: 2, InsertID: 7}}}, + Expected: []sql.UntypedSqlRow{{types.OkResult{RowsAffected: 2, InsertID: 7}}}, }, { Query: "select * from t order by a", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {5, 5}, {6, 6}, {7, 7}, @@ -5444,7 +5444,7 @@ var DoltAutoIncrementTests = []queries.ScriptTest{ }, { Query: "drop table t", - Expected: []sql.Row{{types.NewOkResult(0)}}, + Expected: []sql.UntypedSqlRow{{types.NewOkResult(0)}}, }, { Query: "create table t (a int primary key auto_increment, b int)", @@ -5453,11 +5453,11 @@ var DoltAutoIncrementTests = []queries.ScriptTest{ { // no value on any branch Query: "insert into t (b) values (1), (2)", - Expected: []sql.Row{{types.OkResult{RowsAffected: 2, InsertID: 1}}}, + Expected: []sql.UntypedSqlRow{{types.OkResult{RowsAffected: 2, InsertID: 1}}}, }, { Query: "select * from t order by a", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {1, 1}, {2, 2}, }, @@ -5476,7 +5476,7 @@ var DoltAutoIncrementTests = []queries.ScriptTest{ Assertions: []queries.ScriptTestAssertion{ { Query: "delete from t", - Expected: []sql.Row{{types.NewOkResult(2)}}, + Expected: []sql.UntypedSqlRow{{types.NewOkResult(2)}}, }, { Query: "alter table t auto_increment = 1", @@ -5485,11 +5485,11 @@ var DoltAutoIncrementTests = []queries.ScriptTest{ { // empty tables, start at 1 Query: "insert into t (b) values (7), (8)", - Expected: []sql.Row{{types.OkResult{RowsAffected: 2, InsertID: 1}}}, + Expected: []sql.UntypedSqlRow{{types.OkResult{RowsAffected: 2, InsertID: 1}}}, }, { Query: "select * from t order by a", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {1, 7}, {2, 8}, }, @@ -5513,11 +5513,11 @@ var DoltAutoIncrementTests = []queries.ScriptTest{ { // previous update was ignored Query: "insert into t (b) values (5), (6)", - Expected: []sql.Row{{types.OkResult{RowsAffected: 2, InsertID: 5}}}, + Expected: []sql.UntypedSqlRow{{types.OkResult{RowsAffected: 2, InsertID: 5}}}, }, { Query: "select * from t order by a", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {1, 1}, {2, 2}, {3, 3}, @@ -5528,7 +5528,7 @@ var DoltAutoIncrementTests = []queries.ScriptTest{ }, { Query: "insert into t (a, b) values (100, 100)", - Expected: []sql.Row{{types.OkResult{RowsAffected: 1, InsertID: 5}}}, + Expected: []sql.UntypedSqlRow{{types.OkResult{RowsAffected: 1, InsertID: 5}}}, }, { Query: "alter table t auto_increment = 50", @@ -5537,11 +5537,11 @@ var DoltAutoIncrementTests = []queries.ScriptTest{ { // previous update was ignored, value still below max on that table Query: "insert into t (b) values (101)", - Expected: []sql.Row{{types.OkResult{RowsAffected: 1, InsertID: 101}}}, + Expected: []sql.UntypedSqlRow{{types.OkResult{RowsAffected: 1, InsertID: 101}}}, }, { Query: "select * from t where a >= 100 order by a", - Expected: []sql.Row{{100, 100}, {101, 101}}, + Expected: []sql.UntypedSqlRow{{100, 100}, {101, 101}}, }, }, }, @@ -5562,15 +5562,15 @@ var DoltAutoIncrementTests = []queries.ScriptTest{ }, { Query: "insert into `mydb/branch1`.t (b) values (5), (6)", - Expected: []sql.Row{{types.OkResult{RowsAffected: 2, InsertID: 20}}}, + Expected: []sql.UntypedSqlRow{{types.OkResult{RowsAffected: 2, InsertID: 20}}}, }, { Query: "insert into t (b) values (5), (6)", - Expected: []sql.Row{{types.OkResult{RowsAffected: 2, InsertID: 22}}}, + Expected: []sql.UntypedSqlRow{{types.OkResult{RowsAffected: 2, InsertID: 22}}}, }, { Query: "select * from t order by a", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {1, 1}, {2, 2}, {3, 3}, @@ -5601,15 +5601,15 @@ var DoltAutoIncrementTests = []queries.ScriptTest{ Assertions: []queries.ScriptTestAssertion{ { Query: "delete from t", - Expected: []sql.Row{{types.NewOkResult(2)}}, + Expected: []sql.UntypedSqlRow{{types.NewOkResult(2)}}, }, { Query: "delete from `mydb/branch1`.t", - Expected: []sql.Row{{types.NewOkResult(2)}}, + Expected: []sql.UntypedSqlRow{{types.NewOkResult(2)}}, }, { Query: "delete from `mydb/branch2`.t", - Expected: []sql.Row{{types.NewOkResult(2)}}, + Expected: []sql.UntypedSqlRow{{types.NewOkResult(2)}}, }, { Query: "alter table `mydb/branch1`.t auto_increment = 1", @@ -5626,11 +5626,11 @@ var DoltAutoIncrementTests = []queries.ScriptTest{ { // empty tables, start at 1 Query: "insert into t (b) values (7), (8)", - Expected: []sql.Row{{types.OkResult{RowsAffected: 2, InsertID: 1}}}, + Expected: []sql.UntypedSqlRow{{types.OkResult{RowsAffected: 2, InsertID: 1}}}, }, { Query: "select * from t order by a", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {1, 7}, {2, 8}, }, @@ -5657,15 +5657,15 @@ var DoltAutoIncrementTests = []queries.ScriptTest{ Assertions: []queries.ScriptTestAssertion{ { Query: "delete from t", - Expected: []sql.Row{{types.NewOkResult(2)}}, + Expected: []sql.UntypedSqlRow{{types.NewOkResult(2)}}, }, { Query: "delete from `mydb/branch1`.t", - Expected: []sql.Row{{types.NewOkResult(2)}}, + Expected: []sql.UntypedSqlRow{{types.NewOkResult(2)}}, }, { Query: "delete from `mydb/branch2`.t", - Expected: []sql.Row{{types.NewOkResult(2)}}, + Expected: []sql.UntypedSqlRow{{types.NewOkResult(2)}}, }, { Query: "alter table t auto_increment = 1", @@ -5678,11 +5678,11 @@ var DoltAutoIncrementTests = []queries.ScriptTest{ { // empty tables, start at 5 (highest remaining value, update above ignored) Query: "insert into t (b) values (5), (6)", - Expected: []sql.Row{{types.OkResult{RowsAffected: 2, InsertID: 5}}}, + Expected: []sql.UntypedSqlRow{{types.OkResult{RowsAffected: 2, InsertID: 5}}}, }, { Query: "select * from t order by a", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {5, 5}, {6, 6}, }, @@ -5709,15 +5709,15 @@ var DoltAutoIncrementTests = []queries.ScriptTest{ Assertions: []queries.ScriptTestAssertion{ { Query: "truncate t", - Expected: []sql.Row{{types.NewOkResult(2)}}, + Expected: []sql.UntypedSqlRow{{types.NewOkResult(2)}}, }, { Query: "truncate `mydb/branch1`.t", - Expected: []sql.Row{{types.NewOkResult(2)}}, + Expected: []sql.UntypedSqlRow{{types.NewOkResult(2)}}, }, { Query: "truncate `mydb/branch2`.t", - Expected: []sql.Row{{types.NewOkResult(2)}}, + Expected: []sql.UntypedSqlRow{{types.NewOkResult(2)}}, }, { Query: "alter table t auto_increment = 1", @@ -5726,11 +5726,11 @@ var DoltAutoIncrementTests = []queries.ScriptTest{ { // empty tables, start at 1 Query: "insert into t (b) values (7), (8)", - Expected: []sql.Row{{types.OkResult{RowsAffected: 2, InsertID: 1}}}, + Expected: []sql.UntypedSqlRow{{types.OkResult{RowsAffected: 2, InsertID: 1}}}, }, { Query: "select * from t order by a", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {1, 7}, {2, 8}, }, @@ -5757,7 +5757,7 @@ var DoltAutoIncrementTests = []queries.ScriptTest{ Assertions: []queries.ScriptTestAssertion{ { Query: "truncate table t", - Expected: []sql.Row{{types.NewOkResult(2)}}, + Expected: []sql.UntypedSqlRow{{types.NewOkResult(2)}}, }, { Query: "call dolt_checkout('main')", @@ -5766,11 +5766,11 @@ var DoltAutoIncrementTests = []queries.ScriptTest{ { // highest value in any branch is 6 Query: "insert into t (b) values (7), (8)", - Expected: []sql.Row{{types.OkResult{RowsAffected: 2, InsertID: 7}}}, + Expected: []sql.UntypedSqlRow{{types.OkResult{RowsAffected: 2, InsertID: 7}}}, }, { Query: "select * from t order by a", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {1, 1}, {2, 2}, {7, 7}, @@ -5779,7 +5779,7 @@ var DoltAutoIncrementTests = []queries.ScriptTest{ }, { Query: "truncate table t", - Expected: []sql.Row{{types.NewOkResult(4)}}, + Expected: []sql.UntypedSqlRow{{types.NewOkResult(4)}}, }, { Query: "call dolt_checkout('branch2')", @@ -5788,11 +5788,11 @@ var DoltAutoIncrementTests = []queries.ScriptTest{ { // highest value in any branch is still 6 (truncated table above) Query: "insert into t (b) values (7), (8)", - Expected: []sql.Row{{types.OkResult{RowsAffected: 2, InsertID: 7}}}, + Expected: []sql.UntypedSqlRow{{types.OkResult{RowsAffected: 2, InsertID: 7}}}, }, { Query: "select * from t order by a", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {5, 5}, {6, 6}, {7, 7}, @@ -5801,16 +5801,16 @@ var DoltAutoIncrementTests = []queries.ScriptTest{ }, { Query: "truncate table t", - Expected: []sql.Row{{types.NewOkResult(4)}}, + Expected: []sql.UntypedSqlRow{{types.NewOkResult(4)}}, }, { // no value on any branch Query: "insert into t (b) values (1), (2)", - Expected: []sql.Row{{types.OkResult{RowsAffected: 2, InsertID: 1}}}, + Expected: []sql.UntypedSqlRow{{types.OkResult{RowsAffected: 2, InsertID: 1}}}, }, { Query: "select * from t order by a", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {1, 1}, {2, 2}, }, @@ -5839,16 +5839,16 @@ var DoltAutoIncrementTests = []queries.ScriptTest{ Assertions: []queries.ScriptTestAssertion{ { Query: "alter table t drop primary key", - Expected: []sql.Row{{types.NewOkResult(0)}}, + Expected: []sql.UntypedSqlRow{{types.NewOkResult(0)}}, }, { // highest value in any branch is 6 Query: "insert into t (b) values (7), (8)", - Expected: []sql.Row{{types.OkResult{RowsAffected: 2, InsertID: 7}}}, + Expected: []sql.UntypedSqlRow{{types.OkResult{RowsAffected: 2, InsertID: 7}}}, }, { Query: "select * from t order by a", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {1, 1}, {2, 2}, {7, 7}, @@ -5861,11 +5861,11 @@ var DoltAutoIncrementTests = []queries.ScriptTest{ }, { Query: "insert into t (b) values (9), (10)", - Expected: []sql.Row{{types.OkResult{RowsAffected: 2, InsertID: 9}}}, + Expected: []sql.UntypedSqlRow{{types.OkResult{RowsAffected: 2, InsertID: 9}}}, }, { Query: "select * from t order by a", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {5, 5}, {6, 6}, {9, 9}, @@ -5874,15 +5874,15 @@ var DoltAutoIncrementTests = []queries.ScriptTest{ }, { Query: "alter table t drop primary key", - Expected: []sql.Row{{types.NewOkResult(0)}}, + Expected: []sql.UntypedSqlRow{{types.NewOkResult(0)}}, }, { Query: "insert into t (b) values (11), (12)", - Expected: []sql.Row{{types.OkResult{RowsAffected: 2, InsertID: 11}}}, + Expected: []sql.UntypedSqlRow{{types.OkResult{RowsAffected: 2, InsertID: 11}}}, }, { Query: "select * from t order by a", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {5, 5}, {6, 6}, {9, 9}, @@ -5905,13 +5905,13 @@ var DoltAutoIncrementTests = []queries.ScriptTest{ Assertions: []queries.ScriptTestAssertion{ { Query: "insert into t(b) values (3)", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {types.OkResult{RowsAffected: 1, InsertID: 3}}, }, }, { Query: "select * from t order by a", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {1, 1}, {2, 2}, {3, 3}, @@ -5932,13 +5932,13 @@ var DoltAutoIncrementTests = []queries.ScriptTest{ Assertions: []queries.ScriptTestAssertion{ { Query: "insert into t(b) values (5)", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {types.OkResult{RowsAffected: 1, InsertID: 5}}, }, }, { Query: "select * from t order by a", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {1, 1}, {2, 2}, {5, 5}, @@ -5962,13 +5962,13 @@ var DoltAutoIncrementTests = []queries.ScriptTest{ Assertions: []queries.ScriptTestAssertion{ { Query: "insert into t(b) values (101)", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {types.OkResult{RowsAffected: 1, InsertID: 101}}, }, }, { Query: "select * from t order by a", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {1, 1}, {2, 2}, {101, 101}, @@ -6019,7 +6019,7 @@ var DoltCherryPickTests = []queries.ScriptTest{ Assertions: []queries.ScriptTestAssertion{ { Query: "CALL dolt_merge('--no-ff', 'branch1');", - Expected: []sql.Row{{doltCommit, 0, 0, "merge successful"}}, + Expected: []sql.UntypedSqlRow{{doltCommit, 0, 0, "merge successful"}}, }, { Query: "CALL dolt_cherry_pick('HEAD');", @@ -6046,7 +6046,7 @@ var DoltCherryPickTests = []queries.ScriptTest{ }, { Query: "call dolt_add('t');", - Expected: []sql.Row{{0}}, + Expected: []sql.UntypedSqlRow{{0}}, }, { Query: "CALL Dolt_Cherry_Pick(@commit1);", @@ -6089,28 +6089,28 @@ var DoltCherryPickTests = []queries.ScriptTest{ Assertions: []queries.ScriptTestAssertion{ { Query: "SELECT * FROM t;", - Expected: []sql.Row{}, + Expected: []sql.UntypedSqlRow{}, }, { Query: "call dolt_cherry_pick(@commit2);", - Expected: []sql.Row{{doltCommit, 0, 0, 0}}, + Expected: []sql.UntypedSqlRow{{doltCommit, 0, 0, 0}}, }, { Query: "SELECT * FROM t;", - Expected: []sql.Row{{2, "two"}}, + Expected: []sql.UntypedSqlRow{{2, "two"}}, }, { Query: "call dolt_cherry_pick(@commit1);", - Expected: []sql.Row{{doltCommit, 0, 0, 0}}, + Expected: []sql.UntypedSqlRow{{doltCommit, 0, 0, 0}}, }, { Query: "SELECT * FROM t order by pk;", - Expected: []sql.Row{{1, "one"}, {2, "two"}}, + Expected: []sql.UntypedSqlRow{{1, "one"}, {2, "two"}}, }, { // Assert that our new commit only has one parent (i.e. not a merge commit) Query: "select count(*) from dolt_commit_ancestors where commit_hash = hashof('HEAD');", - Expected: []sql.Row{{1}}, + Expected: []sql.UntypedSqlRow{{1}}, }, }, }, @@ -6128,15 +6128,15 @@ var DoltCherryPickTests = []queries.ScriptTest{ Assertions: []queries.ScriptTestAssertion{ { Query: "SELECT * FROM keyless;", - Expected: []sql.Row{}, + Expected: []sql.UntypedSqlRow{}, }, { Query: "CALL DOLT_CHERRY_PICK('branch1');", - Expected: []sql.Row{{doltCommit, 0, 0, 0}}, + Expected: []sql.UntypedSqlRow{{doltCommit, 0, 0, 0}}, }, { Query: "SELECT * FROM keyless;", - Expected: []sql.Row{{1, "1"}, {2, "3"}}, + Expected: []sql.UntypedSqlRow{{1, "1"}, {2, "3"}}, }, }, }, @@ -6153,24 +6153,24 @@ var DoltCherryPickTests = []queries.ScriptTest{ Assertions: []queries.ScriptTestAssertion{ { Query: "SHOW TABLES;", - Expected: []sql.Row{}, + Expected: []sql.UntypedSqlRow{}, }, { Query: "call dolt_cherry_pick(@commit1);", - Expected: []sql.Row{{doltCommit, 0, 0, 0}}, + Expected: []sql.UntypedSqlRow{{doltCommit, 0, 0, 0}}, }, { // Assert that our new commit only has one parent (i.e. not a merge commit) Query: "select count(*) from dolt_commit_ancestors where commit_hash = hashof('HEAD');", - Expected: []sql.Row{{1}}, + Expected: []sql.UntypedSqlRow{{1}}, }, { Query: "SHOW TABLES;", - Expected: []sql.Row{{"table_a"}}, + Expected: []sql.UntypedSqlRow{{"table_a"}}, }, { Query: "SELECT * FROM table_a;", - Expected: []sql.Row{{11, "aa"}, {22, "ab"}}, + Expected: []sql.UntypedSqlRow{{11, "aa"}, {22, "ab"}}, }, }, }, @@ -6189,15 +6189,15 @@ var DoltCherryPickTests = []queries.ScriptTest{ Assertions: []queries.ScriptTestAssertion{ { Query: "SHOW TABLES;", - Expected: []sql.Row{{"dropme"}}, + Expected: []sql.UntypedSqlRow{{"dropme"}}, }, { Query: "call dolt_cherry_pick(@commit1);", - Expected: []sql.Row{{doltCommit, 0, 0, 0}}, + Expected: []sql.UntypedSqlRow{{doltCommit, 0, 0, 0}}, }, { Query: "SHOW TABLES;", - Expected: []sql.Row{}, + Expected: []sql.UntypedSqlRow{}, }, }, }, @@ -6215,11 +6215,11 @@ var DoltCherryPickTests = []queries.ScriptTest{ Assertions: []queries.ScriptTestAssertion{ { Query: "call dolt_cherry_pick(@commit1);", - Expected: []sql.Row{{doltCommit, 0, 0, 0}}, + Expected: []sql.UntypedSqlRow{{doltCommit, 0, 0, 0}}, }, { Query: "SHOW CREATE TABLE test;", - Expected: []sql.Row{{"test", "CREATE TABLE `test` (\n `pk` int NOT NULL,\n `v` varchar(100),\n PRIMARY KEY (`pk`)\n) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_bin"}}, + Expected: []sql.UntypedSqlRow{{"test", "CREATE TABLE `test` (\n `pk` int NOT NULL,\n `v` varchar(100),\n PRIMARY KEY (`pk`)\n) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_bin"}}, }, }, }, @@ -6237,11 +6237,11 @@ var DoltCherryPickTests = []queries.ScriptTest{ Assertions: []queries.ScriptTestAssertion{ { Query: "call dolt_cherry_pick(@commit1);", - Expected: []sql.Row{{doltCommit, 0, 0, 0}}, + Expected: []sql.UntypedSqlRow{{doltCommit, 0, 0, 0}}, }, { Query: "SHOW CREATE TABLE test;", - Expected: []sql.Row{{"test", "CREATE TABLE `test` (\n `pk` int NOT NULL,\n PRIMARY KEY (`pk`)\n) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_bin"}}, + Expected: []sql.UntypedSqlRow{{"test", "CREATE TABLE `test` (\n `pk` int NOT NULL,\n PRIMARY KEY (`pk`)\n) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_bin"}}, }, }, }, @@ -6259,11 +6259,11 @@ var DoltCherryPickTests = []queries.ScriptTest{ Assertions: []queries.ScriptTestAssertion{ { Query: "call dolt_cherry_pick(@commit1);", - Expected: []sql.Row{{doltCommit, 0, 0, 0}}, + Expected: []sql.UntypedSqlRow{{doltCommit, 0, 0, 0}}, }, { Query: "SHOW CREATE TABLE test;", - Expected: []sql.Row{{"test", "CREATE TABLE `test` (\n `pk` int NOT NULL,\n `v2` varchar(100),\n PRIMARY KEY (`pk`)\n) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_bin"}}, + Expected: []sql.UntypedSqlRow{{"test", "CREATE TABLE `test` (\n `pk` int NOT NULL,\n `v2` varchar(100),\n PRIMARY KEY (`pk`)\n) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_bin"}}, }, }, }, @@ -6284,29 +6284,29 @@ var DoltCherryPickTests = []queries.ScriptTest{ Assertions: []queries.ScriptTestAssertion{ { Query: "call dolt_cherry_pick(hashof('branch1'));", - Expected: []sql.Row{{"", 1, 0, 0}}, + Expected: []sql.UntypedSqlRow{{"", 1, 0, 0}}, }, { Query: "select * from dolt_conflicts;", - Expected: []sql.Row{{"t", uint64(1)}}, + Expected: []sql.UntypedSqlRow{{"t", uint64(1)}}, }, { Query: "select base_pk, base_v, our_pk, our_diff_type, their_pk, their_diff_type from dolt_conflicts_t;", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {1, "uno", 1, "modified", 1, "modified"}, }, }, { Query: "call dolt_cherry_pick('--abort');", - Expected: []sql.Row{{"", 0, 0, 0}}, + Expected: []sql.UntypedSqlRow{{"", 0, 0, 0}}, }, { Query: "select * from dolt_conflicts;", - Expected: []sql.Row{}, + Expected: []sql.UntypedSqlRow{}, }, { Query: "select * from t;", - Expected: []sql.Row{{1, "one"}}, + Expected: []sql.UntypedSqlRow{{1, "one"}}, }, }, }, @@ -6328,29 +6328,29 @@ var DoltCherryPickTests = []queries.ScriptTest{ Assertions: []queries.ScriptTestAssertion{ { Query: "call dolt_cherry_pick(hashof('branch1'));", - Expected: []sql.Row{{"", 1, 0, 0}}, + Expected: []sql.UntypedSqlRow{{"", 1, 0, 0}}, }, { Query: "select * from dolt_conflicts;", - Expected: []sql.Row{{"t", uint64(1)}}, + Expected: []sql.UntypedSqlRow{{"t", uint64(1)}}, }, { Query: "select base_pk, base_v, our_pk, our_diff_type, their_pk, their_diff_type from dolt_conflicts_t;", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {1, "uno", 1, "modified", 1, "modified"}, }, }, { Query: "call dolt_cherry_pick('--abort');", - Expected: []sql.Row{{"", 0, 0, 0}}, + Expected: []sql.UntypedSqlRow{{"", 0, 0, 0}}, }, { Query: "select * from dolt_conflicts;", - Expected: []sql.Row{}, + Expected: []sql.UntypedSqlRow{}, }, { Query: "select * from t;", - Expected: []sql.Row{{1, "one"}}, + Expected: []sql.UntypedSqlRow{{1, "one"}}, }, }, }, @@ -6371,46 +6371,46 @@ var DoltCherryPickTests = []queries.ScriptTest{ Assertions: []queries.ScriptTestAssertion{ { Query: "call dolt_cherry_pick(hashof('branch1'));", - Expected: []sql.Row{{"", 1, 0, 0}}, + Expected: []sql.UntypedSqlRow{{"", 1, 0, 0}}, }, { Query: "select * from dolt_conflicts;", - Expected: []sql.Row{{"t", uint64(1)}}, + Expected: []sql.UntypedSqlRow{{"t", uint64(1)}}, }, { Query: "select * from dolt_status", - Expected: []sql.Row{{"t", false, "modified"}, {"t", false, "conflict"}}, + Expected: []sql.UntypedSqlRow{{"t", false, "modified"}, {"t", false, "conflict"}}, }, { Query: "select base_pk, base_v, our_pk, our_diff_type, their_pk, their_diff_type from dolt_conflicts_t;", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {1, "uno", 1, "modified", 1, "modified"}, }, }, { Query: "call dolt_conflicts_resolve('--ours', 't');", - Expected: []sql.Row{{0}}, + Expected: []sql.UntypedSqlRow{{0}}, }, { Query: "select * from dolt_status", - Expected: []sql.Row{{"t", false, "modified"}}, + Expected: []sql.UntypedSqlRow{{"t", false, "modified"}}, }, { Query: "select * from dolt_conflicts;", - Expected: []sql.Row{}, + Expected: []sql.UntypedSqlRow{}, }, { Query: "select * from t;", - Expected: []sql.Row{{1}}, + Expected: []sql.UntypedSqlRow{{1}}, }, { Query: "call dolt_commit('-am', 'committing cherry-pick');", - Expected: []sql.Row{{doltCommit}}, + Expected: []sql.UntypedSqlRow{{doltCommit}}, }, { // Assert that our new commit only has one parent (i.e. not a merge commit) Query: "select count(*) from dolt_commit_ancestors where commit_hash = hashof('HEAD');", - Expected: []sql.Row{{1}}, + Expected: []sql.UntypedSqlRow{{1}}, }, }, }, @@ -6434,52 +6434,52 @@ var DoltCherryPickTests = []queries.ScriptTest{ Assertions: []queries.ScriptTestAssertion{ { Query: "SELECT * from dolt_status;", - Expected: []sql.Row{}, + Expected: []sql.UntypedSqlRow{}, }, { Query: "SELECT * from t;", - Expected: []sql.Row{{1, "one"}}, + Expected: []sql.UntypedSqlRow{{1, "one"}}, }, { Query: `CALL dolt_cherry_pick(@commit2);`, - Expected: []sql.Row{{"", 1, 0, 0}}, + Expected: []sql.UntypedSqlRow{{"", 1, 0, 0}}, }, { Query: `SELECT * FROM dolt_conflicts;`, - Expected: []sql.Row{{"t", uint64(1)}}, + Expected: []sql.UntypedSqlRow{{"t", uint64(1)}}, }, { Query: `commit;`, - Expected: []sql.Row{}, + Expected: []sql.UntypedSqlRow{}, }, { Query: `SELECT * FROM dolt_conflicts;`, - Expected: []sql.Row{{"t", uint64(1)}}, + Expected: []sql.UntypedSqlRow{{"t", uint64(1)}}, }, { Query: `SELECT base_pk, base_c1, our_pk, our_c1, their_diff_type, their_pk, their_c1 FROM dolt_conflicts_t;`, - Expected: []sql.Row{{1, "uno", 1, "one", "modified", 1, "ein"}}, + Expected: []sql.UntypedSqlRow{{1, "uno", 1, "one", "modified", 1, "ein"}}, }, { Query: `SELECT * FROM t;`, - Expected: []sql.Row{{1, "one"}}, + Expected: []sql.UntypedSqlRow{{1, "one"}}, }, { Query: `call dolt_conflicts_resolve('--theirs', 't');`, - Expected: []sql.Row{{0}}, + Expected: []sql.UntypedSqlRow{{0}}, }, { Query: `SELECT * FROM t;`, - Expected: []sql.Row{{1, "ein"}}, + Expected: []sql.UntypedSqlRow{{1, "ein"}}, }, { Query: "call dolt_commit('-am', 'committing cherry-pick');", - Expected: []sql.Row{{doltCommit}}, + Expected: []sql.UntypedSqlRow{{doltCommit}}, }, { // Assert that our new commit only has one parent (i.e. not a merge commit) Query: "select count(*) from dolt_commit_ancestors where commit_hash = hashof('HEAD');", - Expected: []sql.Row{{1}}, + Expected: []sql.UntypedSqlRow{{1}}, }, }, }, @@ -6507,15 +6507,15 @@ var DoltCherryPickTests = []queries.ScriptTest{ Assertions: []queries.ScriptTestAssertion{ { Query: "call dolt_cherry_pick(hashof('branch1'));", - Expected: []sql.Row{{"", 1, 0, 0}}, + Expected: []sql.UntypedSqlRow{{"", 1, 0, 0}}, }, { Query: "select * from dolt_conflicts;", - Expected: []sql.Row{{"t", uint64(1)}}, + Expected: []sql.UntypedSqlRow{{"t", uint64(1)}}, }, { Query: "select base_pk, base_v, our_pk, our_diff_type, their_pk, their_diff_type from dolt_conflicts_t;", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {1, "uno", 1, "modified", 1, "modified"}, }, }, @@ -6531,32 +6531,32 @@ var DoltCherryPickTests = []queries.ScriptTest{ */ { Query: "call dolt_cherry_pick('--abort');", - Expected: []sql.Row{{"", 0, 0, 0}}, + Expected: []sql.UntypedSqlRow{{"", 0, 0, 0}}, }, { Query: "select * from dolt_conflicts;", - Expected: []sql.Row{}, + Expected: []sql.UntypedSqlRow{}, }, { Query: "select * from t;", - Expected: []sql.Row{{1, "one"}}, + Expected: []sql.UntypedSqlRow{{1, "one"}}, }, { // An ignored table should still be present (and unstaged) after aborting the merge. Query: "select * from dolt_status;", - Expected: []sql.Row{{"generated_foo", false, "new table"}}, + Expected: []sql.UntypedSqlRow{{"generated_foo", false, "new table"}}, }, { // Changes made to the table during the merge should not be reverted. Query: "select * from generated_foo;", - Expected: []sql.Row{{1}, {2}}, + Expected: []sql.UntypedSqlRow{{1}, {2}}, }, /*{ // TODO: https://github.com/dolthub/dolt/issues/7411 // The table that was force-added should be treated like any other table // and reverted to its state before the merge began. Query: "select * from generated_bar;", - Expected: []sql.Row{{1}}, + Expected: []sql.UntypedSqlRow{{1}}, },*/ }, }, @@ -6575,56 +6575,56 @@ var DoltCommitTests = []queries.ScriptTest{ Assertions: []queries.ScriptTestAssertion{ { Query: "SELECT * from t;", - Expected: []sql.Row{{1}}, + Expected: []sql.UntypedSqlRow{{1}}, }, // update a table { Query: "DELETE from t where pk = 1;", - Expected: []sql.Row{{types.NewOkResult(1)}}, + Expected: []sql.UntypedSqlRow{{types.NewOkResult(1)}}, }, { Query: "CALL DOLT_COMMIT('-ALL', '-m', 'update table terminator');", - Expected: []sql.Row{{doltCommit}}, + Expected: []sql.UntypedSqlRow{{doltCommit}}, }, // check last commit { Query: "select message from dolt_log limit 1", - Expected: []sql.Row{{"update table terminator"}}, + Expected: []sql.UntypedSqlRow{{"update table terminator"}}, }, // amend last commit { Query: "CALL DOLT_COMMIT('-amend', '-m', 'update table t');", - Expected: []sql.Row{{doltCommit}}, + Expected: []sql.UntypedSqlRow{{doltCommit}}, }, // check amended commit { Query: "SELECT * from t;", - Expected: []sql.Row{}, + Expected: []sql.UntypedSqlRow{}, }, { Query: "select message from dolt_log limit 1", - Expected: []sql.Row{{"update table t"}}, + Expected: []sql.UntypedSqlRow{{"update table t"}}, }, { Query: "CALL DOLT_RESET('--hard');", - Expected: []sql.Row{{0}}, + Expected: []sql.UntypedSqlRow{{0}}, }, { Query: "SELECT * from t;", - Expected: []sql.Row{}, + Expected: []sql.UntypedSqlRow{}, }, // delete a table { Query: "DROP TABLE t;", - Expected: []sql.Row{{types.NewOkResult(0)}}, + Expected: []sql.UntypedSqlRow{{types.NewOkResult(0)}}, }, { Query: "CALL DOLT_COMMIT('-Am', 'drop table t');", - Expected: []sql.Row{{doltCommit}}, + Expected: []sql.UntypedSqlRow{{doltCommit}}, }, { Query: "CALL DOLT_RESET('--hard');", - Expected: []sql.Row{{0}}, + Expected: []sql.UntypedSqlRow{{0}}, }, { Query: "SELECT * from t;", @@ -6633,29 +6633,29 @@ var DoltCommitTests = []queries.ScriptTest{ // create a table { Query: "CREATE table t2 (pk int primary key);", - Expected: []sql.Row{{types.NewOkResult(0)}}, + Expected: []sql.UntypedSqlRow{{types.NewOkResult(0)}}, }, { Query: "CALL DOLT_COMMIT('-Am', 'add table 21');", - Expected: []sql.Row{{doltCommit}}, + Expected: []sql.UntypedSqlRow{{doltCommit}}, }, // amend last commit { Query: "CALL DOLT_COMMIT('-amend', '-m', 'add table 2');", - Expected: []sql.Row{{doltCommit}}, + Expected: []sql.UntypedSqlRow{{doltCommit}}, }, // check amended commit { Query: "select message from dolt_log limit 1", - Expected: []sql.Row{{"add table 2"}}, + Expected: []sql.UntypedSqlRow{{"add table 2"}}, }, { Query: "CALL DOLT_RESET('--hard');", - Expected: []sql.Row{{0}}, + Expected: []sql.UntypedSqlRow{{0}}, }, { Query: "SELECT * from t2;", - Expected: []sql.Row{}, + Expected: []sql.UntypedSqlRow{}, }, }, }, @@ -6670,7 +6670,7 @@ var DoltCommitTests = []queries.ScriptTest{ Assertions: []queries.ScriptTestAssertion{ { Query: "SELECT message from dolt_log where message = 'author: somebody'", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {"author: somebody"}, }, }, @@ -6688,7 +6688,7 @@ var DoltCommitTests = []queries.ScriptTest{ Assertions: []queries.ScriptTestAssertion{ { Query: "SELECT message FROM dolt_log;", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {"original commit message"}, {"author: somebody"}, {"add table 2"}, @@ -6701,15 +6701,15 @@ var DoltCommitTests = []queries.ScriptTest{ }, { Query: "SELECT to_id, from_id, diff_type FROM dolt_diff_tEST;", - Expected: []sql.Row{{2, nil, "added"}}, + Expected: []sql.UntypedSqlRow{{2, nil, "added"}}, }, { Query: "CALL DOLT_COMMIT('--amend', '-m', 'amended commit message');", - Expected: []sql.Row{{doltCommit}}, + Expected: []sql.UntypedSqlRow{{doltCommit}}, }, { Query: "SELECT message FROM dolt_log;", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {"amended commit message"}, {"author: somebody"}, {"add table 2"}, @@ -6722,7 +6722,7 @@ var DoltCommitTests = []queries.ScriptTest{ }, { Query: "SELECT to_id, from_id, diff_type FROM dolt_diff_test;", - Expected: []sql.Row{{2, nil, "added"}}, + Expected: []sql.UntypedSqlRow{{2, nil, "added"}}, }, }, }, @@ -6737,18 +6737,18 @@ var DoltCommitTests = []queries.ScriptTest{ Assertions: []queries.ScriptTestAssertion{ { Query: "SELECT to_id, from_id, diff_type FROM dolt_diff_test;", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {3, nil, "added"}, {2, nil, "added"}, }, }, { Query: "SELECT COUNT(*) FROM dolt_status;", - Expected: []sql.Row{{0}}, + Expected: []sql.UntypedSqlRow{{0}}, }, { Query: "SELECT message FROM dolt_log;", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {"original commit message for adding changes to a commit"}, {"amended commit message"}, {"author: somebody"}, @@ -6762,23 +6762,23 @@ var DoltCommitTests = []queries.ScriptTest{ }, { Query: "INSERT INTO test (id) VALUES (4)", - Expected: []sql.Row{{types.NewOkResult(1)}}, + Expected: []sql.UntypedSqlRow{{types.NewOkResult(1)}}, }, { Query: "SELECT COUNT(*) FROM dolt_status;", - Expected: []sql.Row{{1}}, + Expected: []sql.UntypedSqlRow{{1}}, }, { Query: "CALL DOLT_ADD('.');", - Expected: []sql.Row{{0}}, + Expected: []sql.UntypedSqlRow{{0}}, }, { Query: "CALL DOLT_COMMIT('--amend');", - Expected: []sql.Row{{doltCommit}}, + Expected: []sql.UntypedSqlRow{{doltCommit}}, }, { Query: "SELECT message FROM dolt_log;", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {"original commit message for adding changes to a commit"}, {"amended commit message"}, {"author: somebody"}, @@ -6792,7 +6792,7 @@ var DoltCommitTests = []queries.ScriptTest{ }, { Query: "SELECT to_id, from_id, diff_type FROM dolt_diff_test;", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {4, nil, "added"}, {3, nil, "added"}, {2, nil, "added"}, @@ -6800,27 +6800,27 @@ var DoltCommitTests = []queries.ScriptTest{ }, { Query: "INSERT INTO test (id) VALUES (5)", - Expected: []sql.Row{{types.NewOkResult(1)}}, + Expected: []sql.UntypedSqlRow{{types.NewOkResult(1)}}, }, { Query: "SELECT COUNT(*) FROM dolt_status;", - Expected: []sql.Row{{1}}, + Expected: []sql.UntypedSqlRow{{1}}, }, { Query: "CALL DOLT_ADD('.');", - Expected: []sql.Row{{0}}, + Expected: []sql.UntypedSqlRow{{0}}, }, { Query: "CALL DOLT_COMMIT('--amend', '-m', 'amended commit with added changes');", - Expected: []sql.Row{{doltCommit}}, + Expected: []sql.UntypedSqlRow{{doltCommit}}, }, { Query: "SELECT COUNT(*) FROM dolt_status;", - Expected: []sql.Row{{0}}, + Expected: []sql.UntypedSqlRow{{0}}, }, { Query: "SELECT message FROM dolt_log;", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {"amended commit with added changes"}, {"amended commit message"}, {"author: somebody"}, @@ -6834,7 +6834,7 @@ var DoltCommitTests = []queries.ScriptTest{ }, { Query: "SELECT to_id, from_id, diff_type FROM dolt_diff_test;", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {5, nil, "added"}, {4, nil, "added"}, {3, nil, "added"}, @@ -6855,11 +6855,11 @@ var DoltCommitTests = []queries.ScriptTest{ Assertions: []queries.ScriptTestAssertion{ { Query: "SELECT * FROM test;", - Expected: []sql.Row{{2}, {3}, {4}, {5}, {6}, {7}}, + Expected: []sql.UntypedSqlRow{{2}, {3}, {4}, {5}, {6}, {7}}, }, { Query: "SELECT to_id, from_id, diff_type FROM dolt_diff_test;", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {7, nil, "added"}, {6, nil, "added"}, {5, nil, "added"}, @@ -6870,23 +6870,23 @@ var DoltCommitTests = []queries.ScriptTest{ }, { Query: "DELETE FROM test WHERE id = 6", - Expected: []sql.Row{{types.NewOkResult(1)}}, + Expected: []sql.UntypedSqlRow{{types.NewOkResult(1)}}, }, { Query: "CALL DOLT_ADD('.');", - Expected: []sql.Row{{0}}, + Expected: []sql.UntypedSqlRow{{0}}, }, { Query: "CALL DOLT_COMMIT('--amend', '-m', 'amended commit with removed changes');", - Expected: []sql.Row{{doltCommit}}, + Expected: []sql.UntypedSqlRow{{doltCommit}}, }, { Query: "SELECT * FROM test;", - Expected: []sql.Row{{2}, {3}, {4}, {5}, {7}}, + Expected: []sql.UntypedSqlRow{{2}, {3}, {4}, {5}, {7}}, }, { Query: "SELECT message FROM dolt_log;", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {"amended commit with removed changes"}, {"amended commit with added changes"}, {"amended commit message"}, @@ -6901,7 +6901,7 @@ var DoltCommitTests = []queries.ScriptTest{ }, { Query: "SELECT to_id, from_id, diff_type FROM dolt_diff_test;", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {7, nil, "added"}, {5, nil, "added"}, {4, nil, "added"}, @@ -6937,11 +6937,11 @@ var DoltCommitTests = []queries.ScriptTest{ Assertions: []queries.ScriptTestAssertion{ { Query: "CALL DOLT_COMMIT('--amend', '-m', 'new merge');", - Expected: []sql.Row{{doltCommit}}, + Expected: []sql.UntypedSqlRow{{doltCommit}}, }, { Query: "SELECT message FROM dolt_log;", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {"new merge"}, {"original commit message"}, {"conflicting commit message"}, @@ -6960,11 +6960,11 @@ var DoltCommitTests = []queries.ScriptTest{ }, { Query: "SET @hash=(SELECT commit_hash FROM dolt_log LIMIT 1);", - Expected: []sql.Row{{}}, + Expected: []sql.UntypedSqlRow{{}}, }, { Query: "SELECT COUNT(parent_hash) FROM dolt_commit_ancestors WHERE commit_hash= @hash;", - Expected: []sql.Row{{2}}, + Expected: []sql.UntypedSqlRow{{2}}, }, }, }, @@ -6979,11 +6979,11 @@ var DoltIndexPrefixScripts = []queries.ScriptTest{ Assertions: []queries.ScriptTestAssertion{ { Query: "show create table t", - Expected: []sql.Row{{"t", "CREATE TABLE `t` (\n `i` int NOT NULL,\n `v1` varchar(10),\n `v2` varchar(10),\n PRIMARY KEY (`i`),\n UNIQUE KEY `v1` (`v1`(3),`v2`(5))\n) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci"}}, + Expected: []sql.UntypedSqlRow{{"t", "CREATE TABLE `t` (\n `i` int NOT NULL,\n `v1` varchar(10),\n `v2` varchar(10),\n PRIMARY KEY (`i`),\n UNIQUE KEY `v1` (`v1`(3),`v2`(5))\n) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci"}}, }, { Query: "insert into t values (0, 'a', 'a'), (1, 'ab','ab'), (2, 'abc', 'abc'), (3, 'abcde', 'abcde')", - Expected: []sql.Row{{types.NewOkResult(4)}}, + Expected: []sql.UntypedSqlRow{{types.NewOkResult(4)}}, }, { Query: "insert into t values (99, 'ABC', 'ABCDE')", @@ -7003,43 +7003,43 @@ var DoltIndexPrefixScripts = []queries.ScriptTest{ }, { Query: "select * from t where v1 = 'A'", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {0, "a", "a"}, }, }, { Query: "select * from t where v1 = 'ABC'", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {2, "abc", "abc"}, }, }, { Query: "select * from t where v1 = 'ABCD'", - Expected: []sql.Row{}, + Expected: []sql.UntypedSqlRow{}, }, { Query: "select * from t where v1 > 'A' and v1 < 'ABCDE'", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {1, "ab", "ab"}, {2, "abc", "abc"}, }, }, { Query: "select * from t where v1 > 'A' and v2 < 'ABCDE'", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {1, "ab", "ab"}, {2, "abc", "abc"}, }, }, { Query: "update t set v1 = concat(v1, 'Z') where v1 >= 'A'", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {types.OkResult{RowsAffected: 4, InsertID: 0, Info: plan.UpdateInfo{Matched: 4, Updated: 4}}}, }, }, { Query: "select * from t", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {0, "aZ", "a"}, {1, "abZ", "ab"}, {2, "abcZ", "abc"}, @@ -7048,13 +7048,13 @@ var DoltIndexPrefixScripts = []queries.ScriptTest{ }, { Query: "delete from t where v1 >= 'A'", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {types.OkResult{RowsAffected: 4}}, }, }, { Query: "select * from t", - Expected: []sql.Row{}, + Expected: []sql.UntypedSqlRow{}, }, }, }, @@ -7067,11 +7067,11 @@ var DoltIndexPrefixScripts = []queries.ScriptTest{ Assertions: []queries.ScriptTestAssertion{ { Query: "alter table t modify column j int", - Expected: []sql.Row{{types.OkResult{}}}, + Expected: []sql.UntypedSqlRow{{types.OkResult{}}}, }, { Query: "show create table t", - Expected: []sql.Row{{"t", "CREATE TABLE `t` (\n `j` int,\n KEY `j` (`j`)\n) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_bin"}}, + Expected: []sql.UntypedSqlRow{{"t", "CREATE TABLE `t` (\n `j` int,\n KEY `j` (`j`)\n) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_bin"}}, }, }, }, @@ -7083,11 +7083,11 @@ var DoltIndexPrefixScripts = []queries.ScriptTest{ Assertions: []queries.ScriptTestAssertion{ { Query: "alter table t modify column j varchar(2)", - Expected: []sql.Row{{types.OkResult{}}}, + Expected: []sql.UntypedSqlRow{{types.OkResult{}}}, }, { Query: "show create table t", - Expected: []sql.Row{{"t", "CREATE TABLE `t` (\n `j` varchar(2),\n KEY `j` (`j`)\n) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_bin"}}, + Expected: []sql.UntypedSqlRow{{"t", "CREATE TABLE `t` (\n `j` varchar(2),\n KEY `j` (`j`)\n) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_bin"}}, }, }, }, @@ -7099,11 +7099,11 @@ var DoltIndexPrefixScripts = []queries.ScriptTest{ Assertions: []queries.ScriptTestAssertion{ { Query: "alter table t modify column j varchar(200)", - Expected: []sql.Row{{types.OkResult{}}}, + Expected: []sql.UntypedSqlRow{{types.OkResult{}}}, }, { Query: "show create table t", - Expected: []sql.Row{{"t", "CREATE TABLE `t` (\n `j` varchar(200),\n KEY `j` (`j`(10))\n) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_bin"}}, + Expected: []sql.UntypedSqlRow{{"t", "CREATE TABLE `t` (\n `j` varchar(200),\n KEY `j` (`j`(10))\n) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_bin"}}, }, }, }, @@ -7115,11 +7115,11 @@ var DoltIndexPrefixScripts = []queries.ScriptTest{ Assertions: []queries.ScriptTestAssertion{ { Query: "alter table t modify column j int", - Expected: []sql.Row{{types.OkResult{}}}, + Expected: []sql.UntypedSqlRow{{types.OkResult{}}}, }, { Query: "show create table t", - Expected: []sql.Row{{"t", "CREATE TABLE `t` (\n `i` varchar(100),\n `j` int,\n KEY `i` (`i`(10),`j`)\n) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_bin"}}, + Expected: []sql.UntypedSqlRow{{"t", "CREATE TABLE `t` (\n `i` varchar(100),\n `j` int,\n KEY `i` (`i`(10),`j`)\n) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_bin"}}, }, }, }, @@ -7175,15 +7175,15 @@ END`, Assertions: []queries.ScriptTestAssertion{ { Query: "CALL p1();", - Expected: []sql.Row{{"cd"}}, + Expected: []sql.UntypedSqlRow{{"cd"}}, }, { Query: "CALL `mydb/main`.p1();", - Expected: []sql.Row{{"cd"}}, + Expected: []sql.UntypedSqlRow{{"cd"}}, }, { Query: "CALL `mydb/p12`.p1();", - Expected: []sql.Row{{"ab"}}, + Expected: []sql.UntypedSqlRow{{"ab"}}, }, }, }, @@ -7215,23 +7215,23 @@ END`, Assertions: []queries.ScriptTestAssertion{ { Query: "CALL p1();", - Expected: []sql.Row{{4}}, + Expected: []sql.UntypedSqlRow{{4}}, }, { Query: "CALL p1() AS OF 'HEAD';", - Expected: []sql.Row{{4}}, + Expected: []sql.UntypedSqlRow{{4}}, }, { Query: "CALL p1() AS OF 'HEAD~1';", - Expected: []sql.Row{{3}}, + Expected: []sql.UntypedSqlRow{{3}}, }, { Query: "CALL p1() AS OF 'HEAD~2';", - Expected: []sql.Row{{2}}, + Expected: []sql.UntypedSqlRow{{2}}, }, { Query: "CALL p1() AS OF 'HEAD~3';", - Expected: []sql.Row{{1}}, + Expected: []sql.UntypedSqlRow{{1}}, }, }, }, @@ -7260,7 +7260,7 @@ END`, Assertions: []queries.ScriptTestAssertion{ { Query: "CALL p1();", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {int64(1), "first row, 3", "1"}, {int64(2), "second row, 3", "2"}, {int64(3), "third row, 3", "3"}, @@ -7268,7 +7268,7 @@ END`, }, { Query: "CALL p1a();", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {int64(1), "first row, 1"}, {int64(2), "second row, 1"}, {int64(3), "third row, 1"}, @@ -7276,7 +7276,7 @@ END`, }, { Query: "CALL p1b();", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {int64(1), "first row, 2"}, {int64(2), "second row, 2"}, {int64(3), "third row, 2"}, @@ -7284,7 +7284,7 @@ END`, }, { Query: "CALL p2();", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {int64(1), "first row, 3", "1"}, {int64(2), "second row, 3", "2"}, {int64(3), "third row, 3", "3"}, @@ -7292,7 +7292,7 @@ END`, }, { Query: "CALL p2a();", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {int64(1), "first row, 2"}, {int64(2), "second row, 2"}, {int64(3), "third row, 2"}, @@ -7300,7 +7300,7 @@ END`, }, { Query: "CALL p1() AS OF 'HEAD~2';", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {int64(1), "first row, 1"}, {int64(2), "second row, 1"}, {int64(3), "third row, 1"}, @@ -7308,7 +7308,7 @@ END`, }, { Query: "CALL p1a() AS OF 'HEAD';", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {int64(1), "first row, 1"}, {int64(2), "second row, 1"}, {int64(3), "third row, 1"}, @@ -7316,7 +7316,7 @@ END`, }, { Query: "CALL p1b() AS OF 'HEAD';", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {int64(1), "first row, 2"}, {int64(2), "second row, 2"}, {int64(3), "third row, 2"}, @@ -7324,7 +7324,7 @@ END`, }, { Query: "CALL p2() AS OF 'HEAD~2';", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {int64(1), "first row, 1"}, {int64(2), "second row, 1"}, {int64(3), "third row, 1"}, @@ -7332,7 +7332,7 @@ END`, }, { Query: "CALL p2a() AS OF 'HEAD';", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {int64(1), "first row, 2"}, {int64(2), "second row, 2"}, {int64(3), "third row, 2"}, @@ -7357,15 +7357,15 @@ END`, Assertions: []queries.ScriptTestAssertion{ { Query: "SELECT * FROM test;", - Expected: []sql.Row{{2}}, + Expected: []sql.UntypedSqlRow{{2}}, }, { Query: "CALL p1();", - Expected: []sql.Row{{types.OkResult{RowsAffected: 1, Info: plan.UpdateInfo{Matched: 1, Updated: 1}}}}, + Expected: []sql.UntypedSqlRow{{types.OkResult{RowsAffected: 1, Info: plan.UpdateInfo{Matched: 1, Updated: 1}}}}, }, { Query: "SELECT * FROM test;", - Expected: []sql.Row{{4}}, + Expected: []sql.UntypedSqlRow{{4}}, }, { Query: "CALL p1() AS OF 'HEAD~1';", @@ -7404,27 +7404,27 @@ END`, Assertions: []queries.ScriptTestAssertion{ { Query: "CALL p4();", - Expected: []sql.Row{{4}}, + Expected: []sql.UntypedSqlRow{{4}}, }, { Query: "CALL p5();", - Expected: []sql.Row{{4}}, + Expected: []sql.UntypedSqlRow{{4}}, }, { Query: "CALL `mydb/main`.p4();", - Expected: []sql.Row{{4}}, + Expected: []sql.UntypedSqlRow{{4}}, }, { Query: "CALL `mydb/main`.p5();", - Expected: []sql.Row{{4}}, + Expected: []sql.UntypedSqlRow{{4}}, }, { Query: "CALL `mydb/p45`.p4();", - Expected: []sql.Row{{3}}, + Expected: []sql.UntypedSqlRow{{3}}, }, { Query: "CALL `mydb/p45`.p5();", - Expected: []sql.Row{{3}}, + Expected: []sql.UntypedSqlRow{{3}}, }, }, }, @@ -7452,39 +7452,39 @@ END`, Assertions: []queries.ScriptTestAssertion{ { Query: "CALL p1();", - Expected: []sql.Row{{300}}, + Expected: []sql.UntypedSqlRow{{300}}, }, { Query: "CALL `mydb/main`.p1();", - Expected: []sql.Row{{300}}, + Expected: []sql.UntypedSqlRow{{300}}, }, { Query: "CALL `mydb/other`.p1();", - Expected: []sql.Row{{30}}, + Expected: []sql.UntypedSqlRow{{30}}, }, { Query: "CALL p1() AS OF 'HEAD';", - Expected: []sql.Row{{300}}, + Expected: []sql.UntypedSqlRow{{300}}, }, { Query: "CALL `mydb/main`.p1() AS OF 'HEAD';", - Expected: []sql.Row{{300}}, + Expected: []sql.UntypedSqlRow{{300}}, }, { Query: "CALL `mydb/other`.p1() AS OF 'HEAD';", - Expected: []sql.Row{{30}}, + Expected: []sql.UntypedSqlRow{{30}}, }, { Query: "CALL p1() AS OF 'HEAD~1';", - Expected: []sql.Row{{200}}, + Expected: []sql.UntypedSqlRow{{200}}, }, { Query: "CALL `mydb/main`.p1() AS OF 'HEAD~1';", - Expected: []sql.Row{{200}}, + Expected: []sql.UntypedSqlRow{{200}}, }, { Query: "CALL `mydb/other`.p1() AS OF 'HEAD~1';", - Expected: []sql.Row{{20}}, + Expected: []sql.UntypedSqlRow{{20}}, }, }, }, @@ -7500,7 +7500,7 @@ var DoltSystemVariables = []queries.ScriptTest{ Assertions: []queries.ScriptTestAssertion{ { Query: "SHOW TABLES;", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {"dolt_branches"}, {"dolt_commit_ancestors"}, {"dolt_commit_diff_test"}, @@ -7534,7 +7534,7 @@ var DoltTempTableScripts = []queries.ScriptTest{ Assertions: []queries.ScriptTestAssertion{ { Query: "show create table t;", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {"t", "CREATE TABLE `t` (\n" + " `i` int NOT NULL AUTO_INCREMENT,\n" + " PRIMARY KEY (`i`)\n" + @@ -7543,13 +7543,13 @@ var DoltTempTableScripts = []queries.ScriptTest{ }, { Query: "insert into t values (), (), ()", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {types.OkResult{RowsAffected: 3, InsertID: 1}}, }, }, { Query: "show create table t;", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {"t", "CREATE TABLE `t` (\n" + " `i` int NOT NULL AUTO_INCREMENT,\n" + " PRIMARY KEY (`i`)\n" + @@ -7558,7 +7558,7 @@ var DoltTempTableScripts = []queries.ScriptTest{ }, { Query: "select * from t", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {1}, {2}, {3}, @@ -7566,13 +7566,13 @@ var DoltTempTableScripts = []queries.ScriptTest{ }, { Query: "insert into t values (100), (1000)", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {types.OkResult{RowsAffected: 2, InsertID: 1}}, }, }, { Query: "show create table t;", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {"t", "CREATE TABLE `t` (\n" + " `i` int NOT NULL AUTO_INCREMENT,\n" + " PRIMARY KEY (`i`)\n" + @@ -7581,13 +7581,13 @@ var DoltTempTableScripts = []queries.ScriptTest{ }, { Query: "insert into t values (), (), ()", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {types.OkResult{RowsAffected: 3, InsertID: 0x3e9}}, }, }, { Query: "select * from t", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {1}, {2}, {3}, @@ -7608,7 +7608,7 @@ var DoltTempTableScripts = []queries.ScriptTest{ Assertions: []queries.ScriptTestAssertion{ { Query: "CREATE TEMPORARY TABLE tmp_tbl(a int, b int, c int, d int, e int, f int, g int);", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {types.NewOkResult(0)}, }, }, diff --git a/go/libraries/doltcore/sqle/enginetest/dolt_queries_create_database.go b/go/libraries/doltcore/sqle/enginetest/dolt_queries_create_database.go index ff7c1e2cddb..9de15288d48 100755 --- a/go/libraries/doltcore/sqle/enginetest/dolt_queries_create_database.go +++ b/go/libraries/doltcore/sqle/enginetest/dolt_queries_create_database.go @@ -29,7 +29,7 @@ var DoltCreateDatabaseScripts = []queries.ScriptTest{ Assertions: []queries.ScriptTestAssertion{ { Query: "SHOW DATABASES", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {"information_schema"}, {"mydb"}, {"mysql"}, @@ -54,7 +54,7 @@ var DoltCreateDatabaseScripts = []queries.ScriptTest{ }, { Query: "SELECT * FROM test.foo", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {1}, }, }, @@ -76,7 +76,7 @@ var DoltCreateDatabaseScripts = []queries.ScriptTest{ }, { Query: "show create database test", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {"test", "CREATE DATABASE `test` /*!40100 DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci */"}, }, }, @@ -107,7 +107,7 @@ var DoltCreateDatabaseScripts = []queries.ScriptTest{ }, { Query: "SELECT * FROM test.foo", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {1}, }, }, diff --git a/go/libraries/doltcore/sqle/enginetest/dolt_queries_diff.go b/go/libraries/doltcore/sqle/enginetest/dolt_queries_diff.go index e38dd4eefcf..89103532918 100644 --- a/go/libraries/doltcore/sqle/enginetest/dolt_queries_diff.go +++ b/go/libraries/doltcore/sqle/enginetest/dolt_queries_diff.go @@ -36,16 +36,16 @@ var DiffSystemTableScriptTests = []queries.ScriptTest{ Assertions: []queries.ScriptTestAssertion{ { Query: "SELECT COUNT(*) FROM DOLT_DIFF_t;", - Expected: []sql.Row{{2}}, + Expected: []sql.UntypedSqlRow{{2}}, }, { // Test case-insensitive table name Query: "SELECT COUNT(*) FROM DOLT_DIFF_T;", - Expected: []sql.Row{{2}}, + Expected: []sql.UntypedSqlRow{{2}}, }, { Query: "SELECT to_pk, to_c1, to_c2, from_pk, from_c1, from_c2, diff_type FROM DOLT_DIFF_t WHERE TO_COMMIT=@Commit1 ORDER BY to_pk, to_c2, to_c2, from_pk, from_c1, from_c2, diff_type;", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {1, 2, 3, nil, nil, nil, "added"}, {4, 5, 6, nil, nil, nil, "added"}, }, @@ -68,11 +68,11 @@ var DiffSystemTableScriptTests = []queries.ScriptTest{ Assertions: []queries.ScriptTestAssertion{ { Query: "SELECT COUNT(*) FROM DOLT_DIFF_t;", - Expected: []sql.Row{{3}}, + Expected: []sql.UntypedSqlRow{{3}}, }, { Query: "SELECT to_pk, to_c1, to_c2, from_pk, from_c1, from_c2, diff_type FROM DOLT_DIFF_t WHERE TO_COMMIT=@Commit2 ORDER BY to_pk, to_c2, to_c2, from_pk, from_c1, from_c2, diff_type;", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {1, 2, 0, 1, 2, 3, "modified"}, }, }, @@ -94,11 +94,11 @@ var DiffSystemTableScriptTests = []queries.ScriptTest{ Assertions: []queries.ScriptTestAssertion{ { Query: "SELECT COUNT(*) FROM DOLT_DIFF_t;", - Expected: []sql.Row{{3}}, + Expected: []sql.UntypedSqlRow{{3}}, }, { Query: "SELECT to_pk, to_c1, to_c2, from_pk, from_c1, from_c2, diff_type FROM DOLT_DIFF_t WHERE TO_COMMIT=@Commit2 ORDER BY to_pk;", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {nil, nil, nil, 1, 2, 3, "removed"}, }, }, @@ -127,11 +127,11 @@ var DiffSystemTableScriptTests = []queries.ScriptTest{ Assertions: []queries.ScriptTestAssertion{ { Query: "SELECT COUNT(*) FROM DOLT_DIFF_t", - Expected: []sql.Row{{2}}, + Expected: []sql.UntypedSqlRow{{2}}, }, { Query: "SELECT to_pk, to_c, from_pk, from_c, diff_type FROM DOLT_DIFF_t WHERE TO_COMMIT=@Commit3 ORDER BY to_pk;", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {100, 200, nil, nil, "added"}, {300, 400, nil, nil, "added"}, }, @@ -155,18 +155,18 @@ var DiffSystemTableScriptTests = []queries.ScriptTest{ Assertions: []queries.ScriptTestAssertion{ { Query: "SELECT COUNT(*) FROM DOLT_DIFF_t;", - Expected: []sql.Row{{4}}, + Expected: []sql.UntypedSqlRow{{4}}, }, { Query: "SELECT to_pk, to_c2, from_pk, from_c2 FROM DOLT_DIFF_t WHERE TO_COMMIT=@Commit1 ORDER BY to_pk;", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {1, 3, nil, nil}, {4, 6, nil, nil}, }, }, { Query: "SELECT to_pk, to_c2, from_pk, from_c2 FROM DOLT_DIFF_t WHERE TO_COMMIT=@Commit2 ORDER BY to_pk;", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {1, 3, 1, 3}, {4, 6, 4, 6}, }, @@ -195,25 +195,25 @@ var DiffSystemTableScriptTests = []queries.ScriptTest{ Assertions: []queries.ScriptTestAssertion{ { Query: "SELECT COUNT(*) FROM DOLT_DIFF_t;", - Expected: []sql.Row{{5}}, + Expected: []sql.UntypedSqlRow{{5}}, }, { Query: "SELECT to_pk, to_c, from_pk, from_c, diff_type FROM DOLT_DIFF_t WHERE TO_COMMIT=@Commit1 ORDER BY to_pk;", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {1, 2, nil, nil, "added"}, {3, 4, nil, nil, "added"}, }, }, { Query: "SELECT to_pk, to_c, from_pk, from_c, diff_type FROM DOLT_DIFF_t WHERE TO_COMMIT=@Commit2 ORDER BY to_pk;", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {1, nil, 1, 2, "modified"}, {3, nil, 3, 4, "modified"}, }, }, { Query: "SELECT to_pk, to_c, from_pk, from_c, diff_type FROM DOLT_DIFF_t WHERE TO_COMMIT=@Commit3 ORDER BY to_pk;", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {100, 101, nil, nil, "added"}, }, }, @@ -241,25 +241,25 @@ var DiffSystemTableScriptTests = []queries.ScriptTest{ Assertions: []queries.ScriptTestAssertion{ { Query: "SELECT COUNT(*) FROM DOLT_DIFF_t;", - Expected: []sql.Row{{5}}, + Expected: []sql.UntypedSqlRow{{5}}, }, { Query: "SELECT to_pk, to_c1, from_pk, from_c1, diff_type FROM DOLT_DIFF_t WHERE TO_COMMIT=@Commit1 ORDER BY to_pk;", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {1, 2, nil, nil, "added"}, {4, 5, nil, nil, "added"}, }, }, { Query: "SELECT to_pk, to_c1, from_pk, from_c1, diff_type FROM DOLT_DIFF_t WHERE TO_COMMIT=@Commit2 ORDER BY to_pk;", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {1, nil, 1, 2, "modified"}, {4, nil, 4, 5, "modified"}, }, }, { Query: "SELECT to_pk, to_c1, from_pk, from_c1, diff_type FROM DOLT_DIFF_t WHERE TO_COMMIT=@Commit3 ORDER BY to_pk;", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {100, 101, nil, nil, "added"}, // TODO: It's more correct to also return the following rows. //{1, 3, 1, nil, "modified"}, @@ -332,25 +332,25 @@ var DiffSystemTableScriptTests = []queries.ScriptTest{ Assertions: []queries.ScriptTestAssertion{ { Query: "SELECT COUNT(*) FROM DOLT_DIFF_t;", - Expected: []sql.Row{{5}}, + Expected: []sql.UntypedSqlRow{{5}}, }, { Query: "SELECT to_pk, to_c, from_pk, from_c, diff_type FROM DOLT_DIFF_t WHERE TO_COMMIT=@Commit1 ORDER BY to_pk;", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {1, "2", nil, nil, "added"}, {3, "4", nil, nil, "added"}, }, }, { Query: "SELECT to_pk, to_c, from_pk, from_c, diff_type FROM DOLT_DIFF_t WHERE TO_COMMIT=@Commit2 ORDER BY to_pk;", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {1, nil, 1, "2", "modified"}, {3, nil, 3, "4", "modified"}, }, }, { Query: "SELECT to_pk, to_c, from_pk, from_c, diff_type FROM DOLT_DIFF_t WHERE TO_COMMIT=@Commit3 ORDER BY to_pk;", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {100, "101", nil, nil, "added"}, }, }, @@ -377,25 +377,25 @@ var DiffSystemTableScriptTests = []queries.ScriptTest{ Assertions: []queries.ScriptTestAssertion{ { Query: "SELECT COUNT(*) FROM DOLT_DIFF_t;", - Expected: []sql.Row{{5}}, + Expected: []sql.UntypedSqlRow{{5}}, }, { Query: "SELECT to_pk, to_c, from_pk, from_c, diff_type FROM DOLT_DIFF_t WHERE TO_COMMIT=@Commit1 ORDER BY to_pk;", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {1, nil, nil, nil, "added"}, {3, nil, nil, nil, "added"}, }, }, { Query: "SELECT to_pk, to_c, from_pk, from_c, diff_type FROM DOLT_DIFF_t WHERE TO_COMMIT=@Commit2 ORDER BY to_pk;", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {1, nil, 1, nil, "modified"}, {3, nil, 3, nil, "modified"}, }, }, { Query: "SELECT to_pk, to_c, from_pk, from_c, diff_type FROM DOLT_DIFF_t WHERE TO_COMMIT=@Commit3 ORDER BY to_pk;", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {100, 101, nil, nil, "added"}, }, }, @@ -424,7 +424,7 @@ var DiffSystemTableScriptTests = []queries.ScriptTest{ Assertions: []queries.ScriptTestAssertion{ { Query: "select to_pk, to_col1, to_col2, to_commit, from_pk, from_col1, from_col2, from_commit, diff_type from dolt_diff_t order by diff_type ASC;", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {1, nil, nil, doltCommit, nil, nil, nil, doltCommit, "added"}, {1, "1234567890", 13, doltCommit, 1, nil, nil, doltCommit, "modified"}, }, @@ -432,7 +432,7 @@ var DiffSystemTableScriptTests = []queries.ScriptTest{ }, { Query: "SHOW WARNINGS;", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {"Warning", 1292, "Truncated tinyint value: 420"}, {"Warning", 1292, "Truncated tinyint value: 420"}, {"Warning", 1292, "Truncated varchar(10) value: 123456789012345"}, @@ -467,30 +467,30 @@ var DiffSystemTableScriptTests = []queries.ScriptTest{ Assertions: []queries.ScriptTestAssertion{ { Query: "SELECT COUNT(*) FROM DOLT_DIFF_t;", - Expected: []sql.Row{{5}}, + Expected: []sql.UntypedSqlRow{{5}}, }, { Query: "SELECT to_pk, to_c2, from_pk, from_c2, diff_type FROM DOLT_DIFF_t WHERE TO_COMMIT=@Commit1 ORDER BY to_pk;", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {1, nil, nil, nil, "added"}, }, }, { Query: "SELECT to_pk, to_c2, from_pk, from_c2, diff_type FROM DOLT_DIFF_t WHERE TO_COMMIT=@Commit2 ORDER BY to_pk;", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {3, 4, nil, nil, "added"}, }, }, { Query: "SELECT to_pk, to_c2, from_pk, from_c2, diff_type FROM DOLT_DIFF_t WHERE TO_COMMIT=@Commit3 ORDER BY to_pk;", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {1, nil, 1, 2, "modified"}, {3, nil, 3, 4, "modified"}, }, }, { Query: "SELECT to_pk, to_c2, from_pk, from_c2, diff_type FROM DOLT_DIFF_t WHERE TO_COMMIT=@Commit4 ORDER BY to_pk;", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {100, 101, nil, nil, "added"}, }, }, @@ -528,11 +528,11 @@ var DiffSystemTableScriptTests = []queries.ScriptTest{ }, { Query: "SELECT COUNT(*) FROM DOLT_DIFF_t;", - Expected: []sql.Row{{1}}, + Expected: []sql.UntypedSqlRow{{1}}, }, { Query: "SELECT to_pk, to_c1, from_pk, from_c1, diff_type FROM DOLT_DIFF_t where to_commit=@Commit4;", - Expected: []sql.Row{{7, 8, nil, nil, "added"}}, + Expected: []sql.UntypedSqlRow{{7, 8, nil, nil, "added"}}, }, }, }, @@ -548,7 +548,7 @@ var DiffSystemTableScriptTests = []queries.ScriptTest{ Assertions: []queries.ScriptTestAssertion{ { Query: "SELECT to_pk, char_length(to_commit), from_pk, char_length(from_commit), diff_type from dolt_diff_t;", - Expected: []sql.Row{{1, 32, nil, 32, "added"}}, + Expected: []sql.UntypedSqlRow{{1, 32, nil, 32, "added"}}, }, }, }, @@ -570,17 +570,17 @@ var DiffSystemTableScriptTests = []queries.ScriptTest{ Assertions: []queries.ScriptTestAssertion{ { Query: "SELECT COUNT(*) FROM DOLT_DIFF_t;", - Expected: []sql.Row{{4}}, + Expected: []sql.UntypedSqlRow{{4}}, }, { Query: "SELECT to_pk, to_c1, to_c2, from_pk, from_c1, from_c2, diff_type FROM DOLT_DIFF_t WHERE to_pk = 1 ORDER BY to_pk, to_c1, to_c2, from_pk, from_c1, from_c2, diff_type;", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {1, 2, 3, nil, nil, nil, "added"}, }, }, { Query: "SELECT to_pk, to_c1, to_c2, from_pk, from_c1, from_c2, diff_type FROM DOLT_DIFF_t WHERE to_pk > 1 ORDER BY to_pk, to_c1, to_c2, from_pk, from_c1, from_c2, diff_type;", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {4, 5, 6, nil, nil, nil, "added"}, {7, 0, 9, 7, 8, 9, "modified"}, {7, 8, 9, nil, nil, nil, "added"}, @@ -606,23 +606,23 @@ var DiffSystemTableScriptTests = []queries.ScriptTest{ Assertions: []queries.ScriptTestAssertion{ { Query: "SELECT COUNT(*) FROM DOLT_DIFF_t;", - Expected: []sql.Row{{4}}, + Expected: []sql.UntypedSqlRow{{4}}, }, { Query: "SELECT to_pk1, to_pk2, to_c1, from_pk1, from_pk2, from_c1, diff_type FROM DOLT_DIFF_t WHERE to_pk1 = 1 ORDER BY to_pk1, to_pk2, to_c1, from_pk1, from_pk2, from_c1, diff_type;", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {1, 2, 3, nil, nil, nil, "added"}, }, }, { Query: "SELECT to_pk1, to_pk2, to_c1, from_pk1, from_pk2, from_c1, diff_type FROM DOLT_DIFF_t WHERE to_pk1 = 1 and to_pk2 = 2 ORDER BY to_pk1, to_pk2, to_c1, from_pk1, from_pk2, from_c1, diff_type;", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {1, 2, 3, nil, nil, nil, "added"}, }, }, { Query: "SELECT to_pk1, to_pk2, to_c1, from_pk1, from_pk2, from_c1, diff_type FROM DOLT_DIFF_t WHERE to_pk1 > 1 and to_pk2 < 10 ORDER BY to_pk1, to_pk2, to_c1, from_pk1, from_pk2, from_c1, diff_type;", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {4, 5, 6, nil, nil, nil, "added"}, {7, 8, 0, 7, 8, 9, "modified"}, {7, 8, 9, nil, nil, nil, "added"}, @@ -648,11 +648,11 @@ var DiffSystemTableScriptTests = []queries.ScriptTest{ Assertions: []queries.ScriptTestAssertion{ { Query: "SELECT from_pk2, to_pk2, diff_type from dolt_diff_t;", - Expected: []sql.Row{{nil, 1, "added"}}, + Expected: []sql.UntypedSqlRow{{nil, 1, "added"}}, }, { Query: "SELECT from_pk2a, from_pk2b, to_pk2a, to_pk2b, diff_type from dolt_diff_t2;", - Expected: []sql.Row{{nil, nil, 2, 2, "added"}}, + Expected: []sql.UntypedSqlRow{{nil, nil, 2, 2, "added"}}, }, }, }, @@ -672,7 +672,7 @@ var DiffSystemTableScriptTests = []queries.ScriptTest{ Assertions: []queries.ScriptTestAssertion{ { Query: "SELECT to_pk, to_col1, from_pk, from_col1, diff_type from dolt_diff_t;", - Expected: []sql.Row{{1, nil, nil, nil, "added"}}, + Expected: []sql.UntypedSqlRow{{1, nil, nil, nil, "added"}}, }, }, }, @@ -687,7 +687,7 @@ var DiffSystemTableScriptTests = []queries.ScriptTest{ Assertions: []queries.ScriptTestAssertion{ { Query: "select table_name from dolt_diff where commit_hash = @commit1", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {"t1"}, {"t2"}, }, @@ -714,7 +714,7 @@ var Dolt1DiffSystemTableScripts = []queries.ScriptTest{ Assertions: []queries.ScriptTestAssertion{ { Query: "SELECT to_pk1, to_pk2, from_pk1, from_pk2, diff_type from dolt_diff_t;", - Expected: []sql.Row{{"2", "2", nil, nil, "added"}}, + Expected: []sql.UntypedSqlRow{{"2", "2", nil, nil, "added"}}, }, }, }, @@ -857,15 +857,15 @@ var DiffTableFunctionScriptTests = []queries.ScriptTest{ Assertions: []queries.ScriptTestAssertion{ { Query: "SELECT to_pk, to_c1, to_c2, from_pk, from_c1, from_c2, diff_type from dolt_diff(@Commit1, @Commit2, 't');", - Expected: []sql.Row{{1, "one", "two", nil, nil, nil, "added"}}, + Expected: []sql.UntypedSqlRow{{1, "one", "two", nil, nil, nil, "added"}}, }, { Query: "SELECT COUNT(*) from dolt_diff(@Commit2, @Commit3, 't');", - Expected: []sql.Row{{0}}, + Expected: []sql.UntypedSqlRow{{0}}, }, { Query: "SELECT to_pk, to_c1, to_c2, from_pk, from_c1, from_c2, diff_type from dolt_diff(@Commit3, @Commit4, 't');", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {1, "uno", "dos", 1, "one", "two", "modified"}, {2, "two", "three", nil, nil, nil, "added"}, {3, "three", "four", nil, nil, nil, "added"}, @@ -873,7 +873,7 @@ var DiffTableFunctionScriptTests = []queries.ScriptTest{ }, { Query: "SELECT to_pk, to_c1, to_c2, from_pk, from_c1, from_c2, diff_type from dolt_diff(@Commit4, @Commit3, 't');", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {1, "one", "two", 1, "uno", "dos", "modified"}, {nil, nil, nil, 2, "two", "three", "removed"}, {nil, nil, nil, 3, "three", "four", "removed"}, @@ -882,11 +882,11 @@ var DiffTableFunctionScriptTests = []queries.ScriptTest{ { // Table t2 had no changes between Commit3 and Commit4, so results should be empty Query: "SELECT to_pk, to_c1, to_c2, from_pk, from_c1, from_c2, diff_type from dolt_diff(@Commit3, @Commit4, 'T2');", - Expected: []sql.Row{}, + Expected: []sql.UntypedSqlRow{}, }, { Query: "SELECT to_pk, to_c1, to_c2, from_pk, from_c1, from_c2, diff_type from dolt_diff(@Commit1, @Commit4, 't');", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {1, "uno", "dos", nil, nil, nil, "added"}, {2, "two", "three", nil, nil, nil, "added"}, {3, "three", "four", nil, nil, nil, "added"}, @@ -895,7 +895,7 @@ var DiffTableFunctionScriptTests = []queries.ScriptTest{ { // Reverse the to/from commits to see the diff from the other direction Query: "SELECT to_pk, to_c1, to_c2, from_pk, from_c1, from_c2, diff_type from dolt_diff(@Commit4, @Commit1, 'T');", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {nil, nil, nil, 1, "uno", "dos", "removed"}, {nil, nil, nil, 2, "two", "three", "removed"}, {nil, nil, nil, 3, "three", "four", "removed"}, @@ -906,7 +906,7 @@ var DiffTableFunctionScriptTests = []queries.ScriptTest{ SELECT to_pk, to_c1, to_c2, from_pk, from_c1, from_c2, diff_type from dolt_diff(@Commit1, @Commit2, 't') inner join t on to_pk = t.pk;`, - Expected: []sql.Row{{1, "one", "two", nil, nil, nil, "added"}}, + Expected: []sql.UntypedSqlRow{{1, "one", "two", nil, nil, nil, "added"}}, }, { Query: ` @@ -919,7 +919,7 @@ from dolt_diff(@Commit1, @Commit2, 't') inner join dolt_diff(@Commit1, @Commit3, SELECT a.to_pk, a.from_c1, a.to_c1, b.from_c1, b.to_c1, a.diff_type, b.diff_type from dolt_diff(@Commit1, @Commit2, 't') a inner join dolt_diff(@Commit1, @Commit3, 't') b on a.to_pk = b.to_pk;`, - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {1, nil, "one", nil, "one", "added", "added"}, }, }, @@ -943,7 +943,7 @@ on a.to_pk = b.to_pk;`, Assertions: []queries.ScriptTestAssertion{ { Query: "SELECT from_pk, from_c1, from_c2, to_pk, to_c1, to_c2, diff_type from dolt_diff(@Commit1, 'WORKING', 't') order by coalesce(from_pk, to_pk)", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {1, "one", "two", 1, "one", "100", "modified"}, {2, "three", "four", nil, nil, nil, "removed"}, {nil, nil, nil, 3, "five", "six", "added"}, @@ -951,7 +951,7 @@ on a.to_pk = b.to_pk;`, }, { Query: "SELECT from_pk, from_c1, from_c2, to_pk, to_c1, to_c2, diff_type from dolt_diff('STAGED', 'WORKING', 't') order by coalesce(from_pk, to_pk);", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {1, "one", "two", 1, "one", "100", "modified"}, {2, "three", "four", nil, nil, nil, "removed"}, {nil, nil, nil, 3, "five", "six", "added"}, @@ -959,7 +959,7 @@ on a.to_pk = b.to_pk;`, }, { Query: "SELECT from_pk, from_c1, from_c2, to_pk, to_c1, to_c2, diff_type from dolt_diff('STAGED..WORKING', 't') order by coalesce(from_pk, to_pk);", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {1, "one", "two", 1, "one", "100", "modified"}, {2, "three", "four", nil, nil, nil, "removed"}, {nil, nil, nil, 3, "five", "six", "added"}, @@ -967,7 +967,7 @@ on a.to_pk = b.to_pk;`, }, { Query: "SELECT from_pk, from_c1, from_c2, to_pk, to_c1, to_c2, diff_type from dolt_diff('WORKING', 'STAGED', 't') order by coalesce(from_pk, to_pk);", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {1, "one", "100", 1, "one", "two", "modified"}, {nil, nil, nil, 2, "three", "four", "added"}, {3, "five", "six", nil, nil, nil, "removed"}, @@ -975,15 +975,15 @@ on a.to_pk = b.to_pk;`, }, { Query: "SELECT from_pk, from_c1, from_c2, to_pk, to_c1, to_c2, diff_type from dolt_diff('WORKING', 'WORKING', 't') order by coalesce(from_pk, to_pk);", - Expected: []sql.Row{}, + Expected: []sql.UntypedSqlRow{}, }, { Query: "SELECT from_pk, from_c1, from_c2, to_pk, to_c1, to_c2, diff_type from dolt_diff('WORKING..WORKING', 't') order by coalesce(from_pk, to_pk);", - Expected: []sql.Row{}, + Expected: []sql.UntypedSqlRow{}, }, { Query: "SELECT from_pk, from_c1, from_c2, to_pk, to_c1, to_c2, diff_type from dolt_diff('STAGED', 'STAGED', 't') order by coalesce(from_pk, to_pk);", - Expected: []sql.Row{}, + Expected: []sql.UntypedSqlRow{}, }, { Query: "call dolt_add('.')", @@ -991,11 +991,11 @@ on a.to_pk = b.to_pk;`, }, { Query: "SELECT from_pk, from_c1, from_c2, to_pk, to_c1, to_c2, diff_type from dolt_diff('WORKING', 'STAGED', 't') order by coalesce(from_pk, to_pk);", - Expected: []sql.Row{}, + Expected: []sql.UntypedSqlRow{}, }, { Query: "SELECT from_pk, from_c1, from_c2, to_pk, to_c1, to_c2, diff_type from dolt_diff('HEAD', 'STAGED', 't') order by coalesce(from_pk, to_pk);", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {1, "one", "two", 1, "one", "100", "modified"}, {2, "three", "four", nil, nil, nil, "removed"}, {nil, nil, nil, 3, "five", "six", "added"}, @@ -1036,42 +1036,42 @@ on a.to_pk = b.to_pk;`, Assertions: []queries.ScriptTestAssertion{ { Query: "SELECT to_pk, to_c1, from_pk, from_c1, from_c2, diff_type from dolt_diff('main', 'branch1', 't');", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {nil, nil, 1, "one", "two", "removed"}, {2, "two", 2, "two", "three", "modified"}, }, }, { Query: "SELECT to_pk, to_c1, from_pk, from_c1, from_c2, diff_type from dolt_diff('main..branch1', 't');", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {nil, nil, 1, "one", "two", "removed"}, {2, "two", 2, "two", "three", "modified"}, }, }, { Query: "SELECT to_pk, to_c1, to_c2, from_pk, from_c1, diff_type from dolt_diff('branch1', 'main', 't');", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {1, "one", "two", nil, nil, "added"}, {2, "two", "three", 2, "two", "modified"}, }, }, { Query: "SELECT to_pk, to_c1, to_c2, from_pk, from_c1, diff_type from dolt_diff('branch1..main', 't');", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {1, "one", "two", nil, nil, "added"}, {2, "two", "three", 2, "two", "modified"}, }, }, { Query: "SELECT to_pk, to_c1, from_pk, from_c1, from_c2, diff_type from dolt_diff('main~', 'branch1', 't');", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {nil, nil, 1, "one", "two", "removed"}, {2, "two", nil, nil, nil, "added"}, }, }, { Query: "SELECT to_pk, to_c1, from_pk, from_c1, from_c2, diff_type from dolt_diff('main~..branch1', 't');", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {nil, nil, 1, "one", "two", "removed"}, {2, "two", nil, nil, nil, "added"}, }, @@ -1080,27 +1080,27 @@ on a.to_pk = b.to_pk;`, // Three dot { Query: "SELECT to_pk, to_c1, from_pk, from_c1, from_c2, diff_type from dolt_diff('main...branch1', 't');", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {nil, nil, 1, "one", "two", "removed"}, {2, "two", nil, nil, nil, "added"}, }, }, { Query: "SELECT to_pk, to_c1, to_c2, from_pk, from_c1, diff_type from dolt_diff('branch1...main', 't');", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {2, "two", "three", nil, nil, "added"}, }, }, { Query: "SELECT to_pk, to_c1, from_pk, from_c1, from_c2, diff_type from dolt_diff('main~...branch1', 't');", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {nil, nil, 1, "one", "two", "removed"}, {2, "two", nil, nil, nil, "added"}, }, }, { Query: "SELECT to_pk, to_c1, from_pk, from_c1, from_c2, diff_type from dolt_diff('main...branch1~', 't');", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {nil, nil, 1, "one", "two", "removed"}, }, }, @@ -1131,14 +1131,14 @@ on a.to_pk = b.to_pk;`, Assertions: []queries.ScriptTestAssertion{ { Query: "SELECT to_pk, to_c1, to_c2, from_pk, from_c1, from_c2, diff_type from dolt_diff(@Commit1, @Commit2, 't');", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {1, "one", "two", nil, nil, nil, "added"}, {2, "two", "three", nil, nil, nil, "added"}, }, }, { Query: "SELECT to_pk, to_c1, from_pk, from_c1, from_c2, diff_type from dolt_diff(@Commit2, @Commit3, 't');", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {1, "one", 1, "one", "two", "modified"}, {2, "two", 2, "two", "three", "modified"}, }, @@ -1149,7 +1149,7 @@ on a.to_pk = b.to_pk;`, }, { Query: "SELECT to_pk, to_c1, to_c2, from_pk, from_c1, diff_type from dolt_diff(@Commit3, @Commit4, 't');", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {1, "one", "foo", 1, "one", "modified"}, // This row doesn't show up as changed because adding a column doesn't touch the row data. //{2, "two", nil, 2, "two", "modified"}, @@ -1162,7 +1162,7 @@ on a.to_pk = b.to_pk;`, }, { Query: "SELECT to_pk, to_c1, to_c2, from_pk, from_c1, from_c2, diff_type from dolt_diff(@Commit1, @Commit4, 't');", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {1, "one", "foo", nil, nil, nil, "added"}, {2, "two", nil, nil, nil, nil, "added"}, {3, "three", "four", nil, nil, nil, "added"}, @@ -1199,7 +1199,7 @@ on a.to_pk = b.to_pk;`, Assertions: []queries.ScriptTestAssertion{ { Query: "SELECT to_pk, to_c1, to_c2, from_pk, from_c1, from_c2, diff_type from dolt_diff(@Commit1, @Commit2, 't');", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {1, "one", -1, nil, nil, nil, "added"}, {2, "two", -2, nil, nil, nil, "added"}, }, @@ -1210,11 +1210,11 @@ on a.to_pk = b.to_pk;`, }, { Query: "SELECT to_pk, to_c1, to_c3, from_pk, from_c1, from_c2, diff_type from dolt_diff(@Commit2, @Commit3, 't');", - Expected: []sql.Row{}, + Expected: []sql.UntypedSqlRow{}, }, { Query: "SELECT to_pk, to_c1, to_c3, from_pk, from_c1, from_c3, diff_type from dolt_diff(@Commit3, @Commit4, 't');", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {3, "three", -3, nil, nil, nil, "added"}, {1, "one", 1, 1, "one", -1, "modified"}, }, @@ -1229,13 +1229,13 @@ on a.to_pk = b.to_pk;`, }, { Query: "SELECT to_pk, to_c1, to_c2, from_pk, from_c1, from_c3, diff_type from dolt_diff(@Commit4, @Commit5, 't');", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {4, "four", -4, nil, nil, nil, "added"}, }, }, { Query: "SELECT to_pk, to_c1, to_c2, from_pk, from_c1, from_c2, diff_type from dolt_diff(@Commit1, @Commit5, 't');", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {1, "one", 1, nil, nil, nil, "added"}, {2, "two", -2, nil, nil, nil, "added"}, {3, "three", -3, nil, nil, nil, "added"}, @@ -1273,34 +1273,34 @@ on a.to_pk = b.to_pk;`, Assertions: []queries.ScriptTestAssertion{ { Query: "SELECT to_pk, to_c1, to_c2, from_pk, from_c1, from_c2, diff_type from dolt_diff(@Commit1, @Commit2, 't');", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {1, "one", "asdf", nil, nil, nil, "added"}, {2, "two", "2", nil, nil, nil, "added"}, }, }, { Query: "SELECT to_pk, to_c1, from_pk, from_c1, from_c2, diff_type from dolt_diff(@Commit2, @Commit3, 't');", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {1, "one", 1, "one", "asdf", "modified"}, {2, "two", 2, "two", "2", "modified"}, }, }, { Query: "SELECT to_pk, to_c1, from_pk, from_c1, diff_type from dolt_diff(@Commit3, @Commit4, 't');", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {3, "three", nil, nil, "added"}, {1, "fdsa", 1, "one", "modified"}, }, }, { Query: "SELECT to_pk, to_c1, to_c2, from_pk, from_c1, diff_type from dolt_diff(@Commit4, @Commit5, 't');", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {4, "four", -4, nil, nil, "added"}, }, }, { Query: "SELECT to_pk, to_c1, to_c2, from_pk, from_c1, from_c2, diff_type from dolt_diff(@Commit1, @Commit5, 't');", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {1, "fdsa", nil, nil, nil, nil, "added"}, {2, "two", nil, nil, nil, nil, "added"}, {3, "three", nil, nil, nil, nil, "added"}, @@ -1318,15 +1318,15 @@ on a.to_pk = b.to_pk;`, Assertions: []queries.ScriptTestAssertion{ { Query: "select to_a, to_b, from_commit, to_commit, diff_type from dolt_diff('HEAD', 'WORKING', 't1')", - Expected: []sql.Row{{1, 2, "HEAD", "WORKING", "added"}}, + Expected: []sql.UntypedSqlRow{{1, 2, "HEAD", "WORKING", "added"}}, }, { Query: "select to_a, from_b, from_commit, to_commit, diff_type from dolt_diff('HEAD', 'WORKING', 't1')", - Expected: []sql.Row{{1, nil, "HEAD", "WORKING", "added"}}, + Expected: []sql.UntypedSqlRow{{1, nil, "HEAD", "WORKING", "added"}}, }, { Query: "select from_a, from_b, to_a, from_commit, to_commit, diff_type from dolt_diff('WORKING', 'HEAD', 't1')", - Expected: []sql.Row{{1, 2, nil, "WORKING", "HEAD", "removed"}}, + Expected: []sql.UntypedSqlRow{{1, 2, nil, "WORKING", "HEAD", "removed"}}, }, }, }, @@ -1343,11 +1343,11 @@ on a.to_pk = b.to_pk;`, Assertions: []queries.ScriptTestAssertion{ { Query: "select from_a, from_b, from_commit, to_commit, diff_type from dolt_diff('HEAD~', 'HEAD', 't1')", - Expected: []sql.Row{{1, 2, "HEAD~", "HEAD", "removed"}}, + Expected: []sql.UntypedSqlRow{{1, 2, "HEAD~", "HEAD", "removed"}}, }, { Query: "select from_a, from_b, from_commit, to_commit, diff_type from dolt_diff('HEAD~..HEAD', 't1')", - Expected: []sql.Row{{1, 2, "HEAD~", "HEAD", "removed"}}, + Expected: []sql.UntypedSqlRow{{1, 2, "HEAD~", "HEAD", "removed"}}, }, }, }, @@ -1366,16 +1366,16 @@ on a.to_pk = b.to_pk;`, Assertions: []queries.ScriptTestAssertion{ { Query: "select to_a, to_b, from_commit, to_commit, diff_type from dolt_diff('HEAD~', 'HEAD', 't2')", - Expected: []sql.Row{{3, 4, "HEAD~", "HEAD", "added"}}, + Expected: []sql.UntypedSqlRow{{3, 4, "HEAD~", "HEAD", "added"}}, }, { Query: "select to_a, to_b, from_commit, to_commit, diff_type from dolt_diff('HEAD~..HEAD', 't2')", - Expected: []sql.Row{{3, 4, "HEAD~", "HEAD", "added"}}, + Expected: []sql.UntypedSqlRow{{3, 4, "HEAD~", "HEAD", "added"}}, }, { // Maybe confusing? We match the old table name as well Query: "select to_a, to_b, from_commit, to_commit, diff_type from dolt_diff('HEAD~', 'HEAD', 't1')", - Expected: []sql.Row{{3, 4, "HEAD~", "HEAD", "added"}}, + Expected: []sql.UntypedSqlRow{{3, 4, "HEAD~", "HEAD", "added"}}, }, }, }, @@ -1399,19 +1399,19 @@ on a.to_pk = b.to_pk;`, Assertions: []queries.ScriptTestAssertion{ { Query: "select to_pk2, to_col1, from_pk, from_col1, diff_type from dolt_diff('HEAD~', 'HEAD', 't1')", - Expected: []sql.Row{{1, 100, 1, 1, "modified"}}, + Expected: []sql.UntypedSqlRow{{1, 100, 1, 1, "modified"}}, }, { Query: "select to_pk2, to_col1, from_pk, from_col1, diff_type from dolt_diff('HEAD~..HEAD', 't1')", - Expected: []sql.Row{{1, 100, 1, 1, "modified"}}, + Expected: []sql.UntypedSqlRow{{1, 100, 1, 1, "modified"}}, }, { Query: "select to_pk2a, to_pk2b, to_col1, from_pk1a, from_pk1b, from_col1, diff_type from dolt_diff('HEAD~', 'HEAD', 't2');", - Expected: []sql.Row{{1, 1, 100, 1, 1, 1, "modified"}}, + Expected: []sql.UntypedSqlRow{{1, 1, 100, 1, 1, 1, "modified"}}, }, { Query: "select to_pk2a, to_pk2b, to_col1, from_pk1a, from_pk1b, from_col1, diff_type from dolt_diff('HEAD~..HEAD', 't2');", - Expected: []sql.Row{{1, 1, 100, 1, 1, 1, "modified"}}, + Expected: []sql.UntypedSqlRow{{1, 1, 100, 1, 1, 1, "modified"}}, }, }, }, @@ -1428,7 +1428,7 @@ on a.to_pk = b.to_pk;`, Assertions: []queries.ScriptTestAssertion{ { Query: "SELECT type, name FROM dolt_schemas;", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {"event", "msg_event"}, {"event", "my_commit"}, }, @@ -1447,11 +1447,11 @@ on a.to_pk = b.to_pk;`, }, { Query: "SELECT from_type, from_name, to_name, diff_type FROM DOLT_DIFF('HEAD', 'WORKING', 'dolt_schemas')", - Expected: []sql.Row{{"event", "msg_event", "msg_event", "modified"}}, + Expected: []sql.UntypedSqlRow{{"event", "msg_event", "msg_event", "modified"}}, }, { Query: "SELECT type, name FROM dolt_schemas;", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {"event", "msg_event"}, {"event", "my_commit"}, }, @@ -1470,7 +1470,7 @@ on a.to_pk = b.to_pk;`, Assertions: []queries.ScriptTestAssertion{ { Query: "select * from v;", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {nil, "HEAD~1", 1, "HEAD", "removed"}, {nil, "HEAD~1", 2, "HEAD", "removed"}, {nil, "HEAD~1", 3, "HEAD", "removed"}, @@ -1478,7 +1478,7 @@ on a.to_pk = b.to_pk;`, }, { Query: "insert into t values (4), (5), (6);", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {gmstypes.NewOkResult(3)}, }, }, @@ -1488,7 +1488,7 @@ on a.to_pk = b.to_pk;`, }, { Query: "select * from v;", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {nil, "HEAD~1", 4, "HEAD", "removed"}, {nil, "HEAD~1", 5, "HEAD", "removed"}, {nil, "HEAD~1", 6, "HEAD", "removed"}, @@ -1615,29 +1615,29 @@ var DiffStatTableFunctionScriptTests = []queries.ScriptTest{ { // table is added, no data diff, result is empty Query: "SELECT * from dolt_diff_stat(@Commit1, @Commit2, 't');", - Expected: []sql.Row{}, + Expected: []sql.UntypedSqlRow{}, }, { Query: "SELECT * from dolt_diff_stat(@Commit2, @Commit3, 't');", - Expected: []sql.Row{{"t", 0, 1, 0, 0, 3, 0, 0, 0, 1, 0, 3}}, + Expected: []sql.UntypedSqlRow{{"t", 0, 1, 0, 0, 3, 0, 0, 0, 1, 0, 3}}, }, { Query: "SELECT * from dolt_diff_stat(@Commit3, @Commit4, 't');", - Expected: []sql.Row{{"t", 0, 2, 0, 1, 6, 0, 2, 1, 3, 3, 9}}, + Expected: []sql.UntypedSqlRow{{"t", 0, 2, 0, 1, 6, 0, 2, 1, 3, 3, 9}}, }, { // change from and to commits Query: "SELECT * from dolt_diff_stat(@Commit4, @Commit3, 't');", - Expected: []sql.Row{{"t", 0, 0, 2, 1, 0, 6, 2, 3, 1, 9, 3}}, + Expected: []sql.UntypedSqlRow{{"t", 0, 0, 2, 1, 0, 6, 2, 3, 1, 9, 3}}, }, { // table is dropped Query: "SELECT * from dolt_diff_stat(@Commit4, @Commit5, 't');", - Expected: []sql.Row{{"t", 0, 0, 3, 0, 0, 9, 0, 3, 0, 9, 0}}, + Expected: []sql.UntypedSqlRow{{"t", 0, 0, 3, 0, 0, 9, 0, 3, 0, 9, 0}}, }, { Query: "SELECT * from dolt_diff_stat(@Commit1, @Commit4, 't');", - Expected: []sql.Row{{"t", 0, 3, 0, 0, 9, 0, 0, 0, 3, 0, 9}}, + Expected: []sql.UntypedSqlRow{{"t", 0, 3, 0, 0, 9, 0, 0, 0, 3, 0, 9}}, }, { Query: "SELECT * from dolt_diff_stat(@Commit1, @Commit5, 't');", @@ -1648,7 +1648,7 @@ var DiffStatTableFunctionScriptTests = []queries.ScriptTest{ SELECT * from dolt_diff_stat(@Commit3, @Commit4, 't') inner join t as of @Commit3 on rows_unmodified = t.pk;`, - Expected: []sql.Row{}, + Expected: []sql.UntypedSqlRow{}, }, }, }, @@ -1685,33 +1685,33 @@ inner join t as of @Commit3 on rows_unmodified = t.pk;`, { // table is added, no data diff, result is empty Query: "SELECT * from dolt_diff_stat(@Commit1, @Commit2, 't');", - Expected: []sql.Row{}, + Expected: []sql.UntypedSqlRow{}, }, { Query: "SELECT * from dolt_diff_stat(@Commit2, @Commit3, 't');", - Expected: []sql.Row{{"t", nil, 1, 0, nil, nil, nil, nil, nil, nil, nil, nil}}, + Expected: []sql.UntypedSqlRow{{"t", nil, 1, 0, nil, nil, nil, nil, nil, nil, nil, nil}}, }, { // TODO : (correct result is commented out) // update row for keyless table deletes the row and insert the new row // this causes row added = 3 and row deleted = 1 Query: "SELECT * from dolt_diff_stat(@Commit3, @Commit4, 't');", - //Expected: []sql.Row{{"t", nil, 2, 0, nil, nil, nil, nil, nil, nil, nil, nil}}, - Expected: []sql.Row{{"t", nil, 3, 1, nil, nil, nil, nil, nil, nil, nil, nil}}, + //Expected: []sql.UntypedSqlRow{{"t", nil, 2, 0, nil, nil, nil, nil, nil, nil, nil, nil}}, + Expected: []sql.UntypedSqlRow{{"t", nil, 3, 1, nil, nil, nil, nil, nil, nil, nil, nil}}, }, { Query: "SELECT * from dolt_diff_stat(@Commit4, @Commit3, 't');", - //Expected: []sql.Row{{"t", nil, 0, 2, nil, nil, nil, nil, nil, nil, nil, nil}}, - Expected: []sql.Row{{"t", nil, 1, 3, nil, nil, nil, nil, nil, nil, nil, nil}}, + //Expected: []sql.UntypedSqlRow{{"t", nil, 0, 2, nil, nil, nil, nil, nil, nil, nil, nil}}, + Expected: []sql.UntypedSqlRow{{"t", nil, 1, 3, nil, nil, nil, nil, nil, nil, nil, nil}}, }, { // table is dropped Query: "SELECT * from dolt_diff_stat(@Commit4, @Commit5, 't');", - Expected: []sql.Row{{"t", nil, 0, 3, nil, nil, nil, nil, nil, nil, nil, nil}}, + Expected: []sql.UntypedSqlRow{{"t", nil, 0, 3, nil, nil, nil, nil, nil, nil, nil, nil}}, }, { Query: "SELECT * from dolt_diff_stat(@Commit1, @Commit4, 't');", - Expected: []sql.Row{{"t", nil, 3, 0, nil, nil, nil, nil, nil, nil, nil, nil}}, + Expected: []sql.UntypedSqlRow{{"t", nil, 3, 0, nil, nil, nil, nil, nil, nil, nil, nil}}, }, { Query: "SELECT * from dolt_diff_stat(@Commit1, @Commit5, 't');", @@ -1757,27 +1757,27 @@ inner join t as of @Commit3 on rows_unmodified = t.pk;`, Assertions: []queries.ScriptTestAssertion{ { Query: "SELECT * from dolt_diff_stat(@Commit0, @Commit1);", - Expected: []sql.Row{{"t", 0, 1, 0, 0, 3, 0, 0, 0, 1, 0, 3}}, + Expected: []sql.UntypedSqlRow{{"t", 0, 1, 0, 0, 3, 0, 0, 0, 1, 0, 3}}, }, { Query: "SELECT * from dolt_diff_stat(@Commit1, @Commit2);", - Expected: []sql.Row{{"t2", 0, 1, 0, 0, 3, 0, 0, 0, 1, 0, 3}}, + Expected: []sql.UntypedSqlRow{{"t2", 0, 1, 0, 0, 3, 0, 0, 0, 1, 0, 3}}, }, { Query: "SELECT * from dolt_diff_stat(@Commit2, @Commit3);", - Expected: []sql.Row{{"t", 0, 3, 0, 1, 9, 0, 2, 1, 4, 3, 12}, {"t2", 1, 1, 0, 0, 3, 0, 0, 1, 2, 3, 6}}, + Expected: []sql.UntypedSqlRow{{"t", 0, 3, 0, 1, 9, 0, 2, 1, 4, 3, 12}, {"t2", 1, 1, 0, 0, 3, 0, 0, 1, 2, 3, 6}}, }, { Query: "SELECT * from dolt_diff_stat(@Commit3, @Commit4);", - Expected: []sql.Row{{"t", 3, 0, 1, 0, 0, 3, 0, 4, 3, 12, 9}, {"t2", 1, 0, 0, 1, 0, 0, 1, 2, 2, 6, 6}}, + Expected: []sql.UntypedSqlRow{{"t", 3, 0, 1, 0, 0, 3, 0, 4, 3, 12, 9}, {"t2", 1, 0, 0, 1, 0, 0, 1, 2, 2, 6, 6}}, }, { Query: "SELECT * from dolt_diff_stat(@Commit4, @Commit2);", - Expected: []sql.Row{{"t", 0, 0, 2, 1, 0, 6, 2, 3, 1, 9, 3}, {"t2", 0, 0, 1, 1, 0, 3, 1, 2, 1, 6, 3}}, + Expected: []sql.UntypedSqlRow{{"t", 0, 0, 2, 1, 0, 6, 2, 3, 1, 9, 3}, {"t2", 0, 0, 1, 1, 0, 3, 1, 2, 1, 6, 3}}, }, { Query: "SELECT * from dolt_diff_stat(@Commit3, 'WORKING');", - Expected: []sql.Row{{"t", 3, 0, 1, 0, 0, 3, 0, 4, 3, 12, 9}, {"t2", 1, 0, 0, 1, 0, 0, 1, 2, 2, 6, 6}}, + Expected: []sql.UntypedSqlRow{{"t", 3, 0, 1, 0, 0, 3, 0, 4, 3, 12, 9}, {"t2", 1, 0, 0, 1, 0, 0, 1, 2, 2, 6, 6}}, }, }, }, @@ -1799,31 +1799,31 @@ inner join t as of @Commit3 on rows_unmodified = t.pk;`, Assertions: []queries.ScriptTestAssertion{ { Query: "SELECT * from dolt_diff_stat(@Commit1, 'WORKING', 't')", - Expected: []sql.Row{{"t", 0, 1, 1, 1, 3, 3, 1, 2, 2, 6, 6}}, + Expected: []sql.UntypedSqlRow{{"t", 0, 1, 1, 1, 3, 3, 1, 2, 2, 6, 6}}, }, { Query: "SELECT * from dolt_diff_stat('STAGED', 'WORKING', 't')", - Expected: []sql.Row{{"t", 0, 1, 1, 1, 3, 3, 1, 2, 2, 6, 6}}, + Expected: []sql.UntypedSqlRow{{"t", 0, 1, 1, 1, 3, 3, 1, 2, 2, 6, 6}}, }, { Query: "SELECT * from dolt_diff_stat('STAGED..WORKING', 't')", - Expected: []sql.Row{{"t", 0, 1, 1, 1, 3, 3, 1, 2, 2, 6, 6}}, + Expected: []sql.UntypedSqlRow{{"t", 0, 1, 1, 1, 3, 3, 1, 2, 2, 6, 6}}, }, { Query: "SELECT * from dolt_diff_stat('WORKING', 'STAGED', 't')", - Expected: []sql.Row{{"t", 0, 1, 1, 1, 3, 3, 1, 2, 2, 6, 6}}, + Expected: []sql.UntypedSqlRow{{"t", 0, 1, 1, 1, 3, 3, 1, 2, 2, 6, 6}}, }, { Query: "SELECT * from dolt_diff_stat('WORKING', 'WORKING', 't')", - Expected: []sql.Row{}, + Expected: []sql.UntypedSqlRow{}, }, { Query: "SELECT * from dolt_diff_stat('WORKING..WORKING', 't')", - Expected: []sql.Row{}, + Expected: []sql.UntypedSqlRow{}, }, { Query: "SELECT * from dolt_diff_stat('STAGED', 'STAGED', 't')", - Expected: []sql.Row{}, + Expected: []sql.UntypedSqlRow{}, }, { Query: "call dolt_add('.')", @@ -1831,11 +1831,11 @@ inner join t as of @Commit3 on rows_unmodified = t.pk;`, }, { Query: "SELECT * from dolt_diff_stat('WORKING', 'STAGED', 't')", - Expected: []sql.Row{}, + Expected: []sql.UntypedSqlRow{}, }, { Query: "SELECT * from dolt_diff_stat('HEAD', 'STAGED', 't')", - Expected: []sql.Row{{"t", 0, 1, 1, 1, 3, 3, 1, 2, 2, 6, 6}}, + Expected: []sql.UntypedSqlRow{{"t", 0, 1, 1, 1, 3, 3, 1, 2, 2, 6, 6}}, }, }, }, @@ -1877,74 +1877,74 @@ inner join t as of @Commit3 on rows_unmodified = t.pk;`, Assertions: []queries.ScriptTestAssertion{ { Query: "SELECT * from dolt_diff_stat('main', 'branch1', 't');", - Expected: []sql.Row{{"t", 0, 0, 1, 1, 0, 4, 0, 2, 1, 6, 2}}, + Expected: []sql.UntypedSqlRow{{"t", 0, 0, 1, 1, 0, 4, 0, 2, 1, 6, 2}}, }, { Query: "SELECT * from dolt_diff_stat('main..branch1', 't');", - Expected: []sql.Row{{"t", 0, 0, 1, 1, 0, 4, 0, 2, 1, 6, 2}}, + Expected: []sql.UntypedSqlRow{{"t", 0, 0, 1, 1, 0, 4, 0, 2, 1, 6, 2}}, }, { Query: "SELECT * from dolt_diff_stat('main', 'branch1');", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {"t", 0, 0, 1, 1, 0, 4, 0, 2, 1, 6, 2}, {"newtable", 0, 0, 2, 0, 0, 2, 0, 2, 0, 2, 0}, }, }, { Query: "SELECT * from dolt_diff_stat('main..branch1');", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {"t", 0, 0, 1, 1, 0, 4, 0, 2, 1, 6, 2}, {"newtable", 0, 0, 2, 0, 0, 2, 0, 2, 0, 2, 0}, }, }, { Query: "SELECT * from dolt_diff_stat('branch1', 'main', 't');", - Expected: []sql.Row{{"t", 0, 1, 0, 1, 4, 0, 1, 1, 2, 2, 6}}, + Expected: []sql.UntypedSqlRow{{"t", 0, 1, 0, 1, 4, 0, 1, 1, 2, 2, 6}}, }, { Query: "SELECT * from dolt_diff_stat('branch1..main', 't');", - Expected: []sql.Row{{"t", 0, 1, 0, 1, 4, 0, 1, 1, 2, 2, 6}}, + Expected: []sql.UntypedSqlRow{{"t", 0, 1, 0, 1, 4, 0, 1, 1, 2, 2, 6}}, }, { Query: "SELECT * from dolt_diff_stat('main~2', 'branch1', 't');", - Expected: []sql.Row{{"t", 0, 1, 1, 0, 2, 3, 0, 1, 1, 3, 2}}, + Expected: []sql.UntypedSqlRow{{"t", 0, 1, 1, 0, 2, 3, 0, 1, 1, 3, 2}}, }, { Query: "SELECT * from dolt_diff_stat('main~2..branch1', 't');", - Expected: []sql.Row{{"t", 0, 1, 1, 0, 2, 3, 0, 1, 1, 3, 2}}, + Expected: []sql.UntypedSqlRow{{"t", 0, 1, 1, 0, 2, 3, 0, 1, 1, 3, 2}}, }, // Three dot { Query: "SELECT * from dolt_diff_stat('main...branch1', 't');", - Expected: []sql.Row{{"t", 0, 1, 1, 0, 2, 3, 0, 1, 1, 3, 2}}, + Expected: []sql.UntypedSqlRow{{"t", 0, 1, 1, 0, 2, 3, 0, 1, 1, 3, 2}}, }, { Query: "SELECT * from dolt_diff_stat('main...branch1');", - Expected: []sql.Row{{"t", 0, 1, 1, 0, 2, 3, 0, 1, 1, 3, 2}}, + Expected: []sql.UntypedSqlRow{{"t", 0, 1, 1, 0, 2, 3, 0, 1, 1, 3, 2}}, }, { Query: "SELECT * from dolt_diff_stat('branch1...main', 't');", - Expected: []sql.Row{{"t", 1, 1, 0, 0, 3, 0, 0, 1, 2, 3, 6}}, + Expected: []sql.UntypedSqlRow{{"t", 1, 1, 0, 0, 3, 0, 0, 1, 2, 3, 6}}, }, { Query: "SELECT * from dolt_diff_stat('branch1...main');", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {"t", 1, 1, 0, 0, 3, 0, 0, 1, 2, 3, 6}, {"newtable", 0, 2, 0, 0, 2, 0, 0, 0, 2, 0, 2}, }, }, { Query: "SELECT * from dolt_diff_stat('branch1...main^');", - Expected: []sql.Row{{"t", 1, 1, 0, 0, 3, 0, 0, 1, 2, 3, 6}}, + Expected: []sql.UntypedSqlRow{{"t", 1, 1, 0, 0, 3, 0, 0, 1, 2, 3, 6}}, }, { Query: "SELECT * from dolt_diff_stat('branch1...main', 'newtable');", - Expected: []sql.Row{{"newtable", 0, 2, 0, 0, 2, 0, 0, 0, 2, 0, 2}}, + Expected: []sql.UntypedSqlRow{{"newtable", 0, 2, 0, 0, 2, 0, 0, 0, 2, 0, 2}}, }, { Query: "SELECT * from dolt_diff_stat('main...main', 'newtable');", - Expected: []sql.Row{}, + Expected: []sql.UntypedSqlRow{}, }, }, }, @@ -1977,23 +1977,23 @@ inner join t as of @Commit3 on rows_unmodified = t.pk;`, Assertions: []queries.ScriptTestAssertion{ { Query: "SELECT * from dolt_diff_stat(@Commit1, @Commit2, 't');", - Expected: []sql.Row{{"t", 0, 0, 0, 2, 0, 2, 0, 2, 2, 6, 4}}, + Expected: []sql.UntypedSqlRow{{"t", 0, 0, 0, 2, 0, 2, 0, 2, 2, 6, 4}}, }, { Query: "SELECT * from dolt_diff_stat(@Commit2, @Commit3, 't');", - Expected: []sql.Row{{"t", 2, 1, 0, 0, 2, 0, 0, 2, 3, 4, 6}}, + Expected: []sql.UntypedSqlRow{{"t", 2, 1, 0, 0, 2, 0, 0, 2, 3, 4, 6}}, }, { Query: "SELECT * from dolt_diff_stat(@Commit1, @Commit3, 't');", - Expected: []sql.Row{{"t", 0, 1, 0, 2, 2, 2, 0, 2, 3, 6, 6}}, + Expected: []sql.UntypedSqlRow{{"t", 0, 1, 0, 2, 2, 2, 0, 2, 3, 6, 6}}, }, { Query: "SELECT * from dolt_diff_stat(@Commit3, @Commit4, 't');", - Expected: []sql.Row{{"t", 2, 1, 0, 1, 6, 0, 1, 3, 4, 6, 12}}, + Expected: []sql.UntypedSqlRow{{"t", 2, 1, 0, 1, 6, 0, 1, 3, 4, 6, 12}}, }, { Query: "SELECT * from dolt_diff_stat(@Commit1, @Commit4, 't');", - Expected: []sql.Row{{"t", 0, 2, 0, 2, 6, 0, 2, 2, 4, 6, 12}}, + Expected: []sql.UntypedSqlRow{{"t", 0, 2, 0, 2, 6, 0, 2, 2, 4, 6, 12}}, }, }, }, @@ -2026,23 +2026,23 @@ inner join t as of @Commit3 on rows_unmodified = t.pk;`, Assertions: []queries.ScriptTestAssertion{ { Query: "SELECT * from dolt_diff_stat(@Commit1, @Commit2, 't');", - Expected: []sql.Row{{"t", 0, 2, 0, 0, 6, 0, 0, 0, 2, 0, 6}}, + Expected: []sql.UntypedSqlRow{{"t", 0, 2, 0, 0, 6, 0, 0, 0, 2, 0, 6}}, }, { Query: "SELECT * from dolt_diff_stat(@Commit2, @Commit3, 't');", - Expected: []sql.Row{}, + Expected: []sql.UntypedSqlRow{}, }, { Query: "SELECT * from dolt_diff_stat(@Commit3, @Commit4, 't');", - Expected: []sql.Row{{"t", 1, 1, 0, 1, 3, 0, 1, 2, 3, 6, 9}}, + Expected: []sql.UntypedSqlRow{{"t", 1, 1, 0, 1, 3, 0, 1, 2, 3, 6, 9}}, }, { Query: "SELECT * from dolt_diff_stat(@Commit4, @Commit5, 't');", - Expected: []sql.Row{{"t", 3, 1, 0, 0, 3, 0, 0, 3, 4, 9, 12}}, + Expected: []sql.UntypedSqlRow{{"t", 3, 1, 0, 0, 3, 0, 0, 3, 4, 9, 12}}, }, { Query: "SELECT * from dolt_diff_stat(@Commit1, @Commit5, 't');", - Expected: []sql.Row{{"t", 0, 4, 0, 0, 12, 0, 0, 0, 4, 0, 12}}, + Expected: []sql.UntypedSqlRow{{"t", 0, 4, 0, 0, 12, 0, 0, 0, 4, 0, 12}}, }, }, }, @@ -2054,11 +2054,11 @@ inner join t as of @Commit3 on rows_unmodified = t.pk;`, Assertions: []queries.ScriptTestAssertion{ { Query: "select * from dolt_diff_stat('HEAD', 'WORKING')", - Expected: []sql.Row{}, + Expected: []sql.UntypedSqlRow{}, }, { Query: "select * from dolt_diff_stat('WORKING', 'HEAD')", - Expected: []sql.Row{}, + Expected: []sql.UntypedSqlRow{}, }, { Query: "insert into t1 values (1,2)", @@ -2066,11 +2066,11 @@ inner join t as of @Commit3 on rows_unmodified = t.pk;`, }, { Query: "select * from dolt_diff_stat('HEAD', 'WORKING', 't1')", - Expected: []sql.Row{{"t1", 0, 1, 0, 0, 2, 0, 0, 0, 1, 0, 2}}, + Expected: []sql.UntypedSqlRow{{"t1", 0, 1, 0, 0, 2, 0, 0, 0, 1, 0, 2}}, }, { Query: "select * from dolt_diff_stat('WORKING', 'HEAD', 't1')", - Expected: []sql.Row{{"t1", 0, 0, 1, 0, 0, 2, 0, 1, 0, 2, 0}}, + Expected: []sql.UntypedSqlRow{{"t1", 0, 0, 1, 0, 0, 2, 0, 1, 0, 2, 0}}, }, }, }, @@ -2087,11 +2087,11 @@ inner join t as of @Commit3 on rows_unmodified = t.pk;`, Assertions: []queries.ScriptTestAssertion{ { Query: "select * from dolt_diff_stat('HEAD~', 'HEAD', 't1')", - Expected: []sql.Row{{"t1", 0, 0, 1, 0, 0, 2, 0, 1, 0, 2, 0}}, + Expected: []sql.UntypedSqlRow{{"t1", 0, 0, 1, 0, 0, 2, 0, 1, 0, 2, 0}}, }, { Query: "select * from dolt_diff_stat('HEAD', 'HEAD~', 't1')", - Expected: []sql.Row{{"t1", 0, 1, 0, 0, 2, 0, 0, 0, 1, 0, 2}}, + Expected: []sql.UntypedSqlRow{{"t1", 0, 1, 0, 0, 2, 0, 0, 0, 1, 0, 2}}, }, }, }, @@ -2110,21 +2110,21 @@ inner join t as of @Commit3 on rows_unmodified = t.pk;`, Assertions: []queries.ScriptTestAssertion{ { Query: "select * from dolt_diff_stat('HEAD~', 'HEAD', 't2')", - Expected: []sql.Row{{"t2", 1, 1, 0, 0, 2, 0, 0, 1, 2, 2, 4}}, + Expected: []sql.UntypedSqlRow{{"t2", 1, 1, 0, 0, 2, 0, 0, 1, 2, 2, 4}}, }, { Query: "select * from dolt_diff_stat('HEAD~..HEAD', 't2')", - Expected: []sql.Row{{"t2", 1, 1, 0, 0, 2, 0, 0, 1, 2, 2, 4}}, + Expected: []sql.UntypedSqlRow{{"t2", 1, 1, 0, 0, 2, 0, 0, 1, 2, 2, 4}}, }, { // Old table name can be matched as well Query: "select * from dolt_diff_stat('HEAD~', 'HEAD', 't1')", - Expected: []sql.Row{{"t1", 1, 1, 0, 0, 2, 0, 0, 1, 2, 2, 4}}, + Expected: []sql.UntypedSqlRow{{"t1", 1, 1, 0, 0, 2, 0, 0, 1, 2, 2, 4}}, }, { // Old table name can be matched as well Query: "select * from dolt_diff_stat('HEAD~..HEAD', 't1')", - Expected: []sql.Row{{"t1", 1, 1, 0, 0, 2, 0, 0, 1, 2, 2, 4}}, + Expected: []sql.UntypedSqlRow{{"t1", 1, 1, 0, 0, 2, 0, 0, 1, 2, 2, 4}}, }, }, }, @@ -2146,11 +2146,11 @@ inner join t as of @Commit3 on rows_unmodified = t.pk;`, Assertions: []queries.ScriptTestAssertion{ { Query: "SELECT * from dolt_diff_stat('HEAD~2', 'HEAD');", - Expected: []sql.Row{{"t", 1, 0, 0, 0, 2, 0, 0, 1, 1, 1, 3}}, + Expected: []sql.UntypedSqlRow{{"t", 1, 0, 0, 0, 2, 0, 0, 1, 1, 1, 3}}, }, { Query: "SELECT * from dolt_diff_stat('HEAD~', 'HEAD');", - Expected: []sql.Row{}, + Expected: []sql.UntypedSqlRow{}, }, }, }, @@ -2189,7 +2189,7 @@ inner join t as of @Commit3 on rows_unmodified = t.pk;`, Assertions: []queries.ScriptTestAssertion{ { Query: "SELECT * from dolt_diff_stat('HEAD~', 'HEAD')", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {"t", 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, {"t2", 1, 3, 0, 0, 3, 0, 0, 1, 4, 1, 4}, }, @@ -2305,38 +2305,38 @@ var DiffSummaryTableFunctionScriptTests = []queries.ScriptTest{ { // table does not exist, empty result Query: "SELECT * from dolt_diff_summary(@Commit1, @Commit2, 'doesnotexist');", - Expected: []sql.Row{}, + Expected: []sql.UntypedSqlRow{}, }, { // table is added, no data changes Query: "SELECT * from dolt_diff_summary(@Commit1, @Commit2, 't');", - Expected: []sql.Row{{"", "t", "added", false, true}}, + Expected: []sql.UntypedSqlRow{{"", "t", "added", false, true}}, }, { Query: "SELECT * from dolt_diff_summary(@Commit2, @Commit3, 't');", - Expected: []sql.Row{{"t", "t", "modified", true, false}}, + Expected: []sql.UntypedSqlRow{{"t", "t", "modified", true, false}}, }, { Query: "SELECT * from dolt_diff_summary(@Commit3, @Commit4, 't');", - Expected: []sql.Row{{"t", "t", "modified", true, false}}, + Expected: []sql.UntypedSqlRow{{"t", "t", "modified", true, false}}, }, { // change from and to commits Query: "SELECT * from dolt_diff_summary(@Commit4, @Commit3, 't');", - Expected: []sql.Row{{"t", "t", "modified", true, false}}, + Expected: []sql.UntypedSqlRow{{"t", "t", "modified", true, false}}, }, { // table is dropped Query: "SELECT * from dolt_diff_summary(@Commit4, @Commit5, 't');", - Expected: []sql.Row{{"t", "", "dropped", true, true}}, + Expected: []sql.UntypedSqlRow{{"t", "", "dropped", true, true}}, }, { Query: "SELECT * from dolt_diff_summary(@Commit1, @Commit4, 't');", - Expected: []sql.Row{{"", "t", "added", true, true}}, + Expected: []sql.UntypedSqlRow{{"", "t", "added", true, true}}, }, { Query: "SELECT * from dolt_diff_summary(@Commit1, @Commit5, 't');", - Expected: []sql.Row{}, + Expected: []sql.UntypedSqlRow{}, }, }, }, @@ -2373,32 +2373,32 @@ var DiffSummaryTableFunctionScriptTests = []queries.ScriptTest{ { // table is added, no data diff, result is empty Query: "SELECT * from dolt_diff_summary(@Commit1, @Commit2, 't');", - Expected: []sql.Row{{"", "t", "added", false, true}}, + Expected: []sql.UntypedSqlRow{{"", "t", "added", false, true}}, }, { Query: "SELECT * from dolt_diff_summary(@Commit2, @Commit3, 't');", - Expected: []sql.Row{{"t", "t", "modified", true, false}}, + Expected: []sql.UntypedSqlRow{{"t", "t", "modified", true, false}}, }, { Query: "SELECT * from dolt_diff_summary(@Commit3, @Commit4, 't');", - Expected: []sql.Row{{"t", "t", "modified", true, false}}, + Expected: []sql.UntypedSqlRow{{"t", "t", "modified", true, false}}, }, { Query: "SELECT * from dolt_diff_summary(@Commit4, @Commit3, 't');", - Expected: []sql.Row{{"t", "t", "modified", true, false}}, + Expected: []sql.UntypedSqlRow{{"t", "t", "modified", true, false}}, }, { // table is dropped Query: "SELECT * from dolt_diff_summary(@Commit4, @Commit5, 't');", - Expected: []sql.Row{{"t", "", "dropped", true, true}}, + Expected: []sql.UntypedSqlRow{{"t", "", "dropped", true, true}}, }, { Query: "SELECT * from dolt_diff_summary(@Commit1, @Commit4, 't');", - Expected: []sql.Row{{"", "t", "added", true, true}}, + Expected: []sql.UntypedSqlRow{{"", "t", "added", true, true}}, }, { Query: "SELECT * from dolt_diff_summary(@Commit1, @Commit5, 't');", - Expected: []sql.Row{}, + Expected: []sql.UntypedSqlRow{}, }, }, }, @@ -2440,29 +2440,29 @@ var DiffSummaryTableFunctionScriptTests = []queries.ScriptTest{ Assertions: []queries.ScriptTestAssertion{ { Query: "SELECT * from dolt_diff_summary(@Commit0, @Commit1);", - Expected: []sql.Row{{"", "t", "added", true, true}}, + Expected: []sql.UntypedSqlRow{{"", "t", "added", true, true}}, }, { Query: "SELECT * from dolt_diff_summary(@Commit1, @Commit2);", - Expected: []sql.Row{{"", "t2", "added", true, true}}, + Expected: []sql.UntypedSqlRow{{"", "t2", "added", true, true}}, }, { Query: "SELECT * from dolt_diff_summary(@Commit2, @Commit3);", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {"t", "t", "modified", true, false}, {"t2", "t2", "modified", true, false}, }, }, { Query: "SELECT * from dolt_diff_summary(@Commit3, @Commit4);", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {"t", "t", "modified", true, false}, {"t2", "t2", "modified", true, false}, }, }, { Query: "SELECT * from dolt_diff_summary(@Commit0, @Commit4);", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {"", "t", "added", true, true}, {"", "t2", "added", true, true}, }, @@ -2470,14 +2470,14 @@ var DiffSummaryTableFunctionScriptTests = []queries.ScriptTest{ { Query: "SELECT * from dolt_diff_summary(@Commit4, @Commit2);", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {"t", "t", "modified", true, false}, {"t2", "t2", "modified", true, false}, }, }, { Query: "SELECT * from dolt_diff_summary(@Commit3, 'WORKING');", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {"t", "t", "modified", true, false}, {"t2", "t2", "modified", true, false}, {"", "keyless", "added", false, true}}, @@ -2502,31 +2502,31 @@ var DiffSummaryTableFunctionScriptTests = []queries.ScriptTest{ Assertions: []queries.ScriptTestAssertion{ { Query: "SELECT * from dolt_diff_summary(@Commit1, 'WORKING', 't')", - Expected: []sql.Row{{"t", "t", "modified", true, false}}, + Expected: []sql.UntypedSqlRow{{"t", "t", "modified", true, false}}, }, { Query: "SELECT * from dolt_diff_summary('STAGED', 'WORKING', 't')", - Expected: []sql.Row{{"t", "t", "modified", true, false}}, + Expected: []sql.UntypedSqlRow{{"t", "t", "modified", true, false}}, }, { Query: "SELECT * from dolt_diff_summary('STAGED..WORKING', 't')", - Expected: []sql.Row{{"t", "t", "modified", true, false}}, + Expected: []sql.UntypedSqlRow{{"t", "t", "modified", true, false}}, }, { Query: "SELECT * from dolt_diff_summary('WORKING', 'STAGED', 't')", - Expected: []sql.Row{{"t", "t", "modified", true, false}}, + Expected: []sql.UntypedSqlRow{{"t", "t", "modified", true, false}}, }, { Query: "SELECT * from dolt_diff_summary('WORKING', 'WORKING', 't')", - Expected: []sql.Row{}, + Expected: []sql.UntypedSqlRow{}, }, { Query: "SELECT * from dolt_diff_summary('WORKING..WORKING', 't')", - Expected: []sql.Row{}, + Expected: []sql.UntypedSqlRow{}, }, { Query: "SELECT * from dolt_diff_summary('STAGED', 'STAGED', 't')", - Expected: []sql.Row{}, + Expected: []sql.UntypedSqlRow{}, }, { Query: "call dolt_add('.')", @@ -2534,11 +2534,11 @@ var DiffSummaryTableFunctionScriptTests = []queries.ScriptTest{ }, { Query: "SELECT * from dolt_diff_summary('WORKING', 'STAGED', 't')", - Expected: []sql.Row{}, + Expected: []sql.UntypedSqlRow{}, }, { Query: "SELECT * from dolt_diff_summary('HEAD', 'STAGED', 't')", - Expected: []sql.Row{{"t", "t", "modified", true, false}}, + Expected: []sql.UntypedSqlRow{{"t", "t", "modified", true, false}}, }, }, }, @@ -2580,74 +2580,74 @@ var DiffSummaryTableFunctionScriptTests = []queries.ScriptTest{ Assertions: []queries.ScriptTestAssertion{ { Query: "SELECT * from dolt_diff_summary('main', 'branch1', 't');", - Expected: []sql.Row{{"t", "t", "modified", true, true}}, + Expected: []sql.UntypedSqlRow{{"t", "t", "modified", true, true}}, }, { Query: "SELECT * from dolt_diff_summary('main..branch1', 't');", - Expected: []sql.Row{{"t", "t", "modified", true, true}}, + Expected: []sql.UntypedSqlRow{{"t", "t", "modified", true, true}}, }, { Query: "SELECT * from dolt_diff_summary('main', 'branch1');", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {"t", "t", "modified", true, true}, {"newtable", "", "dropped", true, true}, }, }, { Query: "SELECT * from dolt_diff_summary('main..branch1');", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {"t", "t", "modified", true, true}, {"newtable", "", "dropped", true, true}, }, }, { Query: "SELECT * from dolt_diff_summary('branch1', 'main', 't');", - Expected: []sql.Row{{"t", "t", "modified", true, true}}, + Expected: []sql.UntypedSqlRow{{"t", "t", "modified", true, true}}, }, { Query: "SELECT * from dolt_diff_summary('branch1..main', 't');", - Expected: []sql.Row{{"t", "t", "modified", true, true}}, + Expected: []sql.UntypedSqlRow{{"t", "t", "modified", true, true}}, }, { Query: "SELECT * from dolt_diff_summary('main~2', 'branch1', 't');", - Expected: []sql.Row{{"t", "t", "modified", true, true}}, + Expected: []sql.UntypedSqlRow{{"t", "t", "modified", true, true}}, }, { Query: "SELECT * from dolt_diff_summary('main~2..branch1', 't');", - Expected: []sql.Row{{"t", "t", "modified", true, true}}, + Expected: []sql.UntypedSqlRow{{"t", "t", "modified", true, true}}, }, // Three dot { Query: "SELECT * from dolt_diff_summary('main...branch1', 't');", - Expected: []sql.Row{{"t", "t", "modified", true, true}}, + Expected: []sql.UntypedSqlRow{{"t", "t", "modified", true, true}}, }, { Query: "SELECT * from dolt_diff_summary('main...branch1');", - Expected: []sql.Row{{"t", "t", "modified", true, true}}, + Expected: []sql.UntypedSqlRow{{"t", "t", "modified", true, true}}, }, { Query: "SELECT * from dolt_diff_summary('branch1...main', 't');", - Expected: []sql.Row{{"t", "t", "modified", true, false}}, + Expected: []sql.UntypedSqlRow{{"t", "t", "modified", true, false}}, }, { Query: "SELECT * from dolt_diff_summary('branch1...main');", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {"t", "t", "modified", true, false}, {"", "newtable", "added", true, true}, }, }, { Query: "SELECT * from dolt_diff_summary('branch1...main^');", - Expected: []sql.Row{{"t", "t", "modified", true, false}}, + Expected: []sql.UntypedSqlRow{{"t", "t", "modified", true, false}}, }, { Query: "SELECT * from dolt_diff_summary('branch1...main', 'newtable');", - Expected: []sql.Row{{"", "newtable", "added", true, true}}, + Expected: []sql.UntypedSqlRow{{"", "newtable", "added", true, true}}, }, { Query: "SELECT * from dolt_diff_summary('main...main', 'newtable');", - Expected: []sql.Row{}, + Expected: []sql.UntypedSqlRow{}, }, }, }, @@ -2684,27 +2684,27 @@ var DiffSummaryTableFunctionScriptTests = []queries.ScriptTest{ Assertions: []queries.ScriptTestAssertion{ { Query: "SELECT * from dolt_diff_summary(@Commit1, @Commit2, 't');", - Expected: []sql.Row{{"t", "t", "modified", true, true}}, + Expected: []sql.UntypedSqlRow{{"t", "t", "modified", true, true}}, }, { Query: "SELECT * from dolt_diff_summary(@Commit2, @Commit3, 't');", - Expected: []sql.Row{{"t", "t", "modified", true, false}}, + Expected: []sql.UntypedSqlRow{{"t", "t", "modified", true, false}}, }, { Query: "SELECT * from dolt_diff_summary(@Commit1, @Commit3, 't');", - Expected: []sql.Row{{"t", "t", "modified", true, true}}, + Expected: []sql.UntypedSqlRow{{"t", "t", "modified", true, true}}, }, { Query: "SELECT * from dolt_diff_summary(@Commit3, @Commit4, 't');", - Expected: []sql.Row{{"t", "t", "modified", false, true}}, + Expected: []sql.UntypedSqlRow{{"t", "t", "modified", false, true}}, }, { Query: "SELECT * from dolt_diff_summary(@Commit3, @Commit5, 't');", - Expected: []sql.Row{{"t", "t", "modified", true, true}}, + Expected: []sql.UntypedSqlRow{{"t", "t", "modified", true, true}}, }, { Query: "SELECT * from dolt_diff_summary(@Commit1, @Commit5, 't');", - Expected: []sql.Row{{"t", "t", "modified", true, false}}, + Expected: []sql.UntypedSqlRow{{"t", "t", "modified", true, false}}, }, }, }, @@ -2741,23 +2741,23 @@ var DiffSummaryTableFunctionScriptTests = []queries.ScriptTest{ Assertions: []queries.ScriptTestAssertion{ { Query: "SELECT * from dolt_diff_summary(@Commit1, @Commit2, 't');", - Expected: []sql.Row{{"t", "t", "modified", true, false}}, + Expected: []sql.UntypedSqlRow{{"t", "t", "modified", true, false}}, }, { Query: "SELECT * from dolt_diff_summary(@Commit2, @Commit3, 't');", - Expected: []sql.Row{{"t", "t", "modified", false, true}}, + Expected: []sql.UntypedSqlRow{{"t", "t", "modified", false, true}}, }, { Query: "SELECT * from dolt_diff_summary(@Commit3, @Commit4, 't');", - Expected: []sql.Row{{"t", "t", "modified", true, false}}, + Expected: []sql.UntypedSqlRow{{"t", "t", "modified", true, false}}, }, { Query: "SELECT * from dolt_diff_summary(@Commit4, @Commit5, 't');", - Expected: []sql.Row{{"t", "t", "modified", true, true}}, + Expected: []sql.UntypedSqlRow{{"t", "t", "modified", true, true}}, }, { Query: "SELECT * from dolt_diff_summary(@Commit1, @Commit5, 't');", - Expected: []sql.Row{{"t", "t", "modified", true, false}}, + Expected: []sql.UntypedSqlRow{{"t", "t", "modified", true, false}}, }, }, }, @@ -2770,11 +2770,11 @@ var DiffSummaryTableFunctionScriptTests = []queries.ScriptTest{ Assertions: []queries.ScriptTestAssertion{ { Query: "select * from dolt_diff_summary('HEAD', 'WORKING')", - Expected: []sql.Row{{"", "t1", "added", false, true}}, + Expected: []sql.UntypedSqlRow{{"", "t1", "added", false, true}}, }, { Query: "select * from dolt_diff_summary('WORKING', 'HEAD')", - Expected: []sql.Row{{"t1", "", "dropped", false, true}}, + Expected: []sql.UntypedSqlRow{{"t1", "", "dropped", false, true}}, }, { Query: "insert into t1 values (1,2)", @@ -2782,11 +2782,11 @@ var DiffSummaryTableFunctionScriptTests = []queries.ScriptTest{ }, { Query: "select * from dolt_diff_summary('HEAD', 'WORKING', 't1')", - Expected: []sql.Row{{"", "t1", "added", true, true}}, + Expected: []sql.UntypedSqlRow{{"", "t1", "added", true, true}}, }, { Query: "select * from dolt_diff_summary('WORKING', 'HEAD', 't1')", - Expected: []sql.Row{{"t1", "", "dropped", true, true}}, + Expected: []sql.UntypedSqlRow{{"t1", "", "dropped", true, true}}, }, }, }, @@ -2804,11 +2804,11 @@ var DiffSummaryTableFunctionScriptTests = []queries.ScriptTest{ Assertions: []queries.ScriptTestAssertion{ { Query: "select * from dolt_diff_summary('HEAD~', 'HEAD', 't1')", - Expected: []sql.Row{{"t1", "", "dropped", true, true}}, + Expected: []sql.UntypedSqlRow{{"t1", "", "dropped", true, true}}, }, { Query: "select * from dolt_diff_summary('HEAD', 'HEAD~', 't1')", - Expected: []sql.Row{{"", "t1", "added", true, true}}, + Expected: []sql.UntypedSqlRow{{"", "t1", "added", true, true}}, }, }, }, @@ -2828,29 +2828,29 @@ var DiffSummaryTableFunctionScriptTests = []queries.ScriptTest{ Assertions: []queries.ScriptTestAssertion{ { Query: "select * from dolt_diff_summary('HEAD~', 'HEAD', 't2')", - Expected: []sql.Row{{"t1", "t2", "renamed", true, true}}, + Expected: []sql.UntypedSqlRow{{"t1", "t2", "renamed", true, true}}, }, { Query: "select * from dolt_diff_summary('HEAD~..HEAD', 't2')", - Expected: []sql.Row{{"t1", "t2", "renamed", true, true}}, + Expected: []sql.UntypedSqlRow{{"t1", "t2", "renamed", true, true}}, }, { Query: "select * from dolt_diff_summary('HEAD~', 'HEAD')", - Expected: []sql.Row{{"t1", "t2", "renamed", true, true}}, + Expected: []sql.UntypedSqlRow{{"t1", "t2", "renamed", true, true}}, }, { Query: "select * from dolt_diff_summary('HEAD~..HEAD')", - Expected: []sql.Row{{"t1", "t2", "renamed", true, true}}, + Expected: []sql.UntypedSqlRow{{"t1", "t2", "renamed", true, true}}, }, { // Old table name can be matched as well Query: "select * from dolt_diff_summary('HEAD~', 'HEAD', 't1')", - Expected: []sql.Row{{"t1", "t2", "renamed", true, true}}, + Expected: []sql.UntypedSqlRow{{"t1", "t2", "renamed", true, true}}, }, { // Old table name can be matched as well Query: "select * from dolt_diff_summary('HEAD~..HEAD', 't1')", - Expected: []sql.Row{{"t1", "t2", "renamed", true, true}}, + Expected: []sql.UntypedSqlRow{{"t1", "t2", "renamed", true, true}}, }, }, }, @@ -2873,15 +2873,15 @@ var DiffSummaryTableFunctionScriptTests = []queries.ScriptTest{ Assertions: []queries.ScriptTestAssertion{ { Query: "SELECT * from dolt_diff_summary(@Commit1, @Commit2);", - Expected: []sql.Row{{"", "test2", "added", true, true}}, + Expected: []sql.UntypedSqlRow{{"", "test2", "added", true, true}}, }, { Query: "SELECT * from dolt_diff_summary('HEAD', 'WORKING');", - Expected: []sql.Row{{"test2", "test2", "modified", false, true}}, + Expected: []sql.UntypedSqlRow{{"test2", "test2", "modified", false, true}}, }, { Query: "SELECT * from dolt_diff_summary(@Commit1, 'WORKING');", - Expected: []sql.Row{{"", "test2", "added", true, true}}, + Expected: []sql.UntypedSqlRow{{"", "test2", "added", true, true}}, }, }, }, @@ -2903,11 +2903,11 @@ var DiffSummaryTableFunctionScriptTests = []queries.ScriptTest{ Assertions: []queries.ScriptTestAssertion{ { Query: "SELECT * from dolt_diff_summary('HEAD~2', 'HEAD');", - Expected: []sql.Row{{"t", "t", "modified", false, true}}, + Expected: []sql.UntypedSqlRow{{"t", "t", "modified", false, true}}, }, { Query: "SELECT * from dolt_diff_summary('HEAD~', 'HEAD');", - Expected: []sql.Row{}, + Expected: []sql.UntypedSqlRow{}, }, }, }, @@ -2946,7 +2946,7 @@ var DiffSummaryTableFunctionScriptTests = []queries.ScriptTest{ Assertions: []queries.ScriptTestAssertion{ { Query: "SELECT * from dolt_diff_summary('HEAD~', 'HEAD')", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {"t2", "t2", "modified", true, false}, }, ExpectedWarning: dtables.PrimaryKeyChangeWarningCode, @@ -3073,19 +3073,19 @@ var PatchTableFunctionScriptTests = []queries.ScriptTest{ { // table is added, no data diff, result is empty Query: "SELECT * from dolt_patch(@Commit1, @Commit2, 't') WHERE diff_type = 'data';", - Expected: []sql.Row{}, + Expected: []sql.UntypedSqlRow{}, }, { Query: "SELECT statement_order, table_name, statement from dolt_patch(@Commit1, @Commit2, 't') WHERE diff_type = 'schema';", - Expected: []sql.Row{{1, "t", "CREATE TABLE `t` (\n `pk` int NOT NULL,\n `c1` varchar(20),\n `c2` varchar(20),\n PRIMARY KEY (`pk`)\n) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_bin;"}}, + Expected: []sql.UntypedSqlRow{{1, "t", "CREATE TABLE `t` (\n `pk` int NOT NULL,\n `c1` varchar(20),\n `c2` varchar(20),\n PRIMARY KEY (`pk`)\n) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_bin;"}}, }, { Query: "SELECT statement_order, table_name, diff_type, statement from dolt_patch(@Commit2, @Commit3, 't');", - Expected: []sql.Row{{1, "t", "data", "INSERT INTO `t` (`pk`,`c1`,`c2`) VALUES (1,'one','two');"}}, + Expected: []sql.UntypedSqlRow{{1, "t", "data", "INSERT INTO `t` (`pk`,`c1`,`c2`) VALUES (1,'one','two');"}}, }, { Query: "SELECT statement_order, table_name, diff_type, statement from dolt_patch(@Commit3, @Commit4, 't');", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {1, "t", "data", "UPDATE `t` SET `c1`='uno',`c2`='dos' WHERE `pk`=1;"}, {2, "t", "data", "INSERT INTO `t` (`pk`,`c1`,`c2`) VALUES (2,'two','three');"}, {3, "t", "data", "INSERT INTO `t` (`pk`,`c1`,`c2`) VALUES (3,'three','four');"}, @@ -3094,7 +3094,7 @@ var PatchTableFunctionScriptTests = []queries.ScriptTest{ { // change from and to commits Query: "SELECT statement_order, table_name, diff_type, statement from dolt_patch(@Commit4, @Commit3, 't');", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {1, "t", "data", "UPDATE `t` SET `c1`='one',`c2`='two' WHERE `pk`=1;"}, {2, "t", "data", "DELETE FROM `t` WHERE `pk`=2;"}, {3, "t", "data", "DELETE FROM `t` WHERE `pk`=3;"}, @@ -3103,11 +3103,11 @@ var PatchTableFunctionScriptTests = []queries.ScriptTest{ { // table is dropped Query: "SELECT statement_order, table_name, diff_type, statement from dolt_patch(@Commit4, @Commit5, 't');", - Expected: []sql.Row{{1, "t", "schema", "DROP TABLE `t`;"}}, + Expected: []sql.UntypedSqlRow{{1, "t", "schema", "DROP TABLE `t`;"}}, }, { Query: "SELECT statement_order, table_name, diff_type, statement from dolt_patch(@Commit1, @Commit4, 't');", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {1, "t", "schema", "CREATE TABLE `t` (\n `pk` int NOT NULL,\n `c1` varchar(20),\n `c2` varchar(20),\n PRIMARY KEY (`pk`)\n) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_bin;"}, {2, "t", "data", "INSERT INTO `t` (`pk`,`c1`,`c2`) VALUES (1,'uno','dos');"}, {3, "t", "data", "INSERT INTO `t` (`pk`,`c1`,`c2`) VALUES (2,'two','three');"}, @@ -3134,7 +3134,7 @@ var PatchTableFunctionScriptTests = []queries.ScriptTest{ Assertions: []queries.ScriptTestAssertion{ { Query: "select statement from dolt_patch('HEAD~', 'HEAD', 't');", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {"INSERT INTO `t` (`pk`,`c1`) VALUES (0x012345,NULL);"}, {"INSERT INTO `t` (`pk`,`c1`) VALUES (0x054321,0x6566675f213400000000000000000000);"}, {"UPDATE `t` SET `c1`=0xeeee0000000000000000000000000000 WHERE `pk`=0x42;"}, @@ -3180,21 +3180,21 @@ var PatchTableFunctionScriptTests = []queries.ScriptTest{ Assertions: []queries.ScriptTestAssertion{ { Query: "SELECT statement_order, table_name, diff_type, statement from dolt_patch(@Commit0, @Commit1);", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {1, "t", "schema", "CREATE TABLE `t` (\n `pk` int NOT NULL,\n `c1` varchar(20),\n `c2` varchar(20),\n PRIMARY KEY (`pk`)\n) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_bin;"}, {2, "t", "data", "INSERT INTO `t` (`pk`,`c1`,`c2`) VALUES (1,'one','two');"}, }, }, { Query: "SELECT statement_order, table_name, diff_type, statement from dolt_patch(@Commit1, @Commit2);", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {1, "t2", "schema", "CREATE TABLE `t2` (\n `pk` int NOT NULL,\n `c1` varchar(20),\n `c2` varchar(20),\n PRIMARY KEY (`pk`)\n) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_bin;"}, {2, "t2", "data", "INSERT INTO `t2` (`pk`,`c1`,`c2`) VALUES (100,'hundred','hundert');"}, }, }, { Query: "SELECT statement_order, table_name, diff_type, statement from dolt_patch(@Commit2, @Commit3);", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {1, "t", "data", "UPDATE `t` SET `c1`='uno',`c2`='dos' WHERE `pk`=1;"}, {2, "t", "data", "INSERT INTO `t` (`pk`,`c1`,`c2`) VALUES (2,'two','three');"}, {3, "t", "data", "INSERT INTO `t` (`pk`,`c1`,`c2`) VALUES (3,'three','four');"}, @@ -3204,14 +3204,14 @@ var PatchTableFunctionScriptTests = []queries.ScriptTest{ }, { Query: "SELECT statement_order, table_name, diff_type, statement from dolt_patch(@Commit3, @Commit4);", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {1, "t", "data", "DELETE FROM `t` WHERE `pk`=3;"}, {2, "t2", "data", "UPDATE `t2` SET `c2`='zero' WHERE `pk`=100;"}, }, }, { Query: "SELECT statement_order, table_name, diff_type, statement from dolt_patch(@Commit4, @Commit2);", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {1, "t", "data", "UPDATE `t` SET `c1`='one',`c2`='two' WHERE `pk`=1;"}, {2, "t", "data", "DELETE FROM `t` WHERE `pk`=2;"}, {3, "t", "data", "DELETE FROM `t` WHERE `pk`=4;"}, @@ -3221,7 +3221,7 @@ var PatchTableFunctionScriptTests = []queries.ScriptTest{ }, { Query: "SELECT statement_order, table_name, diff_type, statement from dolt_patch(@Commit3, 'WORKING');", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {1, "keyless", "schema", "CREATE TABLE `keyless` (\n `id` int\n) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_bin;"}, {2, "t", "data", "DELETE FROM `t` WHERE `pk`=3;"}, {3, "t2", "data", "UPDATE `t2` SET `c2`='zero' WHERE `pk`=100;"}, @@ -3243,7 +3243,7 @@ var PatchTableFunctionScriptTests = []queries.ScriptTest{ Assertions: []queries.ScriptTestAssertion{ { Query: "SELECT statement_order, table_name, diff_type, statement FROM dolt_patch('HEAD', 'WORKING', 't')", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {1, "t", "schema", "ALTER TABLE `t` RENAME COLUMN `c1` TO `c0`;"}, {2, "t", "schema", "ALTER TABLE `t` DROP `c4`;"}, {3, "t", "schema", "ALTER TABLE `t` ADD `c6` bigint;"}, @@ -3257,7 +3257,7 @@ var PatchTableFunctionScriptTests = []queries.ScriptTest{ }, { Query: "SELECT * FROM dolt_patch('STAGED', 'WORKING', 't')", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {1, "STAGED", "WORKING", "t", "schema", "ALTER TABLE `t` RENAME COLUMN `c1` TO `c0`;"}, {2, "STAGED", "WORKING", "t", "schema", "ALTER TABLE `t` DROP `c4`;"}, {3, "STAGED", "WORKING", "t", "schema", "ALTER TABLE `t` ADD `c6` bigint;"}, @@ -3271,7 +3271,7 @@ var PatchTableFunctionScriptTests = []queries.ScriptTest{ }, { Query: "SELECT * FROM dolt_patch('STAGED..WORKING', 't')", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {1, "STAGED", "WORKING", "t", "schema", "ALTER TABLE `t` RENAME COLUMN `c1` TO `c0`;"}, {2, "STAGED", "WORKING", "t", "schema", "ALTER TABLE `t` DROP `c4`;"}, {3, "STAGED", "WORKING", "t", "schema", "ALTER TABLE `t` ADD `c6` bigint;"}, @@ -3285,7 +3285,7 @@ var PatchTableFunctionScriptTests = []queries.ScriptTest{ }, { Query: "SELECT * FROM dolt_patch('WORKING', 'STAGED', 't')", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {1, "WORKING", "STAGED", "t", "schema", "ALTER TABLE `t` RENAME COLUMN `c0` TO `c1`;"}, {2, "WORKING", "STAGED", "t", "schema", "ALTER TABLE `t` DROP `c6`;"}, {3, "WORKING", "STAGED", "t", "schema", "ALTER TABLE `t` ADD `c4` int;"}, @@ -3299,15 +3299,15 @@ var PatchTableFunctionScriptTests = []queries.ScriptTest{ }, { Query: "SELECT statement_order, table_name, diff_type, statement FROM dolt_patch('WORKING', 'WORKING', 't')", - Expected: []sql.Row{}, + Expected: []sql.UntypedSqlRow{}, }, { Query: "SELECT statement_order, table_name, diff_type, statement FROM dolt_patch('WORKING..WORKING', 't')", - Expected: []sql.Row{}, + Expected: []sql.UntypedSqlRow{}, }, { Query: "SELECT statement_order, table_name, diff_type, statement FROM dolt_patch('STAGED', 'STAGED', 't')", - Expected: []sql.Row{}, + Expected: []sql.UntypedSqlRow{}, }, { Query: "call dolt_add('.')", @@ -3315,11 +3315,11 @@ var PatchTableFunctionScriptTests = []queries.ScriptTest{ }, { Query: "SELECT statement_order, table_name, diff_type, statement FROM dolt_patch('WORKING', 'STAGED', 't')", - Expected: []sql.Row{}, + Expected: []sql.UntypedSqlRow{}, }, { Query: "SELECT statement_order, table_name, diff_type, statement FROM dolt_patch('HEAD', 'STAGED', 't')", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {1, "t", "schema", "ALTER TABLE `t` RENAME COLUMN `c1` TO `c0`;"}, {2, "t", "schema", "ALTER TABLE `t` DROP `c4`;"}, {3, "t", "schema", "ALTER TABLE `t` ADD `c6` bigint;"}, @@ -3367,21 +3367,21 @@ var PatchTableFunctionScriptTests = []queries.ScriptTest{ Assertions: []queries.ScriptTestAssertion{ { Query: "SELECT statement_order, table_name, diff_type, statement FROM dolt_patch('main', 'branch1', 't');", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {1, "t", "schema", "ALTER TABLE `t` DROP `c2`;"}, {2, "t", "data", "DELETE FROM `t` WHERE `pk`=1;"}, }, }, { Query: "SELECT statement_order, table_name, diff_type, statement FROM dolt_patch('main..branch1', 't');", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {1, "t", "schema", "ALTER TABLE `t` DROP `c2`;"}, {2, "t", "data", "DELETE FROM `t` WHERE `pk`=1;"}, }, }, { Query: "SELECT statement_order, table_name, diff_type, statement FROM dolt_patch('main', 'branch1');", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {1, "newtable", "schema", "DROP TABLE `newtable`;"}, {2, "t", "schema", "ALTER TABLE `t` DROP `c2`;"}, {3, "t", "data", "DELETE FROM `t` WHERE `pk`=1;"}, @@ -3389,7 +3389,7 @@ var PatchTableFunctionScriptTests = []queries.ScriptTest{ }, { Query: "SELECT statement_order, table_name, diff_type, statement FROM dolt_patch('main..branch1');", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {1, "newtable", "schema", "DROP TABLE `newtable`;"}, {2, "t", "schema", "ALTER TABLE `t` DROP `c2`;"}, {3, "t", "data", "DELETE FROM `t` WHERE `pk`=1;"}, @@ -3397,7 +3397,7 @@ var PatchTableFunctionScriptTests = []queries.ScriptTest{ }, { Query: "SELECT statement_order, table_name, diff_type, statement FROM dolt_patch('branch1', 'main', 't');", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {1, "t", "schema", "ALTER TABLE `t` ADD `c2` varchar(20);"}, {2, "t", "data", "INSERT INTO `t` (`pk`,`c1`,`c2`) VALUES (1,'one','two');"}, {3, "t", "data", "UPDATE `t` SET `c2`='three' WHERE `pk`=2;"}, @@ -3405,7 +3405,7 @@ var PatchTableFunctionScriptTests = []queries.ScriptTest{ }, { Query: "SELECT statement_order, table_name, diff_type, statement FROM dolt_patch('branch1..main', 't');", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {1, "t", "schema", "ALTER TABLE `t` ADD `c2` varchar(20);"}, {2, "t", "data", "INSERT INTO `t` (`pk`,`c1`,`c2`) VALUES (1,'one','two');"}, {3, "t", "data", "UPDATE `t` SET `c2`='three' WHERE `pk`=2;"}, @@ -3413,7 +3413,7 @@ var PatchTableFunctionScriptTests = []queries.ScriptTest{ }, { Query: "SELECT statement_order, table_name, diff_type, statement FROM dolt_patch('main~2', 'branch1', 't');", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {1, "t", "schema", "ALTER TABLE `t` DROP `c2`;"}, {2, "t", "data", "DELETE FROM `t` WHERE `pk`=1;"}, {3, "t", "data", "INSERT INTO `t` (`pk`,`c1`) VALUES (2,'two');"}, @@ -3421,7 +3421,7 @@ var PatchTableFunctionScriptTests = []queries.ScriptTest{ }, { Query: "SELECT statement_order, table_name, diff_type, statement FROM dolt_patch('main~2..branch1', 't');", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {1, "t", "schema", "ALTER TABLE `t` DROP `c2`;"}, {2, "t", "data", "DELETE FROM `t` WHERE `pk`=1;"}, {3, "t", "data", "INSERT INTO `t` (`pk`,`c1`) VALUES (2,'two');"}, @@ -3430,7 +3430,7 @@ var PatchTableFunctionScriptTests = []queries.ScriptTest{ // Three dot { Query: "SELECT statement_order, table_name, diff_type, statement FROM dolt_patch('main...branch1', 't');", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {1, "t", "schema", "ALTER TABLE `t` DROP `c2`;"}, {2, "t", "data", "DELETE FROM `t` WHERE `pk`=1;"}, {3, "t", "data", "INSERT INTO `t` (`pk`,`c1`) VALUES (2,'two');"}, @@ -3438,7 +3438,7 @@ var PatchTableFunctionScriptTests = []queries.ScriptTest{ }, { Query: "SELECT statement_order, table_name, diff_type, statement FROM dolt_patch('main...branch1');", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {1, "t", "schema", "ALTER TABLE `t` DROP `c2`;"}, {2, "t", "data", "DELETE FROM `t` WHERE `pk`=1;"}, {3, "t", "data", "INSERT INTO `t` (`pk`,`c1`) VALUES (2,'two');"}, @@ -3446,11 +3446,11 @@ var PatchTableFunctionScriptTests = []queries.ScriptTest{ }, { Query: "SELECT statement_order, table_name, diff_type, statement FROM dolt_patch('branch1...main', 't');", - Expected: []sql.Row{{1, "t", "data", "INSERT INTO `t` (`pk`,`c1`,`c2`) VALUES (2,'two','three');"}}, + Expected: []sql.UntypedSqlRow{{1, "t", "data", "INSERT INTO `t` (`pk`,`c1`,`c2`) VALUES (2,'two','three');"}}, }, { Query: "SELECT statement_order, table_name, diff_type, statement FROM dolt_patch('branch1...main');", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {1, "newtable", "schema", "CREATE TABLE `newtable` (\n `pk` int NOT NULL,\n PRIMARY KEY (`pk`)\n) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_bin;"}, {2, "newtable", "data", "INSERT INTO `newtable` (`pk`) VALUES (1);"}, {3, "newtable", "data", "INSERT INTO `newtable` (`pk`) VALUES (2);"}, @@ -3459,11 +3459,11 @@ var PatchTableFunctionScriptTests = []queries.ScriptTest{ }, { Query: "SELECT statement_order, table_name, diff_type, statement FROM dolt_patch('branch1...main^');", - Expected: []sql.Row{{1, "t", "data", "INSERT INTO `t` (`pk`,`c1`,`c2`) VALUES (2,'two','three');"}}, + Expected: []sql.UntypedSqlRow{{1, "t", "data", "INSERT INTO `t` (`pk`,`c1`,`c2`) VALUES (2,'two','three');"}}, }, { Query: "SELECT statement_order, table_name, diff_type, statement FROM dolt_patch('branch1...main', 'newtable');", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {1, "newtable", "schema", "CREATE TABLE `newtable` (\n `pk` int NOT NULL,\n PRIMARY KEY (`pk`)\n) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_bin;"}, {2, "newtable", "data", "INSERT INTO `newtable` (`pk`) VALUES (1);"}, {3, "newtable", "data", "INSERT INTO `newtable` (`pk`) VALUES (2);"}, @@ -3471,7 +3471,7 @@ var PatchTableFunctionScriptTests = []queries.ScriptTest{ }, { Query: "SELECT statement_order, table_name, diff_type, statement FROM dolt_patch('main...main', 'newtable');", - Expected: []sql.Row{}, + Expected: []sql.UntypedSqlRow{}, }, }, }, @@ -3490,14 +3490,14 @@ var PatchTableFunctionScriptTests = []queries.ScriptTest{ Assertions: []queries.ScriptTestAssertion{ { Query: "select statement_order, table_name, diff_type, statement FROM dolt_patch('HEAD~', 'HEAD', 't2')", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {1, "t2", "schema", "RENAME TABLE `t1` TO `t2`;"}, {2, "t2", "data", "INSERT INTO `t2` (`a`,`b`) VALUES (3,4);"}, }, }, { Query: "select statement_order, table_name, diff_type, statement FROM dolt_patch('HEAD~..HEAD', 't2')", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {1, "t2", "schema", "RENAME TABLE `t1` TO `t2`;"}, {2, "t2", "data", "INSERT INTO `t2` (`a`,`b`) VALUES (3,4);"}, }, @@ -3505,7 +3505,7 @@ var PatchTableFunctionScriptTests = []queries.ScriptTest{ { // Old table name can be matched as well Query: "select statement_order, table_name, diff_type, statement FROM dolt_patch('HEAD~', 'HEAD', 't1')", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {1, "t2", "schema", "RENAME TABLE `t1` TO `t2`;"}, {2, "t2", "data", "INSERT INTO `t2` (`a`,`b`) VALUES (3,4);"}, }, @@ -3513,7 +3513,7 @@ var PatchTableFunctionScriptTests = []queries.ScriptTest{ { // Old table name can be matched as well Query: "select statement_order, table_name, diff_type, statement FROM dolt_patch('HEAD~..HEAD', 't1')", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {1, "t2", "schema", "RENAME TABLE `t1` TO `t2`;"}, {2, "t2", "data", "INSERT INTO `t2` (`a`,`b`) VALUES (3,4);"}, }, @@ -3535,7 +3535,7 @@ var PatchTableFunctionScriptTests = []queries.ScriptTest{ Assertions: []queries.ScriptTestAssertion{ { Query: "SELECT statement_order, table_name, diff_type, statement FROM dolt_patch('HEAD~', 'WORKING')", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {1, "child", "schema", "CREATE TABLE `child` (\n `id` int NOT NULL,\n `v1` int,\n PRIMARY KEY (`id`),\n KEY `fk_named` (`v1`),\n CONSTRAINT `fk_named` FOREIGN KEY (`v1`) REFERENCES `parent` (`v1`)\n) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_bin;"}, {2, "parent", "schema", "CREATE TABLE `parent` (\n `id` int NOT NULL,\n `id_ext` int NOT NULL,\n `v1` int,\n `v2` text COMMENT 'tag:1',\n PRIMARY KEY (`id`,`id_ext`),\n KEY `v1` (`v1`)\n) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_bin;"}, {3, "parent", "data", "INSERT INTO `parent` (`id`,`id_ext`,`v1`,`v2`) VALUES (0,1,2,NULL);"}, @@ -3543,7 +3543,7 @@ var PatchTableFunctionScriptTests = []queries.ScriptTest{ }, { Query: "SELECT statement_order, to_commit_hash, table_name, diff_type, statement FROM dolt_patch('HEAD', 'STAGED')", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {1, "STAGED", "child", "schema", "ALTER TABLE `child` ADD INDEX `fk_named`(`v1`);"}, {2, "STAGED", "child", "schema", "ALTER TABLE `child` ADD CONSTRAINT `fk_named` FOREIGN KEY (`v1`) REFERENCES `parent` (`v1`);"}, {3, "STAGED", "parent", "schema", "ALTER TABLE `parent` DROP PRIMARY KEY;"}, @@ -3553,7 +3553,7 @@ var PatchTableFunctionScriptTests = []queries.ScriptTest{ }, { Query: "SHOW WARNINGS;", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {"Warning", 1235, "Primary key sets differ between revisions for table 'parent', skipping data diff"}, }, }, @@ -3567,7 +3567,7 @@ var PatchTableFunctionScriptTests = []queries.ScriptTest{ Assertions: []queries.ScriptTestAssertion{ { Query: "SELECT statement_order, table_name, diff_type, statement FROM dolt_patch('HEAD', 'WORKING')", - Expected: []sql.Row{{1, "foo", "schema", "CREATE TABLE `foo` (\n `pk` int NOT NULL,\n `c1` int,\n PRIMARY KEY (`pk`),\n CONSTRAINT `foo_chk_eq3jn5ra` CHECK ((c1 > 3))\n) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_bin;"}}, + Expected: []sql.UntypedSqlRow{{1, "foo", "schema", "CREATE TABLE `foo` (\n `pk` int NOT NULL,\n `c1` int,\n PRIMARY KEY (`pk`),\n CONSTRAINT `foo_chk_eq3jn5ra` CHECK ((c1 > 3))\n) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_bin;"}}, }, }, }, @@ -3589,14 +3589,14 @@ var PatchTableFunctionScriptTests = []queries.ScriptTest{ Assertions: []queries.ScriptTestAssertion{ { Query: "select * from dolt_patch(@commit1, @commit0);", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {1, doltCommit, doltCommit, "t", "schema", "ALTER TABLE `t` COLLATE='utf8mb4_0900_bin';"}, {2, doltCommit, doltCommit, "t", "data", "DELETE FROM `t` WHERE `pk`=1;"}, }, }, { Query: "select * from dolt_patch(@commit1, @commit2);", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {1, doltCommit, doltCommit, "t", "schema", "ALTER TABLE `t` COLLATE='utf8mb3_general_ci';"}, {2, doltCommit, doltCommit, "t", "data", "INSERT INTO `t` (`pk`) VALUES (2);"}, }, @@ -3622,7 +3622,7 @@ var PatchTableFunctionScriptTests = []queries.ScriptTest{ Assertions: []queries.ScriptTestAssertion{ { Query: "SELECT statement FROM dolt_patch('main', 'other', 't') ORDER BY statement_order", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {"ALTER TABLE `t` MODIFY COLUMN `a` varchar(100) COMMENT 'foo';"}, {"ALTER TABLE `t` DROP `b`;"}, {"ALTER TABLE `t` RENAME COLUMN `c` TO `z`;"}, @@ -3703,7 +3703,7 @@ var PatchTableFunctionScriptTests = []queries.ScriptTest{ Assertions: []queries.ScriptTestAssertion{ { Query: "SELECT statement FROM dolt_patch('main', 'other') ORDER BY statement_order", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {"DROP TABLE `MOTOR_TARIFA_COEFICIENTE_RIESGO_060`;"}, {"DROP TABLE `MOTOR_TARIFA_COEFICIENTE_RIESGO_060_01`;"}, {"CREATE TABLE `MOTOR_TARIFA_COEFICIENTE_RIESGO_144_075` (\n" + @@ -3767,44 +3767,44 @@ var UnscopedDiffSystemTableScriptTests = []queries.ScriptTest{ Assertions: []queries.ScriptTestAssertion{ { Query: "SELECT COUNT(*) FROM DOLT_DIFF;", - Expected: []sql.Row{{7}}, + Expected: []sql.UntypedSqlRow{{7}}, }, { Query: "SELECT COUNT(*) FROM DOLT_DIFF WHERE commit_hash = @Commit1;", - Expected: []sql.Row{{3}}, + Expected: []sql.UntypedSqlRow{{3}}, }, { Query: "SELECT * FROM DOLT_DIFF WHERE commit_hash = @Commit1 AND committer <> 'root';", - Expected: []sql.Row{}, + Expected: []sql.UntypedSqlRow{}, }, { Query: "SELECT commit_hash, committer FROM DOLT_DIFF WHERE commit_hash <> @Commit1 AND committer = 'root' AND commit_hash NOT IN ('WORKING','STAGED');", - Expected: []sql.Row{}, + Expected: []sql.UntypedSqlRow{}, }, { Query: "SELECT commit_hash, table_name FROM DOLT_DIFF WHERE commit_hash = 'WORKING'", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {"WORKING", "newRenamedEmptyTable"}, {"WORKING", "regularTable"}, }, }, { Query: "SELECT commit_hash, table_name FROM DOLT_DIFF WHERE commit_hash = 'STAGED'", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {"STAGED", "addedTable"}, {"STAGED", "droppedTable"}, }, }, { Query: "SELECT commit_hash, table_name FROM DOLT_DIFF WHERE commit_hash <> @Commit1 AND commit_hash NOT IN ('STAGED') ORDER BY table_name;", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {"WORKING", "newRenamedEmptyTable"}, {"WORKING", "regularTable"}, }, }, { Query: "SELECT commit_hash, table_name FROM DOLT_DIFF WHERE commit_hash <> @Commit1 OR committer <> 'root' ORDER BY table_name;", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {"STAGED", "addedTable"}, {"STAGED", "droppedTable"}, {"WORKING", "newRenamedEmptyTable"}, @@ -3813,7 +3813,7 @@ var UnscopedDiffSystemTableScriptTests = []queries.ScriptTest{ }, { Query: "SELECT * FROM DOLT_DIFF WHERE COMMIT_HASH in ('WORKING', 'STAGED') ORDER BY table_name;", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {"STAGED", "addedTable", nil, nil, nil, nil, false, true}, {"STAGED", "droppedTable", nil, nil, nil, nil, true, true}, {"WORKING", "newRenamedEmptyTable", nil, nil, nil, nil, false, true}, @@ -3850,19 +3850,19 @@ var UnscopedDiffSystemTableScriptTests = []queries.ScriptTest{ Assertions: []queries.ScriptTestAssertion{ { Query: "SELECT COUNT(*) FROM DOLT_DIFF", - Expected: []sql.Row{{6}}, + Expected: []sql.UntypedSqlRow{{6}}, }, { Query: "select table_name, schema_change, data_change from DOLT_DIFF where commit_hash = @Commit1", - Expected: []sql.Row{{"x", true, true}, {"y", true, false}}, + Expected: []sql.UntypedSqlRow{{"x", true, true}, {"y", true, false}}, }, { Query: "select table_name, schema_change, data_change from DOLT_DIFF where commit_hash in (@Commit2)", - Expected: []sql.Row{{"z", true, true}}, + Expected: []sql.UntypedSqlRow{{"z", true, true}}, }, { Query: "select table_name, schema_change, data_change from DOLT_DIFF where commit_hash in (@Commit3)", - Expected: []sql.Row{{"y", false, true}, {"z", false, true}}, + Expected: []sql.UntypedSqlRow{{"y", false, true}, {"z", false, true}}, }, }, }, @@ -3896,23 +3896,23 @@ var UnscopedDiffSystemTableScriptTests = []queries.ScriptTest{ Assertions: []queries.ScriptTestAssertion{ { Query: "SELECT COUNT(*) FROM DOLT_DIFF", - Expected: []sql.Row{{5}}, + Expected: []sql.UntypedSqlRow{{5}}, }, { Query: "select table_name, schema_change, data_change from DOLT_DIFF where commit_hash in (@Commit1)", - Expected: []sql.Row{{"x", true, true}, {"y", true, false}}, + Expected: []sql.UntypedSqlRow{{"x", true, true}, {"y", true, false}}, }, { Query: "select table_name, schema_change, data_change from DOLT_DIFF where commit_hash in (@Commit2)", - Expected: []sql.Row{{"z", true, true}}, + Expected: []sql.UntypedSqlRow{{"z", true, true}}, }, { Query: "select table_name, schema_change, data_change from DOLT_DIFF where commit_hash in (@Commit3)", - Expected: []sql.Row{{"x1", true, true}}, + Expected: []sql.UntypedSqlRow{{"x1", true, true}}, }, { Query: "select table_name, schema_change, data_change from DOLT_DIFF where commit_hash in (@Commit4)", - Expected: []sql.Row{{"x2", true, false}}, + Expected: []sql.UntypedSqlRow{{"x2", true, false}}, }, }, }, @@ -3937,19 +3937,19 @@ var UnscopedDiffSystemTableScriptTests = []queries.ScriptTest{ Assertions: []queries.ScriptTestAssertion{ { Query: "SELECT COUNT(*) FROM DOLT_DIFF", - Expected: []sql.Row{{4}}, + Expected: []sql.UntypedSqlRow{{4}}, }, { Query: "select table_name, schema_change, data_change from DOLT_DIFF where commit_hash in (@Commit1)", - Expected: []sql.Row{{"x", true, true}, {"y", true, false}}, + Expected: []sql.UntypedSqlRow{{"x", true, true}, {"y", true, false}}, }, { Query: "select table_name, schema_change, data_change from DOLT_DIFF where commit_hash in (@Commit2)", - Expected: []sql.Row{{"x", true, true}}, + Expected: []sql.UntypedSqlRow{{"x", true, true}}, }, { Query: "select table_name, schema_change, data_change from DOLT_DIFF where commit_hash in (@Commit3)", - Expected: []sql.Row{{"y", true, false}}, + Expected: []sql.UntypedSqlRow{{"y", true, false}}, }, }, }, @@ -3971,19 +3971,19 @@ var UnscopedDiffSystemTableScriptTests = []queries.ScriptTest{ Assertions: []queries.ScriptTestAssertion{ { Query: "SELECT COUNT(*) FROM DOLT_DIFF", - Expected: []sql.Row{{3}}, + Expected: []sql.UntypedSqlRow{{3}}, }, { Query: "select table_name, schema_change, data_change from DOLT_DIFF where commit_hash in (@Commit1)", - Expected: []sql.Row{{"x", true, true}, {"y", true, false}}, + Expected: []sql.UntypedSqlRow{{"x", true, true}, {"y", true, false}}, }, { Query: "select table_name, schema_change, data_change from DOLT_DIFF where commit_hash in (@Commit2)", - Expected: []sql.Row{}, + Expected: []sql.UntypedSqlRow{}, }, { Query: "select table_name, schema_change, data_change from DOLT_DIFF where commit_hash in (@Commit3)", - Expected: []sql.Row{{"y", false, true}}, + Expected: []sql.UntypedSqlRow{{"y", false, true}}, }, }, }, @@ -4013,19 +4013,19 @@ var UnscopedDiffSystemTableScriptTests = []queries.ScriptTest{ Assertions: []queries.ScriptTestAssertion{ { Query: "SELECT COUNT(*) FROM DOLT_DIFF", - Expected: []sql.Row{{5}}, + Expected: []sql.UntypedSqlRow{{5}}, }, { Query: "select table_name, schema_change, data_change from DOLT_DIFF where commit_hash in (@Commit1)", - Expected: []sql.Row{{"x", true, true}, {"y", true, false}}, + Expected: []sql.UntypedSqlRow{{"x", true, true}, {"y", true, false}}, }, { Query: "select table_name, schema_change, data_change from DOLT_DIFF where commit_hash in (@Commit2)", - Expected: []sql.Row{{"z", true, true}}, + Expected: []sql.UntypedSqlRow{{"z", true, true}}, }, { Query: "select table_name, schema_change, data_change from DOLT_DIFF where commit_hash in (@Commit3)", - Expected: []sql.Row{{"y", false, true}, {"z", false, true}}, + Expected: []sql.UntypedSqlRow{{"y", false, true}, {"z", false, true}}, }, }, }, @@ -4055,19 +4055,19 @@ var UnscopedDiffSystemTableScriptTests = []queries.ScriptTest{ Assertions: []queries.ScriptTestAssertion{ { Query: "SELECT COUNT(*) FROM DOLT_DIFF", - Expected: []sql.Row{{5}}, + Expected: []sql.UntypedSqlRow{{5}}, }, { Query: "select table_name, schema_change, data_change from DOLT_DIFF where commit_hash in (@Commit1)", - Expected: []sql.Row{{"x", true, true}, {"y", true, false}}, + Expected: []sql.UntypedSqlRow{{"x", true, true}, {"y", true, false}}, }, { Query: "select table_name, schema_change, data_change from DOLT_DIFF where commit_hash in (@Commit2)", - Expected: []sql.Row{{"z", true, true}}, + Expected: []sql.UntypedSqlRow{{"z", true, true}}, }, { Query: "select table_name, schema_change, data_change from DOLT_DIFF where commit_hash in (@Commit3) order by table_name", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {"x", true, true}, {"y", true, false}, }, @@ -4098,7 +4098,7 @@ var ColumnDiffSystemTableScriptTests = []queries.ScriptTest{ Assertions: []queries.ScriptTestAssertion{ { Query: "SELECT table_name, column_name, diff_type FROM DOLT_COLUMN_DIFF WHERE table_name = 'modifiedTable';", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {"modifiedTable", "a", "added"}, {"modifiedTable", "b", "added"}, {"modifiedTable", "b", "modified"}, @@ -4106,7 +4106,7 @@ var ColumnDiffSystemTableScriptTests = []queries.ScriptTest{ }, { Query: "SELECT table_name, column_name, diff_type FROM DOLT_COLUMN_DIFF WHERE table_name = 'droppedTable';", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {"droppedTable", "a", "added"}, {"droppedTable", "b", "added"}, {"droppedTable", "a", "removed"}, @@ -4115,14 +4115,14 @@ var ColumnDiffSystemTableScriptTests = []queries.ScriptTest{ }, { Query: "SELECT table_name, column_name, diff_type FROM DOLT_COLUMN_DIFF WHERE table_name = 'renamedTable' OR table_name = 'newRenamedTable';", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {"renamedTable", "a", "added"}, {"renamedTable", "b", "added"}, }, }, { Query: "SELECT table_name, column_name, diff_type FROM DOLT_COLUMN_DIFF WHERE table_name = 'addedTable';", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {"addedTable", "a", "added"}, {"addedTable", "b", "added"}, }, @@ -4147,7 +4147,7 @@ var ColumnDiffSystemTableScriptTests = []queries.ScriptTest{ Assertions: []queries.ScriptTestAssertion{ { Query: "SELECT commit_hash, table_name, column_name, diff_type FROM DOLT_COLUMN_DIFF WHERE table_name = 'modifiedTable' ORDER BY commit_hash, table_name, column_name;", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {"STAGED", "modifiedTable", "a", "added"}, {"STAGED", "modifiedTable", "b", "added"}, {"WORKING", "modifiedTable", "b", "modified"}, @@ -4155,7 +4155,7 @@ var ColumnDiffSystemTableScriptTests = []queries.ScriptTest{ }, { Query: "SELECT commit_hash, table_name, column_name, diff_type FROM DOLT_COLUMN_DIFF WHERE table_name = 'droppedTable' ORDER BY commit_hash, table_name, column_name;", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {"STAGED", "droppedTable", "a", "added"}, {"STAGED", "droppedTable", "b", "added"}, {"WORKING", "droppedTable", "a", "removed"}, @@ -4164,14 +4164,14 @@ var ColumnDiffSystemTableScriptTests = []queries.ScriptTest{ }, { Query: "SELECT commit_hash, table_name, column_name, diff_type FROM DOLT_COLUMN_DIFF WHERE table_name = 'renamedTable' OR table_name = 'newRenamedTable' ORDER BY commit_hash, table_name, column_name;", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {"STAGED", "renamedTable", "a", "added"}, {"STAGED", "renamedTable", "b", "added"}, }, }, { Query: "SELECT commit_hash, table_name, column_name, diff_type FROM DOLT_COLUMN_DIFF WHERE table_name = 'addedTable' ORDER BY commit_hash, table_name, column_name;", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {"WORKING", "addedTable", "a", "added"}, {"WORKING", "addedTable", "b", "added"}, }, @@ -4195,11 +4195,11 @@ var ColumnDiffSystemTableScriptTests = []queries.ScriptTest{ Assertions: []queries.ScriptTestAssertion{ { Query: "select count(*) from dolt_column_diff where commit_hash = @Commit1;", - Expected: []sql.Row{{2}}, + Expected: []sql.UntypedSqlRow{{2}}, }, { Query: "select table_name, column_name, diff_type from dolt_column_diff where commit_hash = @Commit2;", - Expected: []sql.Row{{"t", "d", "added"}}, + Expected: []sql.UntypedSqlRow{{"t", "d", "added"}}, }, }, }, @@ -4215,11 +4215,11 @@ var ColumnDiffSystemTableScriptTests = []queries.ScriptTest{ Assertions: []queries.ScriptTestAssertion{ { Query: "select count(*) from dolt_column_diff where commit_hash = 'STAGED';", - Expected: []sql.Row{{2}}, + Expected: []sql.UntypedSqlRow{{2}}, }, { Query: "select table_name, column_name, diff_type from dolt_column_diff where commit_hash = 'WORKING';", - Expected: []sql.Row{{"t", "d", "added"}}, + Expected: []sql.UntypedSqlRow{{"t", "d", "added"}}, }, }, }, @@ -4240,11 +4240,11 @@ var ColumnDiffSystemTableScriptTests = []queries.ScriptTest{ Assertions: []queries.ScriptTestAssertion{ { Query: "select count(*) from dolt_column_diff where commit_hash = @Commit1;", - Expected: []sql.Row{{2}}, + Expected: []sql.UntypedSqlRow{{2}}, }, { Query: "select table_name, column_name, diff_type from dolt_column_diff where commit_hash = @Commit2;", - Expected: []sql.Row{{"t", "c", "modified"}}, + Expected: []sql.UntypedSqlRow{{"t", "c", "modified"}}, }, }, }, @@ -4260,11 +4260,11 @@ var ColumnDiffSystemTableScriptTests = []queries.ScriptTest{ Assertions: []queries.ScriptTestAssertion{ { Query: "select count(*) from dolt_column_diff where commit_hash = 'STAGED';", - Expected: []sql.Row{{2}}, + Expected: []sql.UntypedSqlRow{{2}}, }, { Query: "select table_name, column_name, diff_type from dolt_column_diff where commit_hash = 'WORKING';", - Expected: []sql.Row{{"t", "c", "modified"}}, + Expected: []sql.UntypedSqlRow{{"t", "c", "modified"}}, }, }, }, @@ -4285,11 +4285,11 @@ var ColumnDiffSystemTableScriptTests = []queries.ScriptTest{ Assertions: []queries.ScriptTestAssertion{ { Query: "select count(*) from dolt_column_diff where commit_hash = @Commit1;", - Expected: []sql.Row{{2}}, + Expected: []sql.UntypedSqlRow{{2}}, }, { Query: "select table_name, column_name, diff_type from dolt_column_diff where commit_hash = @Commit2;", - Expected: []sql.Row{{"t", "c", "removed"}}, + Expected: []sql.UntypedSqlRow{{"t", "c", "removed"}}, }, }, }, @@ -4305,11 +4305,11 @@ var ColumnDiffSystemTableScriptTests = []queries.ScriptTest{ Assertions: []queries.ScriptTestAssertion{ { Query: "select count(*) from dolt_column_diff where commit_hash = 'STAGED';", - Expected: []sql.Row{{2}}, + Expected: []sql.UntypedSqlRow{{2}}, }, { Query: "select table_name, column_name, diff_type from dolt_column_diff where commit_hash = 'WORKING';", - Expected: []sql.Row{{"t", "c", "removed"}}, + Expected: []sql.UntypedSqlRow{{"t", "c", "removed"}}, }, }, }, @@ -4334,24 +4334,24 @@ var ColumnDiffSystemTableScriptTests = []queries.ScriptTest{ Assertions: []queries.ScriptTestAssertion{ { Query: "SELECT COUNT(*) FROM DOLT_COLUMN_DIFF;", - Expected: []sql.Row{{5}}, + Expected: []sql.UntypedSqlRow{{5}}, }, { Query: "SELECT table_name, column_name, diff_type FROM DOLT_COLUMN_DIFF WHERE commit_hash=@Commit1;", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {"t", "pk", "added"}, {"t", "c", "added"}, }, }, { Query: "SELECT table_name, column_name, diff_type FROM DOLT_COLUMN_DIFF WHERE commit_hash=@Commit2;", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {"t", "c", "removed"}, }, }, { Query: "SELECT table_name, column_name, diff_type FROM DOLT_COLUMN_DIFF WHERE commit_hash=@Commit3", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {"t", "pk", "modified"}, {"t", "c", "added"}, }, @@ -4372,18 +4372,18 @@ var ColumnDiffSystemTableScriptTests = []queries.ScriptTest{ Assertions: []queries.ScriptTestAssertion{ { Query: "SELECT COUNT(*) FROM DOLT_COLUMN_DIFF;", - Expected: []sql.Row{{4}}, + Expected: []sql.UntypedSqlRow{{4}}, }, { Query: "SELECT table_name, column_name, diff_type FROM DOLT_COLUMN_DIFF WHERE commit_hash='STAGED';", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {"t", "pk", "added"}, {"t", "c", "added"}, }, }, { Query: "SELECT table_name, column_name, diff_type FROM DOLT_COLUMN_DIFF WHERE commit_hash='WORKING';", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {"t", "pk", "modified"}, {"t", "c", "modified"}, }, @@ -4411,11 +4411,11 @@ var ColumnDiffSystemTableScriptTests = []queries.ScriptTest{ Assertions: []queries.ScriptTestAssertion{ { Query: "SELECT COUNT(*) FROM DOLT_COLUMN_DIFF;", - Expected: []sql.Row{{6}}, + Expected: []sql.UntypedSqlRow{{6}}, }, { Query: "SELECT table_name, column_name, diff_type FROM DOLT_COLUMN_DIFF WHERE commit_hash=@Commit1;", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {"t", "pk", "added"}, {"t", "c1", "added"}, {"t", "c2", "added"}, @@ -4423,13 +4423,13 @@ var ColumnDiffSystemTableScriptTests = []queries.ScriptTest{ }, { Query: "SELECT table_name, column_name, diff_type FROM DOLT_COLUMN_DIFF WHERE commit_hash=@Commit2;", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {"t", "c1", "removed"}, }, }, { Query: "SELECT table_name, column_name, diff_type FROM DOLT_COLUMN_DIFF WHERE commit_hash=@Commit3;", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {"t", "pk", "modified"}, {"t", "c1", "modified"}, }, @@ -4450,11 +4450,11 @@ var ColumnDiffSystemTableScriptTests = []queries.ScriptTest{ Assertions: []queries.ScriptTestAssertion{ { Query: "SELECT COUNT(*) FROM DOLT_COLUMN_DIFF;", - Expected: []sql.Row{{6}}, + Expected: []sql.UntypedSqlRow{{6}}, }, { Query: "SELECT table_name, column_name, diff_type FROM DOLT_COLUMN_DIFF WHERE commit_hash='STAGED';", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {"t", "pk", "added"}, {"t", "c1", "added"}, {"t", "c2", "added"}, @@ -4462,7 +4462,7 @@ var ColumnDiffSystemTableScriptTests = []queries.ScriptTest{ }, { Query: "SELECT table_name, column_name, diff_type FROM DOLT_COLUMN_DIFF WHERE commit_hash='WORKING';", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {"t", "pk", "modified"}, {"t", "c1", "removed"}, {"t", "c1", "modified"}, @@ -4491,24 +4491,24 @@ var ColumnDiffSystemTableScriptTests = []queries.ScriptTest{ Assertions: []queries.ScriptTestAssertion{ { Query: "SELECT COUNT(*) FROM DOLT_COLUMN_DIFF;", - Expected: []sql.Row{{5}}, + Expected: []sql.UntypedSqlRow{{5}}, }, { Query: "SELECT table_name, column_name, diff_type FROM DOLT_COLUMN_DIFF WHERE commit_hash=@Commit1;", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {"t", "pk", "added"}, {"t", "c", "added"}, }, }, { Query: "SELECT table_name, column_name, diff_type FROM DOLT_COLUMN_DIFF WHERE commit_hash=@Commit2;", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {"t", "c", "removed"}, }, }, { Query: "SELECT table_name, column_name, diff_type FROM DOLT_COLUMN_DIFF WHERE commit_hash=@Commit3;", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {"t", "pk", "modified"}, {"t", "c", "added"}, }, @@ -4529,18 +4529,18 @@ var ColumnDiffSystemTableScriptTests = []queries.ScriptTest{ Assertions: []queries.ScriptTestAssertion{ { Query: "SELECT COUNT(*) FROM DOLT_COLUMN_DIFF;", - Expected: []sql.Row{{5}}, + Expected: []sql.UntypedSqlRow{{5}}, }, { Query: "SELECT table_name, column_name, diff_type FROM DOLT_COLUMN_DIFF WHERE commit_hash='STAGED';", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {"t", "pk", "added"}, {"t", "c", "added"}, }, }, { Query: "SELECT table_name, column_name, diff_type FROM DOLT_COLUMN_DIFF WHERE commit_hash='WORKING';", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {"t", "pk", "modified"}, {"t", "c", "removed"}, {"t", "c", "added"}, @@ -4569,24 +4569,24 @@ var ColumnDiffSystemTableScriptTests = []queries.ScriptTest{ Assertions: []queries.ScriptTestAssertion{ { Query: "SELECT COUNT(*) FROM DOLT_COLUMN_DIFF;", - Expected: []sql.Row{{5}}, + Expected: []sql.UntypedSqlRow{{5}}, }, { Query: "SELECT table_name, column_name, diff_type FROM DOLT_COLUMN_DIFF WHERE commit_hash=@Commit1;", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {"t", "pk", "added"}, {"t", "c", "added"}, }, }, { Query: "SELECT table_name, column_name, diff_type FROM DOLT_COLUMN_DIFF WHERE commit_hash=@Commit2;", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {"t", "c", "removed"}, }, }, { Query: "SELECT table_name, column_name, diff_type FROM DOLT_COLUMN_DIFF WHERE commit_hash=@Commit3;", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {"t", "pk", "modified"}, {"t", "c", "added"}, }, @@ -4607,18 +4607,18 @@ var ColumnDiffSystemTableScriptTests = []queries.ScriptTest{ Assertions: []queries.ScriptTestAssertion{ { Query: "SELECT COUNT(*) FROM DOLT_COLUMN_DIFF;", - Expected: []sql.Row{{5}}, + Expected: []sql.UntypedSqlRow{{5}}, }, { Query: "SELECT table_name, column_name, diff_type FROM DOLT_COLUMN_DIFF WHERE commit_hash='STAGED';", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {"t", "pk", "added"}, {"t", "c", "added"}, }, }, { Query: "SELECT table_name, column_name, diff_type FROM DOLT_COLUMN_DIFF WHERE commit_hash='WORKING';", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {"t", "pk", "modified"}, {"t", "c", "removed"}, {"t", "c", "added"}, @@ -4652,31 +4652,31 @@ var ColumnDiffSystemTableScriptTests = []queries.ScriptTest{ Assertions: []queries.ScriptTestAssertion{ { Query: "SELECT COUNT(*) FROM DOLT_COLUMN_DIFF;", - Expected: []sql.Row{{7}}, + Expected: []sql.UntypedSqlRow{{7}}, }, { Query: "SELECT table_name, column_name, diff_type FROM DOLT_COLUMN_DIFF WHERE commit_hash=@Commit1;", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {"t", "pk", "added"}, {"t", "c1", "added"}, }, }, { Query: "SELECT table_name, column_name, diff_type FROM DOLT_COLUMN_DIFF WHERE commit_hash=@Commit2;", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {"t", "pk", "modified"}, {"t", "c2", "modified"}, }, }, { Query: "SELECT table_name, column_name, diff_type FROM DOLT_COLUMN_DIFF WHERE commit_hash=@Commit3;", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {"t", "c2", "removed"}, }, }, { Query: "SELECT table_name, column_name, diff_type FROM DOLT_COLUMN_DIFF WHERE commit_hash=@Commit4;", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {"t", "pk", "modified"}, {"t", "c2", "added"}, }, @@ -4700,18 +4700,18 @@ var ColumnDiffSystemTableScriptTests = []queries.ScriptTest{ Assertions: []queries.ScriptTestAssertion{ { Query: "SELECT COUNT(*) FROM DOLT_COLUMN_DIFF;", - Expected: []sql.Row{{5}}, + Expected: []sql.UntypedSqlRow{{5}}, }, { Query: "SELECT table_name, column_name, diff_type FROM DOLT_COLUMN_DIFF WHERE commit_hash='STAGED';", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {"t", "pk", "added"}, {"t", "c1", "added"}, }, }, { Query: "SELECT table_name, column_name, diff_type FROM DOLT_COLUMN_DIFF WHERE commit_hash='WORKING';", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {"t", "pk", "modified"}, {"t", "c1", "removed"}, {"t", "c2", "added"}, @@ -4744,32 +4744,32 @@ var ColumnDiffSystemTableScriptTests = []queries.ScriptTest{ Assertions: []queries.ScriptTestAssertion{ { Query: "SELECT COUNT(*) FROM DOLT_COLUMN_DIFF;", - Expected: []sql.Row{{8}}, + Expected: []sql.UntypedSqlRow{{8}}, }, { Query: "SELECT table_name, column_name, diff_type FROM DOLT_COLUMN_DIFF WHERE commit_hash=@Commit1;", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {"t", "pk", "added"}, {"t", "c1", "added"}, }, }, { Query: "SELECT table_name, column_name, diff_type FROM DOLT_COLUMN_DIFF WHERE commit_hash=@Commit2;", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {"t", "pk", "modified"}, {"t", "c1", "modified"}, }, }, { Query: "SELECT table_name, column_name, diff_type FROM DOLT_COLUMN_DIFF WHERE commit_hash=@Commit3;", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {"t", "pk", "modified"}, {"t", "c1", "modified"}, }, }, { Query: "SELECT table_name, column_name, diff_type FROM DOLT_COLUMN_DIFF WHERE commit_hash=@Commit4;", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {"t", "pk", "modified"}, {"t", "c1", "modified"}, }, @@ -4790,18 +4790,18 @@ var ColumnDiffSystemTableScriptTests = []queries.ScriptTest{ Assertions: []queries.ScriptTestAssertion{ { Query: "SELECT COUNT(*) FROM DOLT_COLUMN_DIFF;", - Expected: []sql.Row{{4}}, + Expected: []sql.UntypedSqlRow{{4}}, }, { Query: "SELECT table_name, column_name, diff_type FROM DOLT_COLUMN_DIFF WHERE commit_hash='STAGED';", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {"t", "pk", "added"}, {"t", "c1", "added"}, }, }, { Query: "SELECT table_name, column_name, diff_type FROM DOLT_COLUMN_DIFF WHERE commit_hash='WORKING';", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {"t", "pk", "modified"}, {"t", "c1", "modified"}, }, @@ -4823,7 +4823,7 @@ var ColumnDiffSystemTableScriptTests = []queries.ScriptTest{ Assertions: []queries.ScriptTestAssertion{ { Query: "select column_name, diff_type from dolt_column_diff;", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {"j", "modified"}, {"pk", "added"}, {"j", "added"}, @@ -4887,7 +4887,7 @@ var CommitDiffSystemTableScriptTests = []queries.ScriptTest{ Assertions: []queries.ScriptTestAssertion{ { Query: "SELECT to_pk, to_c1, to_c2, from_pk, from_c1, from_c2, diff_type FROM DOLT_COMMIT_DIFF_t WHERE TO_COMMIT=@Commit1 and FROM_COMMIT=@Commit0;", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {1, 2, 3, nil, nil, nil, "added"}, {4, 5, 6, nil, nil, nil, "added"}, }, @@ -4895,32 +4895,32 @@ var CommitDiffSystemTableScriptTests = []queries.ScriptTest{ { // Test case-insensitive table name Query: "SELECT to_pk, to_c1, to_c2, from_pk, from_c1, from_c2, diff_type FROM DOLT_COMMIT_DIFF_T WHERE TO_COMMIT=@Commit1 and FROM_COMMIT=@Commit0;", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {1, 2, 3, nil, nil, nil, "added"}, {4, 5, 6, nil, nil, nil, "added"}, }, }, { Query: "SELECT to_pk, to_c1, to_c2, from_pk, from_c1, from_c2, diff_type FROM DOLT_COMMIT_DIFF_t WHERE TO_COMMIT=@Commit2 and FROM_COMMIT=@Commit1 ORDER BY to_pk;", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {1, 2, 0, 1, 2, 3, "modified"}, }, }, { Query: "SELECT to_pk, to_c1, to_c2, from_pk, from_c1, from_c2, diff_type FROM DOLT_COMMIT_DIFF_T WHERE TO_COMMIT=@Commit4 and FROM_COMMIT=@Commit1 ORDER BY to_pk;", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {1, 2, -2, 1, 2, 3, "modified"}, }, }, { Query: "SELECT to_pk, to_c1, to_c2, from_pk, from_c1, from_c2, diff_type FROM DOLT_commit_DIFF_t WHERE TO_COMMIT=@Commit5 and FROM_COMMIT=@Commit4 ORDER BY to_pk;", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {nil, nil, nil, 1, 2, -2, "removed"}, }, }, { Query: "SELECT to_pk, to_c1, to_c2, from_pk, from_c1, from_c2, diff_type FROM DOLT_COMMIT_DIFF_t WHERE TO_COMMIT=@Commit5 and FROM_COMMIT=@Commit0 ORDER BY to_pk;", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {4, 5, 6, nil, nil, nil, "added"}, }, }, @@ -4944,14 +4944,14 @@ var CommitDiffSystemTableScriptTests = []queries.ScriptTest{ Assertions: []queries.ScriptTestAssertion{ { Query: "SELECT to_pk, to_c2, from_pk, from_c2 FROM DOLT_COMMIT_DIFF_t WHERE TO_COMMIT=@Commit1 and FROM_COMMIT=@Commit0 ORDER BY to_pk;", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {1, 3, nil, nil}, {4, 6, nil, nil}, }, }, { Query: "SELECT to_pk, to_c2, from_pk, from_c2 FROM DOLT_COMMIT_DIFF_t WHERE TO_COMMIT=@Commit2 and FROM_COMMIT=@Commit1 ORDER BY to_pk;", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {1, 3, 1, 3}, {4, 6, 4, 6}, }, @@ -4981,21 +4981,21 @@ var CommitDiffSystemTableScriptTests = []queries.ScriptTest{ Assertions: []queries.ScriptTestAssertion{ { Query: "SELECT to_pk, to_c, from_pk, from_c, diff_type FROM DOLT_COMMIT_DIFF_t WHERE TO_COMMIT=@Commit1 and FROM_COMMIT=@Commit0 ORDER BY to_pk;", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {1, 2, nil, nil, "added"}, {3, 4, nil, nil, "added"}, }, }, { Query: "SELECT to_pk, from_pk, from_c, diff_type FROM DOLT_COMMIT_DIFF_t WHERE TO_COMMIT=@Commit2 and FROM_COMMIT=@Commit1 ORDER BY to_pk;", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {1, 1, 2, "modified"}, {3, 3, 4, "modified"}, }, }, { Query: "SELECT to_pk, to_c, from_pk, from_c, diff_type FROM DOLT_COMMIT_DIFF_t WHERE TO_COMMIT=@Commit3 and FROM_COMMIT=@Commit2 ORDER BY to_pk;", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {100, 101, nil, nil, "added"}, }, }, @@ -5024,21 +5024,21 @@ var CommitDiffSystemTableScriptTests = []queries.ScriptTest{ Assertions: []queries.ScriptTestAssertion{ { Query: "SELECT to_pk, to_c1, from_pk, from_c1, diff_type FROM DOLT_COMMIT_DIFF_t WHERE TO_COMMIT=@Commit1 and FROM_COMMIT=@Commit0 ORDER BY to_pk;", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {1, 2, nil, nil, "added"}, {4, 5, nil, nil, "added"}, }, }, { Query: "SELECT to_pk, to_c1, from_pk, from_c1, diff_type FROM DOLT_COMMIT_DIFF_t WHERE TO_COMMIT=@Commit2 and FROM_COMMIT=@Commit1 ORDER BY to_pk;", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {1, nil, 1, 2, "modified"}, {4, nil, 4, 5, "modified"}, }, }, { Query: "SELECT to_pk, to_c1, from_pk, from_c1, diff_type FROM DOLT_COMMIT_DIFF_t WHERE TO_COMMIT=@Commit3 and FROM_COMMIT=@Commit2 ORDER BY to_pk;", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ // TODO: Missing rows here see TestDiffSystemTable tests {100, 101, nil, nil, "added"}, }, @@ -5058,26 +5058,26 @@ var CommitDiffSystemTableScriptTests = []queries.ScriptTest{ Assertions: []queries.ScriptTestAssertion{ { Query: "SELECT to_pk, to_c1, to_c2, from_pk, from_c1, from_c2, diff_type FROM DOLT_COMMIT_DIFF_t WHERE TO_COMMIT='WORKING' and FROM_COMMIT=@Commit0;", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {1, 2, 3, nil, nil, nil, "added"}, {4, 5, 6, nil, nil, nil, "added"}, }, }, { Query: "SELECT to_pk, to_c1, to_c2, from_pk, from_c1, from_c2, diff_type FROM DOLT_COMMIT_DIFF_t WHERE TO_COMMIT='STAGED' and FROM_COMMIT=@Commit0;", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {1, 2, 3, nil, nil, nil, "added"}, }, }, { Query: "SELECT to_pk, to_c1, to_c2, from_pk, from_c1, from_c2, diff_type FROM DOLT_COMMIT_DIFF_t WHERE TO_COMMIT='WORKING' and FROM_COMMIT='STAGED';", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {4, 5, 6, nil, nil, nil, "added"}, }, }, { Query: "SELECT to_pk, to_c1, to_c2, from_pk, from_c1, from_c2, diff_type FROM DOLT_COMMIT_DIFF_t WHERE TO_COMMIT='STAGED' and FROM_COMMIT='WORKING';", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {nil, nil, nil, 4, 5, 6, "removed"}, }, }, @@ -5098,17 +5098,17 @@ var CommitDiffSystemTableScriptTests = []queries.ScriptTest{ Assertions: []queries.ScriptTestAssertion{ { Query: "use mydb/v1;", - Expected: []sql.Row{}, + Expected: []sql.UntypedSqlRow{}, }, { // With no working set, this query should still compute the diff between two commits Query: "SELECT COUNT(*) AS table_diff_num FROM dolt_commit_diff_t WHERE from_commit=@commit1 AND to_commit=@commit2;", - Expected: []sql.Row{{1}}, + Expected: []sql.UntypedSqlRow{{1}}, }, { // With no working set, STAGED should reference the current root of the checked out tag Query: "SELECT COUNT(*) AS table_diff_num FROM dolt_commit_diff_t WHERE from_commit=@commit1 AND to_commit='STAGED';", - Expected: []sql.Row{{1}}, + Expected: []sql.UntypedSqlRow{{1}}, }, }, }, @@ -5137,21 +5137,21 @@ var CommitDiffSystemTableScriptTests = []queries.ScriptTest{ Assertions: []queries.ScriptTestAssertion{ { Query: "SELECT to_pk, to_c, from_pk, from_c, diff_type FROM DOLT_COMMIT_DIFF_t WHERE TO_COMMIT=@Commit1 and FROM_COMMIT=@Commit0 ORDER BY to_pk;", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {1, "2", nil, nil, "added"}, {3, "4", nil, nil, "added"}, }, }, { Query: "SELECT to_pk, to_c, from_pk, from_c, diff_type FROM DOLT_COMMIT_DIFF_t WHERE TO_COMMIT=@Commit2 and FROM_COMMIT=@Commit1 ORDER BY to_pk;", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {1, nil, 1, "2", "modified"}, {3, nil, 3, "4", "modified"}, }, }, { Query: "SELECT to_pk, to_c, from_pk, from_c, diff_type FROM DOLT_COMMIT_DIFF_t WHERE TO_COMMIT=@Commit3 and FROM_COMMIT=@Commit2 ORDER BY to_pk;", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {100, "101", nil, nil, "added"}, }, }, @@ -5179,21 +5179,21 @@ var CommitDiffSystemTableScriptTests = []queries.ScriptTest{ Assertions: []queries.ScriptTestAssertion{ { Query: "SELECT to_pk, to_c, from_pk, from_c, diff_type FROM DOLT_COMMIT_DIFF_t WHERE TO_COMMIT=@Commit1 and FROM_COMMIT=@Commit0 ORDER BY to_pk;", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {1, nil, nil, nil, "added"}, {3, nil, nil, nil, "added"}, }, }, { Query: "SELECT to_pk, to_c, from_pk, from_c, diff_type FROM DOLT_COMMIT_DIFF_t WHERE TO_COMMIT=@Commit2 and FROM_COMMIT=@Commit1 ORDER BY to_pk;", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {1, nil, 1, nil, "modified"}, {3, nil, 3, nil, "modified"}, }, }, { Query: "SELECT to_pk, to_c, from_pk, from_c, diff_type FROM DOLT_COMMIT_DIFF_t WHERE TO_COMMIT=@Commit3 and FROM_COMMIT=@Commit2 ORDER BY to_pk;", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {100, 101, nil, nil, "added"}, }, }, @@ -5238,7 +5238,7 @@ var CommitDiffSystemTableScriptTests = []queries.ScriptTest{ }, { Query: "SELECT to_pk, to_c1, from_pk, from_c1, diff_type FROM DOLT_commit_DIFF_t where from_commit=@Commit3 and to_commit=@Commit4;", - Expected: []sql.Row{{7, 8, nil, nil, "added"}}, + Expected: []sql.UntypedSqlRow{{7, 8, nil, nil, "added"}}, }, }, }, @@ -5271,22 +5271,22 @@ var CommitDiffSystemTableScriptTests = []queries.ScriptTest{ ExpectedWarning: 1105, ExpectedWarningsCount: 1, ExpectedWarningMessageSubstring: "cannot render full diff between commits", - Expected: []sql.Row{}, + Expected: []sql.UntypedSqlRow{}, }, { Query: "select * from dolt_commit_diff_t where from_commit=@Commit3 and to_commit=@Commit3;", ExpectedWarning: 1105, ExpectedWarningsCount: 1, ExpectedWarningMessageSubstring: "cannot render full diff between commits", - Expected: []sql.Row{}, + Expected: []sql.UntypedSqlRow{}, }, { Query: "SELECT to_pk, to_c1, from_pk, from_c1, diff_type FROM DOLT_commit_DIFF_t where from_commit=@Commit3 and to_commit=@Commit4;", - Expected: []sql.Row{{1, 2, nil, nil, "added"}}, + Expected: []sql.UntypedSqlRow{{1, 2, nil, nil, "added"}}, }, { Query: "SELECT to_pk, to_c1, from_pk, from_c1, diff_type FROM DOLT_commit_DIFF_t where from_commit=@Commit1 and to_commit=@Commit4;", - Expected: []sql.Row{{nil, nil, 3, 4, "removed"}}, + Expected: []sql.UntypedSqlRow{{nil, nil, 3, 4, "removed"}}, }, }, }, @@ -5374,62 +5374,62 @@ var SchemaDiffTableFunctionScriptTests = []queries.ScriptTest{ // Empty diffs due to same refs { Query: "select * from dolt_schema_diff('HEAD', 'HEAD');", - Expected: []sql.Row{}, + Expected: []sql.UntypedSqlRow{}, }, { Query: "select * from dolt_schema_diff(@Commit1, @Commit1);", - Expected: []sql.Row{}, + Expected: []sql.UntypedSqlRow{}, }, { Query: "select * from dolt_schema_diff('branch1', 'branch1');", - Expected: []sql.Row{}, + Expected: []sql.UntypedSqlRow{}, }, { Query: "select * from dolt_schema_diff('tag1', 'tag1');", - Expected: []sql.Row{}, + Expected: []sql.UntypedSqlRow{}, }, // Empty diffs due to fake table { Query: "select * from dolt_schema_diff(@Commit1, @Commit2, 'fake-table');", - Expected: []sql.Row{}, + Expected: []sql.UntypedSqlRow{}, }, { Query: "select * from dolt_schema_diff('tag1', 'tag2', 'fake-table');", - Expected: []sql.Row{}, + Expected: []sql.UntypedSqlRow{}, }, { Query: "select * from dolt_schema_diff('branch1', 'branch2', 'fake-table');", - Expected: []sql.Row{}, + Expected: []sql.UntypedSqlRow{}, }, // Empty diffs due to no changes between different commits { Query: "select * from dolt_schema_diff(@Commit2, @Commit3);", - Expected: []sql.Row{}, + Expected: []sql.UntypedSqlRow{}, }, { Query: "select * from dolt_schema_diff(@Commit2, @Commit3, 'inventory');", - Expected: []sql.Row{}, + Expected: []sql.UntypedSqlRow{}, }, { Query: "select * from dolt_schema_diff('tag2', 'tag3');", - Expected: []sql.Row{}, + Expected: []sql.UntypedSqlRow{}, }, { Query: "select * from dolt_schema_diff('tag2', 'tag3', 'inventory');", - Expected: []sql.Row{}, + Expected: []sql.UntypedSqlRow{}, }, { Query: "select * from dolt_schema_diff('branch2', 'branch3');", - Expected: []sql.Row{}, + Expected: []sql.UntypedSqlRow{}, }, { Query: "select * from dolt_schema_diff('branch2', 'branch3', 'inventory');", - Expected: []sql.Row{}, + Expected: []sql.UntypedSqlRow{}, }, // Compare diffs where between from and to where: tables are added, tables are dropped, tables are renamed { Query: "select * from dolt_schema_diff(@Commit0, @Commit1);", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {"employees", "", "CREATE TABLE `employees` (\n `pk` int NOT NULL,\n `name` varchar(50),\n PRIMARY KEY (`pk`)\n) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_bin;", ""}, {"", "inventory", "", "CREATE TABLE `inventory` (\n `pk` int NOT NULL,\n `name` varchar(50),\n `quantity` int,\n PRIMARY KEY (`pk`)\n) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_bin;"}, {"vacations", "trips", "CREATE TABLE `vacations` (\n `pk` int NOT NULL,\n `name` varchar(50),\n PRIMARY KEY (`pk`)\n) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_bin;", "CREATE TABLE `trips` (\n `pk` int NOT NULL,\n `name` varchar(50),\n PRIMARY KEY (`pk`)\n) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_bin;"}, @@ -5437,7 +5437,7 @@ var SchemaDiffTableFunctionScriptTests = []queries.ScriptTest{ }, { Query: "select * from dolt_schema_diff(@Commit1, @Commit0);", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {"inventory", "", "CREATE TABLE `inventory` (\n `pk` int NOT NULL,\n `name` varchar(50),\n `quantity` int,\n PRIMARY KEY (`pk`)\n) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_bin;", ""}, {"", "employees", "", "CREATE TABLE `employees` (\n `pk` int NOT NULL,\n `name` varchar(50),\n PRIMARY KEY (`pk`)\n) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_bin;"}, {"trips", "vacations", "CREATE TABLE `trips` (\n `pk` int NOT NULL,\n `name` varchar(50),\n PRIMARY KEY (`pk`)\n) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_bin;", "CREATE TABLE `vacations` (\n `pk` int NOT NULL,\n `name` varchar(50),\n PRIMARY KEY (`pk`)\n) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_bin;"}, @@ -5446,56 +5446,56 @@ var SchemaDiffTableFunctionScriptTests = []queries.ScriptTest{ // Compare diffs with explicit table names { Query: "select * from dolt_schema_diff(@Commit0, @Commit1, 'employees');", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {"employees", "", "CREATE TABLE `employees` (\n `pk` int NOT NULL,\n `name` varchar(50),\n PRIMARY KEY (`pk`)\n) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_bin;", ""}, }, }, { Query: "select * from dolt_schema_diff(@Commit1, @Commit0, 'employees');", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {"", "employees", "", "CREATE TABLE `employees` (\n `pk` int NOT NULL,\n `name` varchar(50),\n PRIMARY KEY (`pk`)\n) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_bin;"}, }, }, { Query: "select * from dolt_schema_diff(@Commit0, @Commit1, 'inventory');", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {"", "inventory", "", "CREATE TABLE `inventory` (\n `pk` int NOT NULL,\n `name` varchar(50),\n `quantity` int,\n PRIMARY KEY (`pk`)\n) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_bin;"}, }, }, { Query: "select * from dolt_schema_diff(@Commit1, @Commit0, 'inventory');", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {"inventory", "", "CREATE TABLE `inventory` (\n `pk` int NOT NULL,\n `name` varchar(50),\n `quantity` int,\n PRIMARY KEY (`pk`)\n) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_bin;", ""}, }, }, { Query: "select * from dolt_schema_diff(@Commit0, @Commit1, 'trips');", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {"vacations", "trips", "CREATE TABLE `vacations` (\n `pk` int NOT NULL,\n `name` varchar(50),\n PRIMARY KEY (`pk`)\n) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_bin;", "CREATE TABLE `trips` (\n `pk` int NOT NULL,\n `name` varchar(50),\n PRIMARY KEY (`pk`)\n) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_bin;"}, }, }, { Query: "select * from dolt_schema_diff(@Commit1, @Commit0, 'trips');", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {"trips", "vacations", "CREATE TABLE `trips` (\n `pk` int NOT NULL,\n `name` varchar(50),\n PRIMARY KEY (`pk`)\n) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_bin;", "CREATE TABLE `vacations` (\n `pk` int NOT NULL,\n `name` varchar(50),\n PRIMARY KEY (`pk`)\n) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_bin;"}, }, }, { Query: "select * from dolt_schema_diff(@Commit0, @Commit1, 'vacations');", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {"vacations", "trips", "CREATE TABLE `vacations` (\n `pk` int NOT NULL,\n `name` varchar(50),\n PRIMARY KEY (`pk`)\n) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_bin;", "CREATE TABLE `trips` (\n `pk` int NOT NULL,\n `name` varchar(50),\n PRIMARY KEY (`pk`)\n) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_bin;"}, }, }, { Query: "select * from dolt_schema_diff(@Commit1, @Commit0, 'vacations');", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {"trips", "vacations", "CREATE TABLE `trips` (\n `pk` int NOT NULL,\n `name` varchar(50),\n PRIMARY KEY (`pk`)\n) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_bin;", "CREATE TABLE `vacations` (\n `pk` int NOT NULL,\n `name` varchar(50),\n PRIMARY KEY (`pk`)\n) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_bin;"}, }, }, // Compare two different commits, get expected results { Query: "select * from dolt_schema_diff(@Commit1, @Commit2);", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ { "inventory", "inventory", @@ -5506,7 +5506,7 @@ var SchemaDiffTableFunctionScriptTests = []queries.ScriptTest{ }, { Query: "select * from dolt_schema_diff(@Commit1, @Commit2, 'inventory');", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ { "inventory", "inventory", @@ -5517,7 +5517,7 @@ var SchemaDiffTableFunctionScriptTests = []queries.ScriptTest{ }, { Query: "select * from dolt_schema_diff('branch1', 'branch2');", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ { "inventory", "inventory", @@ -5528,7 +5528,7 @@ var SchemaDiffTableFunctionScriptTests = []queries.ScriptTest{ }, { Query: "select * from dolt_schema_diff('branch1..branch2');", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ { "inventory", "inventory", @@ -5539,7 +5539,7 @@ var SchemaDiffTableFunctionScriptTests = []queries.ScriptTest{ }, { Query: "select * from dolt_schema_diff('branch1...branch2');", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ { "inventory", "inventory", @@ -5550,7 +5550,7 @@ var SchemaDiffTableFunctionScriptTests = []queries.ScriptTest{ }, { Query: "select * from dolt_schema_diff('branch1', 'branch2', 'inventory');", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ { "inventory", "inventory", @@ -5561,7 +5561,7 @@ var SchemaDiffTableFunctionScriptTests = []queries.ScriptTest{ }, { Query: "select * from dolt_schema_diff('tag1', 'tag2');", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ { "inventory", "inventory", @@ -5572,7 +5572,7 @@ var SchemaDiffTableFunctionScriptTests = []queries.ScriptTest{ }, { Query: "select * from dolt_schema_diff('tag1..tag2');", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ { "inventory", "inventory", @@ -5583,7 +5583,7 @@ var SchemaDiffTableFunctionScriptTests = []queries.ScriptTest{ }, { Query: "select * from dolt_schema_diff('tag1...tag2');", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ { "inventory", "inventory", @@ -5594,7 +5594,7 @@ var SchemaDiffTableFunctionScriptTests = []queries.ScriptTest{ }, { Query: "select * from dolt_schema_diff('tag1', 'tag2', 'inventory');", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ { "inventory", "inventory", @@ -5606,7 +5606,7 @@ var SchemaDiffTableFunctionScriptTests = []queries.ScriptTest{ // Swap the order of the refs, get opposite diff { Query: "select * from dolt_schema_diff(@Commit2, @Commit1);", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ { "inventory", "inventory", @@ -5617,7 +5617,7 @@ var SchemaDiffTableFunctionScriptTests = []queries.ScriptTest{ }, { Query: "select * from dolt_schema_diff(@Commit2, @Commit1, 'inventory');", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ { "inventory", "inventory", @@ -5628,7 +5628,7 @@ var SchemaDiffTableFunctionScriptTests = []queries.ScriptTest{ }, { Query: "select * from dolt_schema_diff('branch2', 'branch1');", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ { "inventory", "inventory", @@ -5639,7 +5639,7 @@ var SchemaDiffTableFunctionScriptTests = []queries.ScriptTest{ }, { Query: "select * from dolt_schema_diff('branch2', 'branch1', 'inventory');", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ { "inventory", "inventory", @@ -5650,7 +5650,7 @@ var SchemaDiffTableFunctionScriptTests = []queries.ScriptTest{ }, { Query: "select * from dolt_schema_diff('tag2', 'tag1');", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ { "inventory", "inventory", @@ -5661,7 +5661,7 @@ var SchemaDiffTableFunctionScriptTests = []queries.ScriptTest{ }, { Query: "select * from dolt_schema_diff('tag2', 'tag1', 'inventory');", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ { "inventory", "inventory", @@ -5705,23 +5705,23 @@ var SchemaDiffTableFunctionScriptTests = []queries.ScriptTest{ }, { Query: "execute sch_diff using @Commit0, @Commit1, @t1_name", - Expected: []sql.Row{{1}}, + Expected: []sql.UntypedSqlRow{{1}}, }, { Query: "execute diff_stat using @Commit1, @Commit2, @t1_name", - Expected: []sql.Row{{1}}, + Expected: []sql.UntypedSqlRow{{1}}, }, { Query: "execute diff_sum using @Commit1, @Commit2, @t1_name", - Expected: []sql.Row{{1}}, + Expected: []sql.UntypedSqlRow{{1}}, }, //{ // Query: "execute table_diff using @Commit2, @Commit2, @t1_name", - // Expected: []sql.Row{}, + // Expected: []sql.UntypedSqlRow{}, //}, { Query: "execute patch using @Commit0, @Commit1, @t1_name", - Expected: []sql.Row{{1}}, + Expected: []sql.UntypedSqlRow{{1}}, }, }, }, @@ -5744,53 +5744,53 @@ var DoltDatabaseCollationScriptTests = []queries.ScriptTest{ Assertions: []queries.ScriptTestAssertion{ { Query: "select * from dolt_status", - Expected: []sql.Row{}, + Expected: []sql.UntypedSqlRow{}, }, { Query: "select commit_hash, table_name, data_change, schema_change from dolt_diff", - Expected: []sql.Row{}, + Expected: []sql.UntypedSqlRow{}, }, { Query: "alter database mydb collate utf8mb4_spanish_ci", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {gmstypes.NewOkResult(1)}, }, }, { Query: "select * from dolt_status", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {"__DATABASE__mydb", false, "modified"}, }, }, { Query: "select commit_hash, table_name, data_change, schema_change from dolt_diff", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {"WORKING", "__DATABASE__mydb", false, true}, }, }, { Query: "call dolt_add('.')", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {0}, }, }, { Query: "select * from dolt_status", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {"__DATABASE__mydb", true, "modified"}, }, }, { Query: "select commit_hash, table_name, data_change, schema_change from dolt_diff", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {"STAGED", "__DATABASE__mydb", false, true}, }, }, { Query: "select message from dolt_log", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {"checkpoint enginetest database mydb"}, {"Initialize data repository"}, }, @@ -5802,17 +5802,17 @@ var DoltDatabaseCollationScriptTests = []queries.ScriptTest{ }, { Query: "select * from dolt_status", - Expected: []sql.Row{}, + Expected: []sql.UntypedSqlRow{}, }, { Query: "select table_name, data_change, schema_change from dolt_diff", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {"__DATABASE__mydb", false, true}, }, }, { Query: "select message from dolt_log", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {"db collation changed"}, {"checkpoint enginetest database mydb"}, {"Initialize data repository"}, @@ -5826,53 +5826,53 @@ var DoltDatabaseCollationScriptTests = []queries.ScriptTest{ Assertions: []queries.ScriptTestAssertion{ { Query: "select * from dolt_status", - Expected: []sql.Row{}, + Expected: []sql.UntypedSqlRow{}, }, { Query: "select commit_hash, table_name, data_change, schema_change from dolt_diff", - Expected: []sql.Row{}, + Expected: []sql.UntypedSqlRow{}, }, { Query: "alter database mydb collate utf8mb4_spanish_ci", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {gmstypes.NewOkResult(1)}, }, }, { Query: "select * from dolt_status", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {"__DATABASE__mydb", false, "modified"}, }, }, { Query: "select commit_hash, table_name, data_change, schema_change from dolt_diff", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {"WORKING", "__DATABASE__mydb", false, true}, }, }, { Query: "call dolt_add('__DATABASE__mydb')", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {0}, }, }, { Query: "select * from dolt_status", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {"__DATABASE__mydb", true, "modified"}, }, }, { Query: "select commit_hash, table_name, data_change, schema_change from dolt_diff", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {"STAGED", "__DATABASE__mydb", false, true}, }, }, { Query: "select message from dolt_log", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {"checkpoint enginetest database mydb"}, {"Initialize data repository"}, }, @@ -5884,17 +5884,17 @@ var DoltDatabaseCollationScriptTests = []queries.ScriptTest{ }, { Query: "select * from dolt_status", - Expected: []sql.Row{}, + Expected: []sql.UntypedSqlRow{}, }, { Query: "select table_name, data_change, schema_change from dolt_diff", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {"__DATABASE__mydb", false, true}, }, }, { Query: "select message from dolt_log", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {"db collation changed"}, {"checkpoint enginetest database mydb"}, {"Initialize data repository"}, @@ -5908,34 +5908,34 @@ var DoltDatabaseCollationScriptTests = []queries.ScriptTest{ Assertions: []queries.ScriptTestAssertion{ { Query: "select * from dolt_status", - Expected: []sql.Row{}, + Expected: []sql.UntypedSqlRow{}, }, { Query: "select commit_hash, table_name, data_change, schema_change from dolt_diff", - Expected: []sql.Row{}, + Expected: []sql.UntypedSqlRow{}, }, { Query: "alter database mydb collate utf8mb4_spanish_ci", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {gmstypes.NewOkResult(1)}, }, }, { Query: "select * from dolt_status", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {"__DATABASE__mydb", false, "modified"}, }, }, { Query: "select commit_hash, table_name, data_change, schema_change from dolt_diff", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {"WORKING", "__DATABASE__mydb", false, true}, }, }, { Query: "select message from dolt_log", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {"checkpoint enginetest database mydb"}, {"Initialize data repository"}, }, @@ -5947,17 +5947,17 @@ var DoltDatabaseCollationScriptTests = []queries.ScriptTest{ }, { Query: "select * from dolt_status", - Expected: []sql.Row{}, + Expected: []sql.UntypedSqlRow{}, }, { Query: "select table_name, data_change, schema_change from dolt_diff", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {"__DATABASE__mydb", false, true}, }, }, { Query: "select message from dolt_log", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {"db collation changed"}, {"checkpoint enginetest database mydb"}, {"Initialize data repository"}, @@ -5973,19 +5973,19 @@ var DoltDatabaseCollationScriptTests = []queries.ScriptTest{ Assertions: []queries.ScriptTestAssertion{ { Query: "select * from dolt_status;", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {"__DATABASE__mydb", false, "modified"}, }, }, { Query: "call dolt_reset('--hard');", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {0}, }, }, { Query: "select * from dolt_status;", - Expected: []sql.Row{}, + Expected: []sql.UntypedSqlRow{}, }, }, }, @@ -5999,7 +5999,7 @@ var DoltDatabaseCollationScriptTests = []queries.ScriptTest{ Assertions: []queries.ScriptTestAssertion{ { Query: "show create database mydb;", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {"mydb", "CREATE DATABASE `mydb` /*!40100 DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_spanish_ci */"}, }, }, @@ -6009,7 +6009,7 @@ var DoltDatabaseCollationScriptTests = []queries.ScriptTest{ }, { Query: "show create database mydb;", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {"mydb", "CREATE DATABASE `mydb` /*!40100 DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_bin */"}, }, }, @@ -6026,7 +6026,7 @@ var DoltDatabaseCollationScriptTests = []queries.ScriptTest{ Assertions: []queries.ScriptTestAssertion{ { Query: "show create database mydb;", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {"mydb", "CREATE DATABASE `mydb` /*!40100 DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_bin */"}, }, }, @@ -6036,7 +6036,7 @@ var DoltDatabaseCollationScriptTests = []queries.ScriptTest{ }, { Query: "show create database mydb;", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {"mydb", "CREATE DATABASE `mydb` /*!40100 DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_spanish_ci */"}, }, }, @@ -6069,7 +6069,7 @@ type systabScript struct { type systabQuery struct { query string - exp []sql.Row + exp []sql.UntypedSqlRow skip bool } @@ -6105,43 +6105,43 @@ var SystemTableIndexTests = []systabScript{ queries: []systabQuery{ { query: "select from_x, to_x from dolt_diff_xy where to_commit = @commit;", - exp: []sql.Row{{20, 20}, {21, 21}, {22, 22}, {23, 23}, {24, 24}, {nil, 40}, {nil, 41}, {nil, 42}, {nil, 43}, {nil, 44}}, + exp: []sql.UntypedSqlRow{{20, 20}, {21, 21}, {22, 22}, {23, 23}, {24, 24}, {nil, 40}, {nil, 41}, {nil, 42}, {nil, 43}, {nil, 44}}, }, { query: "select from_x, to_x from dolt_diff_xy where from_commit = @commit;", - exp: []sql.Row{{40, 40}, {41, 41}, {42, 42}, {43, 43}, {44, 44}, {nil, 60}, {nil, 61}, {nil, 62}, {nil, 63}, {nil, 64}}, + exp: []sql.UntypedSqlRow{{40, 40}, {41, 41}, {42, 42}, {43, 43}, {44, 44}, {nil, 60}, {nil, 61}, {nil, 62}, {nil, 63}, {nil, 64}}, }, { query: "select count(*) from dolt_diff where commit_hash = @commit;", - exp: []sql.Row{{1}}, + exp: []sql.UntypedSqlRow{{1}}, }, { query: "select count(*) from dolt_history_xy where commit_hash = @commit;", - exp: []sql.Row{{15}}, + exp: []sql.UntypedSqlRow{{15}}, }, { query: "select count(*) from dolt_log where commit_hash = @commit;", - exp: []sql.Row{{1}}, + exp: []sql.UntypedSqlRow{{1}}, }, { query: "select count(*) from dolt_commits where commit_hash = @commit;", - exp: []sql.Row{{1}}, + exp: []sql.UntypedSqlRow{{1}}, }, { query: "select count(*) from dolt_commit_ancestors where commit_hash = @commit;", - exp: []sql.Row{{1}}, + exp: []sql.UntypedSqlRow{{1}}, }, { query: "select count(*) from dolt_diff_xy join dolt_log on commit_hash = to_commit", - exp: []sql.Row{{45}}, + exp: []sql.UntypedSqlRow{{45}}, }, { query: "select count(*) from dolt_diff_xy join dolt_log on commit_hash = from_commit", - exp: []sql.Row{{45}}, + exp: []sql.UntypedSqlRow{{45}}, }, { query: "select count(*) from dolt_blame_xy", - exp: []sql.Row{{25}}, + exp: []sql.UntypedSqlRow{{25}}, }, { query: `SELECT count(*) @@ -6149,7 +6149,7 @@ var SystemTableIndexTests = []systabScript{ JOIN dolt_commit_ancestors as an ON cm.commit_hash = an.parent_hash ORDER BY cm.date, cm.message asc`, - exp: []sql.Row{{5}}, + exp: []sql.UntypedSqlRow{{5}}, }, }, }, @@ -6167,7 +6167,7 @@ from dolt_tags t left join dolt_commit_diff_xy cd on cd.to_commit = t.tag_name and cd.from_commit = concat(t.tag_name, '^')`, - exp: []sql.Row{{"t1"}}, + exp: []sql.UntypedSqlRow{{"t1"}}, }, }, }, @@ -6187,88 +6187,88 @@ left join dolt_commit_diff_xy cd queries: []systabQuery{ { query: "select from_x, to_x from dolt_diff_xy where to_commit = 'WORKING';", - exp: []sql.Row{{80, 80}, {81, 81}, {82, 82}, {83, 83}, {84, 84}}, + exp: []sql.UntypedSqlRow{{80, 80}, {81, 81}, {82, 82}, {83, 83}, {84, 84}}, }, { query: "select * from dolt_diff_xy where from_commit = @feat_head1;", - exp: []sql.Row{}, + exp: []sql.UntypedSqlRow{}, }, { query: "select * from dolt_diff_xy where from_commit = 'WORKING';", - exp: []sql.Row{}, + exp: []sql.UntypedSqlRow{}, }, { query: "select count(*) from dolt_diff where commit_hash = 'WORKING';", - exp: []sql.Row{{1}}, + exp: []sql.UntypedSqlRow{{1}}, }, { query: "select count(*) from dolt_history_xy where commit_hash = 'WORKING';", - exp: []sql.Row{{0}}, + exp: []sql.UntypedSqlRow{{0}}, }, { query: "select count(*) from dolt_commit_ancestors where commit_hash = 'WORKING';", - exp: []sql.Row{{0}}, + exp: []sql.UntypedSqlRow{{0}}, }, { query: "select sum(to_x) from dolt_diff_xy where to_commit in (@commit, 'WORKING');", - exp: []sql.Row{{530.0}}, + exp: []sql.UntypedSqlRow{{530.0}}, }, { // TODO from_commit optimization query: "select sum(to_x) from dolt_diff_xy where from_commit in (@commit, 'WORKING');", - exp: []sql.Row{{320.0}}, + exp: []sql.UntypedSqlRow{{320.0}}, }, { query: "select count(*) from dolt_diff where commit_hash in (@commit, 'WORKING');", - exp: []sql.Row{{2}}, + exp: []sql.UntypedSqlRow{{2}}, }, { query: "select sum(x) from dolt_history_xy where commit_hash in (@commit, 'WORKING');", - exp: []sql.Row{{120.0}}, + exp: []sql.UntypedSqlRow{{120.0}}, }, { // init commit has nil ancestor query: "select count(*) from dolt_commit_ancestors where commit_hash in (@commit, @root_commit);", - exp: []sql.Row{{2}}, + exp: []sql.UntypedSqlRow{{2}}, }, { query: "select count(*) from dolt_log where commit_hash in (@commit, @root_commit);", - exp: []sql.Row{{2}}, + exp: []sql.UntypedSqlRow{{2}}, }, { // log table cannot access commits is feature branch query: "select count(*) from dolt_log where commit_hash = @feat_head;", - exp: []sql.Row{{0}}, + exp: []sql.UntypedSqlRow{{0}}, }, { // commit table can access all commits query: "select count(*) from dolt_commits where commit_hash = @feat_head;", - exp: []sql.Row{{1}}, + exp: []sql.UntypedSqlRow{{1}}, }, { query: "select count(*) from dolt_commits where commit_hash in (@commit, @root_commit);", - exp: []sql.Row{{2}}, + exp: []sql.UntypedSqlRow{{2}}, }, // unknown { query: "select from_x, to_x from dolt_diff_xy where to_commit = 'unknown';", - exp: []sql.Row{}, + exp: []sql.UntypedSqlRow{}, }, { query: "select * from dolt_diff_xy where from_commit = 'unknown';", - exp: []sql.Row{}, + exp: []sql.UntypedSqlRow{}, }, { query: "select * from dolt_diff where commit_hash = 'unknown';", - exp: []sql.Row{}, + exp: []sql.UntypedSqlRow{}, }, { query: "select * from dolt_history_xy where commit_hash = 'unknown';", - exp: []sql.Row{}, + exp: []sql.UntypedSqlRow{}, }, { query: "select * from dolt_commit_ancestors where commit_hash = 'unknown';", - exp: []sql.Row{}, + exp: []sql.UntypedSqlRow{}, }, }, }, @@ -6280,7 +6280,7 @@ left join dolt_commit_diff_xy cd queries: []systabQuery{ { query: "select count(*) from dolt_log as dc join dolt_commit_ancestors as dca on dc.commit_hash = dca.commit_hash;", - exp: []sql.Row{{1}}, + exp: []sql.UntypedSqlRow{{1}}, }, }, }, @@ -6309,7 +6309,7 @@ left join dolt_commit_diff_xy cd queries: []systabQuery{ { query: "select count(*) from dolt_diff_x where from_commit = @m2h2", - exp: []sql.Row{{4}}, + exp: []sql.UntypedSqlRow{{4}}, }, }, }, @@ -6355,7 +6355,7 @@ var QueryDiffTableScriptTests = []queries.ScriptTest{ }, { Query: "select * from dolt_query_diff('select * from t as of other', 'select * from t as of head');", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {2, 2, 2, 10, "modified"}, {3, 3, nil, nil, "deleted"}, {nil, nil, 4, 4, "added"}, @@ -6363,7 +6363,7 @@ var QueryDiffTableScriptTests = []queries.ScriptTest{ }, { Query: "select * from dolt_query_diff('select * from t as of head', 'select * from t as of other');", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {2, 10, 2, 2, "modified"}, {nil, nil, 3, 3, "added"}, {4, 4, nil, nil, "deleted"}, @@ -6371,20 +6371,20 @@ var QueryDiffTableScriptTests = []queries.ScriptTest{ }, { Query: "select * from dolt_query_diff('select * from t as of other where i = 2', 'select * from t as of head where i = 2');", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {2, 2, 2, 10, "modified"}, }, }, { Query: "select * from dolt_query_diff('select * from t as of other where i < 2', 'select * from t as of head where i > 2');", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {1, 1, nil, nil, "deleted"}, {nil, nil, 4, 4, "added"}, }, }, { Query: "select * from dolt_query_diff('select * from t', 'select * from tt');", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {1, 1, nil, nil, "deleted"}, {2, 10, nil, nil, "deleted"}, {4, 4, nil, nil, "deleted"}, diff --git a/go/libraries/doltcore/sqle/enginetest/dolt_queries_merge.go b/go/libraries/doltcore/sqle/enginetest/dolt_queries_merge.go index e615f7691ff..b9507bc08f3 100644 --- a/go/libraries/doltcore/sqle/enginetest/dolt_queries_merge.go +++ b/go/libraries/doltcore/sqle/enginetest/dolt_queries_merge.go @@ -43,7 +43,7 @@ type MergeScriptTest struct { // For tests that make a single assertion, Query can be set for the single assertion Query string // For tests that make a single assertion, Expected can be set for the single assertion - Expected []sql.Row + Expected []sql.UntypedSqlRow // For tests that make a single assertion, ExpectedErr can be set for the expected error ExpectedErr *errors.Kind // SkipPrepared is true when we skip a test for prepared statements only @@ -85,23 +85,23 @@ var MergeScripts = []queries.ScriptTest{ Assertions: []queries.ScriptTestAssertion{ { Query: "SELECT * FROM aTable;", - Expected: []sql.Row{{1, 2}}, + Expected: []sql.UntypedSqlRow{{1, 2}}, }, { Query: "call dolt_merge('main');", - Expected: []sql.Row{{"", 0, 1, "conflicts found"}}, + Expected: []sql.UntypedSqlRow{{"", 0, 1, "conflicts found"}}, }, { Query: "SELECT * FROM aTable;", - Expected: []sql.Row{{1, 2}, {1, 3}}, + Expected: []sql.UntypedSqlRow{{1, 2}, {1, 3}}, }, { Query: "SELECT * FROM dolt_constraint_violations;", - Expected: []sql.Row{{"aTable", uint64(2)}}, + Expected: []sql.UntypedSqlRow{{"aTable", uint64(2)}}, }, { Query: "SELECT from_root_ish, violation_type, hex(dolt_row_hash), aColumn, bColumn, CAST(violation_info as CHAR) FROM dolt_constraint_violations_aTable;", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {doltCommit, "unique index", "5A1ED8633E1842FCA8EE529E4F1C5944", 1, 2, `{"Name": "aColumn_UNIQUE", "Columns": ["aColumn"]}`}, {doltCommit, "unique index", "A922BFBF4E5489501A3808BC5CD702C0", 1, 3, `{"Name": "aColumn_UNIQUE", "Columns": ["aColumn"]}`}, }, @@ -109,22 +109,22 @@ var MergeScripts = []queries.ScriptTest{ { // Fix the data Query: "UPDATE aTable SET aColumn = 2 WHERE bColumn = 2;", - Expected: []sql.Row{{types.OkResult{RowsAffected: uint64(1), Info: plan.UpdateInfo{Matched: 1, Updated: 1}}}}, + Expected: []sql.UntypedSqlRow{{types.OkResult{RowsAffected: uint64(1), Info: plan.UpdateInfo{Matched: 1, Updated: 1}}}}, }, { // clear out the violations Query: "DELETE FROM dolt_constraint_violations_aTable;", - Expected: []sql.Row{{types.NewOkResult(2)}}, + Expected: []sql.UntypedSqlRow{{types.NewOkResult(2)}}, }, { // Commit the merge after resolving the constraint violations Query: "call dolt_commit('-am', 'merging in main and resolving unique constraint violations');", - Expected: []sql.Row{{doltCommit}}, + Expected: []sql.UntypedSqlRow{{doltCommit}}, }, { // Merging again is a no-op Query: "call dolt_merge('main');", - Expected: []sql.Row{{"", 0, 0, "cannot fast forward from a to b. a is ahead of b already"}}, + Expected: []sql.UntypedSqlRow{{"", 0, 0, "cannot fast forward from a to b. a is ahead of b already"}}, }, }, }, @@ -159,51 +159,51 @@ var MergeScripts = []queries.ScriptTest{ Assertions: []queries.ScriptTestAssertion{ { Query: "SELECT * FROM aTable ORDER BY aColumn;", - Expected: []sql.Row{{1, 1}, {2, -1}, {2, -1}}, + Expected: []sql.UntypedSqlRow{{1, 1}, {2, -1}, {2, -1}}, }, { Query: "call dolt_merge('main');", - Expected: []sql.Row{{"", 0, 1, "conflicts found"}}, + Expected: []sql.UntypedSqlRow{{"", 0, 1, "conflicts found"}}, }, { Query: "SELECT * FROM aTable ORDER BY aColumn;", - Expected: []sql.Row{{1, 1}, {2, -1}, {2, -1}}, + Expected: []sql.UntypedSqlRow{{1, 1}, {2, -1}, {2, -1}}, }, { Query: "SELECT * FROM dolt_constraint_violations;", - Expected: []sql.Row{{"aTable", uint64(1)}}, + Expected: []sql.UntypedSqlRow{{"aTable", uint64(1)}}, }, { Query: "select * from dolt_status;", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {"aTable", false, "constraint violation"}, }, }, { Query: "SELECT from_root_ish, violation_type, hex(dolt_row_hash), aColumn, bColumn, CAST(violation_info as CHAR) FROM dolt_constraint_violations_aTable;", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {doltCommit, "foreign key", "13F8480978D0556FA9AE6DF5745A7ACA", 2, -1, `{"Index": "bColumn", "Table": "aTable", "Columns": ["bColumn"], "OnDelete": "RESTRICT", "OnUpdate": "RESTRICT", "ForeignKey": "atable_ibfk_1", "ReferencedIndex": "", "ReferencedTable": "parent", "ReferencedColumns": ["pk"]}`}, }, }, { // Fix the data Query: "UPDATE aTable SET bColumn = 2 WHERE bColumn = -1;", - Expected: []sql.Row{{types.OkResult{RowsAffected: uint64(2), Info: plan.UpdateInfo{Matched: 2, Updated: 2}}}}, + Expected: []sql.UntypedSqlRow{{types.OkResult{RowsAffected: uint64(2), Info: plan.UpdateInfo{Matched: 2, Updated: 2}}}}, }, { // clear out the violations Query: "DELETE FROM dolt_constraint_violations_aTable;", - Expected: []sql.Row{{types.NewOkResult(1)}}, + Expected: []sql.UntypedSqlRow{{types.NewOkResult(1)}}, }, { // Commit the merge after resolving the constraint violations Query: "call dolt_commit('-am', 'merging in main and resolving unique constraint violations');", - Expected: []sql.Row{{doltCommit}}, + Expected: []sql.UntypedSqlRow{{doltCommit}}, }, { // Merging again is a no-op Query: "call dolt_merge('main');", - Expected: []sql.Row{{"", 0, 0, "cannot fast forward from a to b. a is ahead of b already"}}, + Expected: []sql.UntypedSqlRow{{"", 0, 0, "cannot fast forward from a to b. a is ahead of b already"}}, }, }, }, @@ -228,19 +228,19 @@ var MergeScripts = []queries.ScriptTest{ Assertions: []queries.ScriptTestAssertion{ { Query: "call dolt_merge('main');", - Expected: []sql.Row{{doltCommit, 0, 0, "merge successful"}}, + Expected: []sql.UntypedSqlRow{{doltCommit, 0, 0, "merge successful"}}, }, { Query: "select * from dolt_constraint_violations;", - Expected: []sql.Row{}, + Expected: []sql.UntypedSqlRow{}, }, { Query: "select * from dolt_constraint_violations_tableA;", - Expected: []sql.Row{}, + Expected: []sql.UntypedSqlRow{}, }, { Query: "select * from tableA;", - Expected: []sql.Row{{"A", "1"}, {"C", "C"}, {"Z", "100"}}, + Expected: []sql.UntypedSqlRow{{"A", "1"}, {"C", "C"}, {"Z", "100"}}, }, }, }, @@ -263,23 +263,23 @@ var MergeScripts = []queries.ScriptTest{ { // FF-Merge Query: "CALL DOLT_MERGE('feature-branch')", - Expected: []sql.Row{{doltCommit, 1, 0, "merge successful"}}, + Expected: []sql.UntypedSqlRow{{doltCommit, 1, 0, "merge successful"}}, }, { Query: "SELECT is_merging, source, target, unmerged_tables FROM DOLT_MERGE_STATUS;", - Expected: []sql.Row{{false, nil, nil, nil}}, + Expected: []sql.UntypedSqlRow{{false, nil, nil, nil}}, }, { Query: "SELECT * from dolt_status", - Expected: []sql.Row{}, + Expected: []sql.UntypedSqlRow{}, }, { Query: "CALL DOLT_CHECKOUT('-b', 'new-branch')", - Expected: []sql.Row{{0, "Switched to branch 'new-branch'"}}, + Expected: []sql.UntypedSqlRow{{0, "Switched to branch 'new-branch'"}}, }, { Query: "INSERT INTO test VALUES (4)", - Expected: []sql.Row{{types.NewOkResult(1)}}, + Expected: []sql.UntypedSqlRow{{types.NewOkResult(1)}}, }, }, }, @@ -303,19 +303,19 @@ var MergeScripts = []queries.ScriptTest{ { // FF-Merge Query: "CALL DOLT_MERGE('feature-branch')", - Expected: []sql.Row{{doltCommit, 1, 0, "merge successful"}}, + Expected: []sql.UntypedSqlRow{{doltCommit, 1, 0, "merge successful"}}, }, { Query: "SELECT is_merging, source, target, unmerged_tables FROM DOLT_MERGE_STATUS;", - Expected: []sql.Row{{false, nil, nil, nil}}, + Expected: []sql.UntypedSqlRow{{false, nil, nil, nil}}, }, { Query: "SELECT * from dolt_status", - Expected: []sql.Row{}, + Expected: []sql.UntypedSqlRow{}, }, { Query: "select * from test order by 1", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {1}, {2}, {3}, {1000}, }, }, @@ -362,27 +362,27 @@ var MergeScripts = []queries.ScriptTest{ { // No-FF-Merge Query: "CALL DOLT_MERGE('feature-branch', '--no-ff', '-m', 'this is a no-ff')", - Expected: []sql.Row{{doltCommit, 0, 0, "merge successful"}}, + Expected: []sql.UntypedSqlRow{{doltCommit, 0, 0, "merge successful"}}, }, { Query: "SELECT is_merging, source, target, unmerged_tables FROM DOLT_MERGE_STATUS;", - Expected: []sql.Row{{false, nil, nil, nil}}, + Expected: []sql.UntypedSqlRow{{false, nil, nil, nil}}, }, { Query: "SELECT * from dolt_status", - Expected: []sql.Row{}, + Expected: []sql.UntypedSqlRow{}, }, { Query: "SELECT COUNT(*) FROM dolt_log", - Expected: []sql.Row{{5}}, // includes the merge commit created by no-ff and setup commits + Expected: []sql.UntypedSqlRow{{5}}, // includes the merge commit created by no-ff and setup commits }, { Query: "select message from dolt_log order by date DESC LIMIT 1;", - Expected: []sql.Row{{"this is a no-ff"}}, // includes the merge commit created by no-ff + Expected: []sql.UntypedSqlRow{{"this is a no-ff"}}, // includes the merge commit created by no-ff }, { Query: "CALL DOLT_CHECKOUT('-b', 'other-branch')", - Expected: []sql.Row{{0, "Switched to branch 'other-branch'"}}, + Expected: []sql.UntypedSqlRow{{0, "Switched to branch 'other-branch'"}}, }, }, }, @@ -405,27 +405,27 @@ var MergeScripts = []queries.ScriptTest{ { // No-FF-Merge Query: "CALL DOLT_MERGE('feature-branch', '--no-ff', '-m', 'this is a no-ff')", - Expected: []sql.Row{{doltCommit, 0, 0, "merge successful"}}, + Expected: []sql.UntypedSqlRow{{doltCommit, 0, 0, "merge successful"}}, }, { Query: "SELECT is_merging, source, target, unmerged_tables FROM DOLT_MERGE_STATUS;", - Expected: []sql.Row{{false, nil, nil, nil}}, + Expected: []sql.UntypedSqlRow{{false, nil, nil, nil}}, }, { Query: "SELECT * from dolt_status", - Expected: []sql.Row{}, + Expected: []sql.UntypedSqlRow{}, }, { Query: "SELECT COUNT(*) FROM dolt_log", - Expected: []sql.Row{{5}}, // includes the merge commit created by no-ff and setup commits + Expected: []sql.UntypedSqlRow{{5}}, // includes the merge commit created by no-ff and setup commits }, { Query: "select message from dolt_log order by date DESC LIMIT 1;", - Expected: []sql.Row{{"this is a no-ff"}}, // includes the merge commit created by no-ff + Expected: []sql.UntypedSqlRow{{"this is a no-ff"}}, // includes the merge commit created by no-ff }, { Query: "select * from test order by 1", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {1}, {2}, {3}, {1000}, }, }, @@ -450,23 +450,23 @@ var MergeScripts = []queries.ScriptTest{ Assertions: []queries.ScriptTestAssertion{ { Query: "CALL DOLT_MERGE('feature-branch', '-m', 'this is a merge', '--commit')", - Expected: []sql.Row{{doltCommit, 0, 0, "merge successful"}}, + Expected: []sql.UntypedSqlRow{{doltCommit, 0, 0, "merge successful"}}, }, { Query: "SELECT is_merging, source, target, unmerged_tables FROM DOLT_MERGE_STATUS;", - Expected: []sql.Row{{false, nil, nil, nil}}, + Expected: []sql.UntypedSqlRow{{false, nil, nil, nil}}, }, { Query: "SELECT COUNT(*) from dolt_status", - Expected: []sql.Row{{0}}, + Expected: []sql.UntypedSqlRow{{0}}, }, { Query: "SELECT COUNT(*) FROM dolt_log", - Expected: []sql.Row{{6}}, + Expected: []sql.UntypedSqlRow{{6}}, }, { Query: "select message from dolt_log where date > '2022-08-08' order by date DESC LIMIT 1;", - Expected: []sql.Row{{"this is a merge"}}, + Expected: []sql.UntypedSqlRow{{"this is a merge"}}, }, }, }, @@ -489,32 +489,32 @@ var MergeScripts = []queries.ScriptTest{ Assertions: []queries.ScriptTestAssertion{ { Query: "CALL DOLT_MERGE('feature-branch', '-m', 'this is a merge', '--no-commit')", - Expected: []sql.Row{{"", 0, 0, "merge successful"}}, + Expected: []sql.UntypedSqlRow{{"", 0, 0, "merge successful"}}, }, { Query: "SELECT is_merging, source, target, unmerged_tables FROM DOLT_MERGE_STATUS;", - Expected: []sql.Row{{true, "feature-branch", "refs/heads/main", ""}}, + Expected: []sql.UntypedSqlRow{{true, "feature-branch", "refs/heads/main", ""}}, }, { Query: "SELECT * from dolt_status", - Expected: []sql.Row{{"test", true, "modified"}}, + Expected: []sql.UntypedSqlRow{{"test", true, "modified"}}, }, { Query: "SELECT COUNT(*) FROM dolt_log", - Expected: []sql.Row{{4}}, + Expected: []sql.UntypedSqlRow{{4}}, }, { // careful to filter out the initial commit, which will be later than the ones above Query: "select message from dolt_log where date < '2022-08-08' order by date DESC LIMIT 1;", - Expected: []sql.Row{{"add some more values"}}, + Expected: []sql.UntypedSqlRow{{"add some more values"}}, }, { Query: "CALL DOLT_CHECKOUT('-b', 'other')", - Expected: []sql.Row{{0, "Switched to branch 'other'"}}, + Expected: []sql.UntypedSqlRow{{0, "Switched to branch 'other'"}}, }, { Query: "CALL DOLT_CHECKOUT('main')", - Expected: []sql.Row{{0, "Switched to branch 'main'"}}, + Expected: []sql.UntypedSqlRow{{0, "Switched to branch 'main'"}}, }, }, }, @@ -537,43 +537,43 @@ var MergeScripts = []queries.ScriptTest{ Assertions: []queries.ScriptTestAssertion{ { Query: "CALL DOLT_MERGE('feature-branch', '-m', 'this is a merge')", - Expected: []sql.Row{{"", 0, 1, "conflicts found"}}, + Expected: []sql.UntypedSqlRow{{"", 0, 1, "conflicts found"}}, }, { Query: "SELECT is_merging, source, target, unmerged_tables FROM DOLT_MERGE_STATUS;", - Expected: []sql.Row{{true, "feature-branch", "refs/heads/main", "test"}}, + Expected: []sql.UntypedSqlRow{{true, "feature-branch", "refs/heads/main", "test"}}, }, { Query: "SELECT * from dolt_status", - Expected: []sql.Row{{"test", false, "modified"}, {"test", false, "conflict"}}, + Expected: []sql.UntypedSqlRow{{"test", false, "modified"}, {"test", false, "conflict"}}, }, { Query: "SELECT COUNT(*) FROM dolt_log", - Expected: []sql.Row{{4}}, + Expected: []sql.UntypedSqlRow{{4}}, }, { Query: "select message from dolt_log where date < '2022-08-08' order by date DESC LIMIT 1;", - Expected: []sql.Row{{"update a value"}}, + Expected: []sql.UntypedSqlRow{{"update a value"}}, }, { Query: "SELECT COUNT(*) FROM dolt_conflicts", - Expected: []sql.Row{{1}}, + Expected: []sql.UntypedSqlRow{{1}}, }, { Query: "DELETE FROM dolt_conflicts_test", - Expected: []sql.Row{{types.NewOkResult(1)}}, + Expected: []sql.UntypedSqlRow{{types.NewOkResult(1)}}, }, { Query: "commit", - Expected: []sql.Row{}, + Expected: []sql.UntypedSqlRow{}, }, { Query: "SELECT * from dolt_status", - Expected: []sql.Row{{"test", false, "modified"}}, + Expected: []sql.UntypedSqlRow{{"test", false, "modified"}}, }, { Query: "SELECT * from test ORDER BY pk", - Expected: []sql.Row{{0, 1001}, {1, 1}}, + Expected: []sql.UntypedSqlRow{{0, 1001}, {1, 1}}, }, }, }, @@ -601,52 +601,52 @@ var MergeScripts = []queries.ScriptTest{ { Skip: true, Query: "CALL DOLT_MERGE('feature-branch', '-m', 'this is a merge')", - Expected: []sql.Row{{"", 0, 1, "conflicts found"}}, + Expected: []sql.UntypedSqlRow{{"", 0, 1, "conflicts found"}}, }, { Skip: true, Query: "SELECT is_merging, source, target, unmerged_tables FROM DOLT_MERGE_STATUS;", - Expected: []sql.Row{{true, "feature-branch", "refs/heads/main", "test"}}, + Expected: []sql.UntypedSqlRow{{true, "feature-branch", "refs/heads/main", "test"}}, }, { Skip: true, Query: "SELECT * from dolt_status", - Expected: []sql.Row{{"test", false, "schema conflict"}}, + Expected: []sql.UntypedSqlRow{{"test", false, "schema conflict"}}, }, { Skip: true, Query: "SELECT COUNT(*) FROM dolt_log", - Expected: []sql.Row{{4}}, + Expected: []sql.UntypedSqlRow{{4}}, }, { Skip: true, Query: "select message from dolt_log where date < '2022-08-08' order by date DESC LIMIT 1;", - Expected: []sql.Row{{"update val col"}}, + Expected: []sql.UntypedSqlRow{{"update val col"}}, }, { Skip: true, Query: "SELECT COUNT(*) FROM dolt_conflicts", - Expected: []sql.Row{{1}}, + Expected: []sql.UntypedSqlRow{{1}}, }, { Skip: true, Query: "CALL DOLT_CONFLICTS_RESOLVE('--ours', 'test');", - Expected: []sql.Row{{0}}, + Expected: []sql.UntypedSqlRow{{0}}, }, { Skip: true, Query: "SELECT is_merging, source, target, unmerged_tables FROM DOLT_MERGE_STATUS;", - Expected: []sql.Row{{true, "feature-branch", "refs/heads/main", ""}}, + Expected: []sql.UntypedSqlRow{{true, "feature-branch", "refs/heads/main", ""}}, }, { Skip: true, Query: "SELECT COUNT(*) FROM dolt_conflicts", - Expected: []sql.Row{{0}}, + Expected: []sql.UntypedSqlRow{{0}}, }, { Skip: true, Query: "SELECT * from dolt_status", - Expected: []sql.Row{{"test", true, "merged"}}, + Expected: []sql.UntypedSqlRow{{"test", true, "merged"}}, }, { Skip: true, @@ -656,12 +656,12 @@ var MergeScripts = []queries.ScriptTest{ { Skip: true, Query: "SELECT * from dolt_status", - Expected: []sql.Row{}, + Expected: []sql.UntypedSqlRow{}, }, { Skip: true, Query: "SHOW CREATE TABLE test", - Expected: []sql.Row{{"test", "CREATE TABLE `test` (\n `pk` int NOT NULL,\n `val` smallint,\n PRIMARY KEY (`pk`)\n) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_bin"}}, + Expected: []sql.UntypedSqlRow{{"test", "CREATE TABLE `test` (\n `pk` int NOT NULL,\n `val` smallint,\n PRIMARY KEY (`pk`)\n) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_bin"}}, }, }, }, @@ -684,15 +684,15 @@ var MergeScripts = []queries.ScriptTest{ Assertions: []queries.ScriptTestAssertion{ { Query: "CALL DOLT_MERGE('feature-branch', '-m', 'this is a merge')", - Expected: []sql.Row{{"", 0, 1, "conflicts found"}}, + Expected: []sql.UntypedSqlRow{{"", 0, 1, "conflicts found"}}, }, { Query: "SELECT is_merging, source, target, unmerged_tables FROM DOLT_MERGE_STATUS;", - Expected: []sql.Row{{true, "feature-branch", "refs/heads/main", "test"}}, + Expected: []sql.UntypedSqlRow{{true, "feature-branch", "refs/heads/main", "test"}}, }, { Query: "SELECT * FROM DOLT_STATUS", - Expected: []sql.Row{{"test", false, "modified"}, {"test", false, "conflict"}}, + Expected: []sql.UntypedSqlRow{{"test", false, "modified"}, {"test", false, "conflict"}}, }, { // errors because creating a new branch implicitly commits the current transaction @@ -718,19 +718,19 @@ var MergeScripts = []queries.ScriptTest{ Assertions: []queries.ScriptTestAssertion{ { Query: "CALL DOLT_MERGE('feature-branch', '--squash')", - Expected: []sql.Row{{doltCommit, 1, 0, "merge successful"}}, + Expected: []sql.UntypedSqlRow{{doltCommit, 1, 0, "merge successful"}}, }, { Query: "SELECT count(*) from dolt_status", - Expected: []sql.Row{{1}}, + Expected: []sql.UntypedSqlRow{{1}}, }, { Query: "SELECT COUNT(*) FROM dolt_log", - Expected: []sql.Row{{3}}, + Expected: []sql.UntypedSqlRow{{3}}, }, { Query: "SELECT * FROM test order by pk", - Expected: []sql.Row{{1}, {2}, {3}, {1000}}, + Expected: []sql.UntypedSqlRow{{1}, {2}, {3}, {1000}}, }, }, }, @@ -751,19 +751,19 @@ var MergeScripts = []queries.ScriptTest{ Assertions: []queries.ScriptTestAssertion{ { Query: "CALL DOLT_MERGE('feature-branch', '--squash')", - Expected: []sql.Row{{doltCommit, 1, 0, "merge successful"}}, + Expected: []sql.UntypedSqlRow{{doltCommit, 1, 0, "merge successful"}}, }, { Query: "CALL DOLT_CHECKOUT('-b', 'other')", - Expected: []sql.Row{{0, "Switched to branch 'other'"}}, + Expected: []sql.UntypedSqlRow{{0, "Switched to branch 'other'"}}, }, { Query: "CALL DOLT_CHECKOUT('main')", - Expected: []sql.Row{{0, "Switched to branch 'main'"}}, + Expected: []sql.UntypedSqlRow{{0, "Switched to branch 'main'"}}, }, { Query: "SELECT * FROM test order by pk", - Expected: []sql.Row{{1}, {2}, {3}, {1000}}, + Expected: []sql.UntypedSqlRow{{1}, {2}, {3}, {1000}}, }, }, }, @@ -784,23 +784,23 @@ var MergeScripts = []queries.ScriptTest{ { // FF-Merge Query: "CALL DOLT_MERGE('feature-branch')", - Expected: []sql.Row{{doltCommit, 1, 0, "merge successful"}}, + Expected: []sql.UntypedSqlRow{{doltCommit, 1, 0, "merge successful"}}, }, { Query: "SELECT is_merging, source, target, unmerged_tables FROM DOLT_MERGE_STATUS;", - Expected: []sql.Row{{false, nil, nil, nil}}, + Expected: []sql.UntypedSqlRow{{false, nil, nil, nil}}, }, { Query: "SELECT * from dolt_status", - Expected: []sql.Row{}, + Expected: []sql.UntypedSqlRow{}, }, { Query: "CALL DOLT_CHECKOUT('-b', 'new-branch')", - Expected: []sql.Row{{0, "Switched to branch 'new-branch'"}}, + Expected: []sql.UntypedSqlRow{{0, "Switched to branch 'new-branch'"}}, }, { Query: "INSERT INTO test VALUES (4)", - Expected: []sql.Row{{types.NewOkResult(1)}}, + Expected: []sql.UntypedSqlRow{{types.NewOkResult(1)}}, }, }, }, @@ -822,31 +822,31 @@ var MergeScripts = []queries.ScriptTest{ { // FF-Merge Query: "CALL DOLT_MERGE('feature-branch')", - Expected: []sql.Row{{doltCommit, 1, 0, "merge successful"}}, + Expected: []sql.UntypedSqlRow{{doltCommit, 1, 0, "merge successful"}}, }, { Query: "SELECT is_merging, source, target, unmerged_tables FROM DOLT_MERGE_STATUS;", - Expected: []sql.Row{{false, nil, nil, nil}}, + Expected: []sql.UntypedSqlRow{{false, nil, nil, nil}}, }, { Query: "SELECT * from dolt_status", - Expected: []sql.Row{}, + Expected: []sql.UntypedSqlRow{}, }, { Query: "CALL DOLT_CHECKOUT('-b', 'new-branch')", - Expected: []sql.Row{{0, "Switched to branch 'new-branch'"}}, + Expected: []sql.UntypedSqlRow{{0, "Switched to branch 'new-branch'"}}, }, { Query: "select active_branch()", - Expected: []sql.Row{{"new-branch"}}, + Expected: []sql.UntypedSqlRow{{"new-branch"}}, }, { Query: "INSERT INTO test VALUES (4)", - Expected: []sql.Row{{types.NewOkResult(1)}}, + Expected: []sql.UntypedSqlRow{{types.NewOkResult(1)}}, }, { Query: "SELECT * FROM test order by pk", - Expected: []sql.Row{{1}, {2}, {3}, {4}, {1000}}, + Expected: []sql.UntypedSqlRow{{1}, {2}, {3}, {4}, {1000}}, }, { Query: "use `mydb/main`", @@ -854,11 +854,11 @@ var MergeScripts = []queries.ScriptTest{ }, { Query: "select active_branch()", - Expected: []sql.Row{{"main"}}, + Expected: []sql.UntypedSqlRow{{"main"}}, }, { Query: "SELECT * FROM test order by pk", - Expected: []sql.Row{{1}, {2}, {3}, {1000}}, + Expected: []sql.UntypedSqlRow{{1}, {2}, {3}, {1000}}, }, }, }, @@ -879,27 +879,27 @@ var MergeScripts = []queries.ScriptTest{ { // No-FF-Merge Query: "CALL DOLT_MERGE('feature-branch', '-no-ff', '-m', 'this is a no-ff')", - Expected: []sql.Row{{doltCommit, 0, 0, "merge successful"}}, + Expected: []sql.UntypedSqlRow{{doltCommit, 0, 0, "merge successful"}}, }, { Query: "SELECT is_merging, source, target, unmerged_tables FROM DOLT_MERGE_STATUS;", - Expected: []sql.Row{{false, nil, nil, nil}}, + Expected: []sql.UntypedSqlRow{{false, nil, nil, nil}}, }, { Query: "SELECT * from dolt_status", - Expected: []sql.Row{}, + Expected: []sql.UntypedSqlRow{}, }, { Query: "SELECT COUNT(*) FROM dolt_log", - Expected: []sql.Row{{5}}, // includes the merge commit created by no-ff and setup commits + Expected: []sql.UntypedSqlRow{{5}}, // includes the merge commit created by no-ff and setup commits }, { Query: "select message from dolt_log order by date DESC LIMIT 1;", - Expected: []sql.Row{{"this is a no-ff"}}, // includes the merge commit created by no-ff + Expected: []sql.UntypedSqlRow{{"this is a no-ff"}}, // includes the merge commit created by no-ff }, { Query: "CALL DOLT_CHECKOUT('-b', 'other-branch')", - Expected: []sql.Row{{0, "Switched to branch 'other-branch'"}}, + Expected: []sql.UntypedSqlRow{{0, "Switched to branch 'other-branch'"}}, }, }, }, @@ -925,19 +925,19 @@ var MergeScripts = []queries.ScriptTest{ }, { Query: "CALL DOLT_MERGE('feature-branch', '-m', 'this is a merge')", - Expected: []sql.Row{{doltCommit, 0, 0, "merge successful"}}, + Expected: []sql.UntypedSqlRow{{doltCommit, 0, 0, "merge successful"}}, }, { Query: "SELECT COUNT(*) from dolt_status", - Expected: []sql.Row{{0}}, + Expected: []sql.UntypedSqlRow{{0}}, }, { Query: "SELECT COUNT(*) FROM dolt_log", - Expected: []sql.Row{{6}}, // includes the merge commit and a new commit created by successful merge + Expected: []sql.UntypedSqlRow{{6}}, // includes the merge commit and a new commit created by successful merge }, { Query: "select message from dolt_log where date > '2022-08-08' order by date DESC LIMIT 1;", - Expected: []sql.Row{{"this is a merge"}}, + Expected: []sql.UntypedSqlRow{{"this is a merge"}}, }, }, }, @@ -964,23 +964,23 @@ var MergeScripts = []queries.ScriptTest{ }, { Query: "CALL DOLT_MERGE('feature-branch', '-m', 'this is a merge')", - Expected: []sql.Row{{doltCommit, 0, 0, "merge successful"}}, + Expected: []sql.UntypedSqlRow{{doltCommit, 0, 0, "merge successful"}}, }, { Query: "SELECT COUNT(*) from dolt_status", - Expected: []sql.Row{{0}}, + Expected: []sql.UntypedSqlRow{{0}}, }, { Query: "SELECT COUNT(*) FROM dolt_log", - Expected: []sql.Row{{6}}, // includes the merge commit and a new commit created by successful merge + Expected: []sql.UntypedSqlRow{{6}}, // includes the merge commit and a new commit created by successful merge }, { Query: "select message from dolt_log where date > '2022-08-08' order by date DESC LIMIT 1;", - Expected: []sql.Row{{"this is a merge"}}, + Expected: []sql.UntypedSqlRow{{"this is a merge"}}, }, { Query: "select * from test order by pk", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {1}, {2}, {3}, {5}, {6}, {7}, {1000}, }, }, @@ -990,7 +990,7 @@ var MergeScripts = []queries.ScriptTest{ }, { Query: "select * from test order by pk", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {1}, {2}, {3}, {1000}, }, }, @@ -1014,23 +1014,23 @@ var MergeScripts = []queries.ScriptTest{ Assertions: []queries.ScriptTestAssertion{ { Query: "CALL DOLT_MERGE('feature-branch', '-m', 'this is a merge', '--no-commit')", - Expected: []sql.Row{{"", 0, 0, "merge successful"}}, + Expected: []sql.UntypedSqlRow{{"", 0, 0, "merge successful"}}, }, { Query: "SELECT COUNT(*) from dolt_status", - Expected: []sql.Row{{1}}, + Expected: []sql.UntypedSqlRow{{1}}, }, { Query: "SELECT COUNT(*) FROM dolt_log", - Expected: []sql.Row{{4}}, + Expected: []sql.UntypedSqlRow{{4}}, }, { Query: "select message from dolt_log where date < '2022-08-08' order by date DESC LIMIT 1;", - Expected: []sql.Row{{"add some more values"}}, + Expected: []sql.UntypedSqlRow{{"add some more values"}}, }, { Query: "CALL DOLT_CHECKOUT('-b', 'other-branch')", - Expected: []sql.Row{{0, "Switched to branch 'other-branch'"}}, + Expected: []sql.UntypedSqlRow{{0, "Switched to branch 'other-branch'"}}, }, }, }, @@ -1044,11 +1044,11 @@ var MergeScripts = []queries.ScriptTest{ Assertions: []queries.ScriptTestAssertion{ { Query: "CALL DOLT_MERGE('HEAD~1')", - Expected: []sql.Row{{"", 0, 0, "cannot fast forward from a to b. a is ahead of b already"}}, + Expected: []sql.UntypedSqlRow{{"", 0, 0, "cannot fast forward from a to b. a is ahead of b already"}}, }, { Query: "CALL DOLT_MERGE('HEAD')", - Expected: []sql.Row{{"", 0, 0, "Everything up-to-date"}}, + Expected: []sql.UntypedSqlRow{{"", 0, 0, "Everything up-to-date"}}, }, }, }, @@ -1071,40 +1071,40 @@ var MergeScripts = []queries.ScriptTest{ Assertions: []queries.ScriptTestAssertion{ { Query: "CALL DOLT_MERGE('feature-branch')", - Expected: []sql.Row{{"", 0, 1, "conflicts found"}}, + Expected: []sql.UntypedSqlRow{{"", 0, 1, "conflicts found"}}, }, { Query: "SELECT count(*) from dolt_conflicts_test", - Expected: []sql.Row{{1}}, + Expected: []sql.UntypedSqlRow{{1}}, }, { // Test case-insensitive table name Query: "SELECT count(*) from dolt_conflicts_TeST", - Expected: []sql.Row{{1}}, + Expected: []sql.UntypedSqlRow{{1}}, }, { Query: "CALL DOLT_MERGE('--abort')", - Expected: []sql.Row{{"", 0, 0, "merge aborted"}}, + Expected: []sql.UntypedSqlRow{{"", 0, 0, "merge aborted"}}, }, { Query: "SELECT is_merging, source, target, unmerged_tables FROM DOLT_MERGE_STATUS;", - Expected: []sql.Row{{false, nil, nil, nil}}, + Expected: []sql.UntypedSqlRow{{false, nil, nil, nil}}, }, { Query: "SELECT * FROM test", - Expected: []sql.Row{{0, 1001}}, + Expected: []sql.UntypedSqlRow{{0, 1001}}, }, { Query: "SELECT count(*) from dolt_conflicts_test", - Expected: []sql.Row{{0}}, + Expected: []sql.UntypedSqlRow{{0}}, }, { Query: "SELECT count(*) from dolt_status", - Expected: []sql.Row{{0}}, + Expected: []sql.UntypedSqlRow{{0}}, }, { Query: "SET dolt_allow_commit_conflicts = 0", - Expected: []sql.Row{{}}, + Expected: []sql.UntypedSqlRow{{}}, }, { Query: "CALL DOLT_MERGE('feature-branch')", @@ -1112,7 +1112,7 @@ var MergeScripts = []queries.ScriptTest{ }, { Query: "SELECT count(*) from dolt_conflicts_test", // transaction has been rolled back, 0 results - Expected: []sql.Row{{0}}, + Expected: []sql.UntypedSqlRow{{0}}, }, }, }, @@ -1135,39 +1135,39 @@ var MergeScripts = []queries.ScriptTest{ Assertions: []queries.ScriptTestAssertion{ { Query: "CALL DOLT_MERGE('feature-branch', '-m', 'this is a merge')", - Expected: []sql.Row{{"", 0, 1, "conflicts found"}}, + Expected: []sql.UntypedSqlRow{{"", 0, 1, "conflicts found"}}, }, { Query: "SELECT * from dolt_status", - Expected: []sql.Row{{"test", false, "modified"}, {"test", false, "conflict"}}, + Expected: []sql.UntypedSqlRow{{"test", false, "modified"}, {"test", false, "conflict"}}, }, { Query: "SELECT COUNT(*) FROM dolt_conflicts", - Expected: []sql.Row{{1}}, + Expected: []sql.UntypedSqlRow{{1}}, }, { Query: "CALL DOLT_MERGE('--abort')", - Expected: []sql.Row{{"", 0, 0, "merge aborted"}}, + Expected: []sql.UntypedSqlRow{{"", 0, 0, "merge aborted"}}, }, { Query: "SELECT is_merging, source, target, unmerged_tables FROM DOLT_MERGE_STATUS;", - Expected: []sql.Row{{false, nil, nil, nil}}, + Expected: []sql.UntypedSqlRow{{false, nil, nil, nil}}, }, { Query: "SELECT * from dolt_status", - Expected: []sql.Row{}, + Expected: []sql.UntypedSqlRow{}, }, { Query: "SELECT COUNT(*) FROM dolt_log", - Expected: []sql.Row{{4}}, + Expected: []sql.UntypedSqlRow{{4}}, }, { Query: "SELECT * FROM test ORDER BY pk", - Expected: []sql.Row{{0, 1001}}, + Expected: []sql.UntypedSqlRow{{0, 1001}}, }, { Query: "CALL DOLT_CHECKOUT('-b', 'other-branch')", - Expected: []sql.Row{{0, "Switched to branch 'other-branch'"}}, + Expected: []sql.UntypedSqlRow{{0, "Switched to branch 'other-branch'"}}, }, }, }, @@ -1194,7 +1194,7 @@ var MergeScripts = []queries.ScriptTest{ Assertions: []queries.ScriptTestAssertion{ { Query: "select * from dolt_status;", - Expected: []sql.Row{}, + Expected: []sql.UntypedSqlRow{}, }, }, }, @@ -1220,7 +1220,7 @@ var MergeScripts = []queries.ScriptTest{ }, { Query: "SELECT is_merging, source, target, unmerged_tables FROM DOLT_MERGE_STATUS;", - Expected: []sql.Row{{false, nil, nil, nil}}, + Expected: []sql.UntypedSqlRow{{false, nil, nil, nil}}, }, }, }, @@ -1244,11 +1244,11 @@ var MergeScripts = []queries.ScriptTest{ Assertions: []queries.ScriptTestAssertion{ { Query: "call dolt_merge('b1')", - Expected: []sql.Row{{doltCommit, 0, 0, "merge successful"}}, + Expected: []sql.UntypedSqlRow{{doltCommit, 0, 0, "merge successful"}}, }, { Query: "select count(*) from dolt_conflicts", - Expected: []sql.Row{{0}}, + Expected: []sql.UntypedSqlRow{{0}}, }, }, }, @@ -1274,20 +1274,20 @@ var MergeScripts = []queries.ScriptTest{ Assertions: []queries.ScriptTestAssertion{ { Query: "CALL DOLT_MERGE('branch1');", - Expected: []sql.Row{{"", 0, 1, "conflicts found"}}, + Expected: []sql.UntypedSqlRow{{"", 0, 1, "conflicts found"}}, }, { Query: "SELECT violation_type, pk, parent_fk from dolt_constraint_violations_child;", - Expected: []sql.Row{{"foreign key", 1, 1}}, + Expected: []sql.UntypedSqlRow{{"foreign key", 1, 1}}, }, { // Test case-insensitive table name Query: "SELECT violation_type, pk, parent_fk from dolt_constraint_violations_CHILD;", - Expected: []sql.Row{{"foreign key", 1, 1}}, + Expected: []sql.UntypedSqlRow{{"foreign key", 1, 1}}, }, { Query: "select * from dolt_status;", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {"child", false, "constraint violation"}, }, }, @@ -1317,27 +1317,27 @@ var MergeScripts = []queries.ScriptTest{ Assertions: []queries.ScriptTestAssertion{ { Query: "SELECT * from dolt_constraint_violations", - Expected: []sql.Row{}, + Expected: []sql.UntypedSqlRow{}, }, { Query: "SELECT * from dolt_constraint_violations_parent", - Expected: []sql.Row{}, + Expected: []sql.UntypedSqlRow{}, }, { Query: "SELECT * from dolt_constraint_violations_child", - Expected: []sql.Row{}, + Expected: []sql.UntypedSqlRow{}, }, { Query: "select * from dolt_status;", - Expected: []sql.Row{}, + Expected: []sql.UntypedSqlRow{}, }, { Query: "SELECT * from parent;", - Expected: []sql.Row{{10, 1}, {30, 2}}, + Expected: []sql.UntypedSqlRow{{10, 1}, {30, 2}}, }, { Query: "SELECT * from child;", - Expected: []sql.Row{{1, 1}, {2, 2}}, + Expected: []sql.UntypedSqlRow{{1, 1}, {2, 2}}, }, }, }, @@ -1361,23 +1361,23 @@ var MergeScripts = []queries.ScriptTest{ Assertions: []queries.ScriptTestAssertion{ { Query: "CALL DOLT_MERGE('right');", - Expected: []sql.Row{{"", 0, 1, "conflicts found"}}, + Expected: []sql.UntypedSqlRow{{"", 0, 1, "conflicts found"}}, }, { Query: "SELECT * from t;", - Expected: []sql.Row{{1, 1}, {2, 1}, {3, 3}, {4, 4}}, + Expected: []sql.UntypedSqlRow{{1, 1}, {2, 1}, {3, 3}, {4, 4}}, }, { Query: "SELECT violation_type, pk, col1 from dolt_constraint_violations_t;", - Expected: []sql.Row{{"unique index", 1, 1}, {"unique index", 2, 1}}, + Expected: []sql.UntypedSqlRow{{"unique index", 1, 1}, {"unique index", 2, 1}}, }, { Query: "SELECT is_merging, source, target, unmerged_tables FROM DOLT_MERGE_STATUS;", - Expected: []sql.Row{{true, "right", "refs/heads/main", "t"}}, + Expected: []sql.UntypedSqlRow{{true, "right", "refs/heads/main", "t"}}, }, { Query: "select * from dolt_status;", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {"t", false, "constraint violation"}, }, }, @@ -1403,19 +1403,19 @@ var MergeScripts = []queries.ScriptTest{ Assertions: []queries.ScriptTestAssertion{ { Query: "CALL DOLT_MERGE('right');", - Expected: []sql.Row{{"", 0, 1, "conflicts found"}}, + Expected: []sql.UntypedSqlRow{{"", 0, 1, "conflicts found"}}, }, { Query: "SELECT * from t;", - Expected: []sql.Row{{1, 1}, {2, 3}, {3, 3}}, + Expected: []sql.UntypedSqlRow{{1, 1}, {2, 3}, {3, 3}}, }, { Query: "SELECT violation_type, pk, col1 from dolt_constraint_violations_t;", - Expected: []sql.Row{{"unique index", 2, 3}, {"unique index", 3, 3}}, + Expected: []sql.UntypedSqlRow{{"unique index", 2, 3}, {"unique index", 3, 3}}, }, { Query: "select * from dolt_status;", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {"t", false, "constraint violation"}, }, }, @@ -1441,19 +1441,19 @@ var MergeScripts = []queries.ScriptTest{ Assertions: []queries.ScriptTestAssertion{ { Query: "CALL DOLT_MERGE('right');", - Expected: []sql.Row{{"", 0, 1, "conflicts found"}}, + Expected: []sql.UntypedSqlRow{{"", 0, 1, "conflicts found"}}, }, { Query: "SELECT * from t;", - Expected: []sql.Row{{1, 1}, {2, 3}, {3, 3}}, + Expected: []sql.UntypedSqlRow{{1, 1}, {2, 3}, {3, 3}}, }, { Query: "SELECT violation_type, pk, col1 from dolt_constraint_violations_t;", - Expected: []sql.Row{{"unique index", 2, 3}, {"unique index", 3, 3}}, + Expected: []sql.UntypedSqlRow{{"unique index", 2, 3}, {"unique index", 3, 3}}, }, { Query: "select * from dolt_status;", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {"t", false, "constraint violation"}, }, }, @@ -1479,19 +1479,19 @@ var MergeScripts = []queries.ScriptTest{ Assertions: []queries.ScriptTestAssertion{ { Query: "CALL DOLT_MERGE('right');", - Expected: []sql.Row{{"", 0, 1, "conflicts found"}}, + Expected: []sql.UntypedSqlRow{{"", 0, 1, "conflicts found"}}, }, { Query: "SELECT * from t;", - Expected: []sql.Row{{1, 1, 1}, {2, 1, 1}}, + Expected: []sql.UntypedSqlRow{{1, 1, 1}, {2, 1, 1}}, }, { Query: "SELECT violation_type, pk, col1, col2 from dolt_constraint_violations_t;", - Expected: []sql.Row{{"unique index", 1, 1, 1}, {"unique index", 2, 1, 1}}, + Expected: []sql.UntypedSqlRow{{"unique index", 1, 1, 1}, {"unique index", 2, 1, 1}}, }, { Query: "select * from dolt_status;", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {"t", false, "constraint violation"}, }, }, @@ -1523,11 +1523,11 @@ var MergeScripts = []queries.ScriptTest{ Assertions: []queries.ScriptTestAssertion{ { Query: "CALL DOLT_MERGE('right');", - Expected: []sql.Row{{doltCommit, 0, 0, "merge successful"}}, + Expected: []sql.UntypedSqlRow{{doltCommit, 0, 0, "merge successful"}}, }, { Query: "SELECT * from t;", - Expected: []sql.Row{{1, 1}, {2, 2}, {3, 3}}, + Expected: []sql.UntypedSqlRow{{1, 1}, {2, 2}, {3, 3}}, }, }, }, @@ -1573,11 +1573,11 @@ var MergeScripts = []queries.ScriptTest{ Assertions: []queries.ScriptTestAssertion{ { Query: "CALL DOLT_MERGE('other');", - Expected: []sql.Row{{doltCommit, 0, 0, "merge successful"}}, + Expected: []sql.UntypedSqlRow{{doltCommit, 0, 0, "merge successful"}}, }, { Query: "SELECT * from t;", - Expected: []sql.Row{{1, 1}, {2, 2}}, + Expected: []sql.UntypedSqlRow{{1, 1}, {2, 2}}, }, }, }, @@ -1600,15 +1600,15 @@ var MergeScripts = []queries.ScriptTest{ Assertions: []queries.ScriptTestAssertion{ { Query: "CALL DOLT_MERGE('other');", - Expected: []sql.Row{{"", 0, 1, "conflicts found"}}, + Expected: []sql.UntypedSqlRow{{"", 0, 1, "conflicts found"}}, }, { Query: "SELECT base_pk, base_col1, our_pk, our_col1, their_pk, their_col1 from dolt_conflicts_t;", - Expected: []sql.Row{{nil, nil, 1, 1, 1, -1}}, + Expected: []sql.UntypedSqlRow{{nil, nil, 1, 1, 1, -1}}, }, { Query: "SELECT * from t;", - Expected: []sql.Row{{1, 1}}, + Expected: []sql.UntypedSqlRow{{1, 1}}, }, }, }, @@ -1635,11 +1635,11 @@ var MergeScripts = []queries.ScriptTest{ Assertions: []queries.ScriptTestAssertion{ { Query: "CALL DOLT_MERGE('other');", - Expected: []sql.Row{{doltCommit, 0, 0, "merge successful"}}, + Expected: []sql.UntypedSqlRow{{doltCommit, 0, 0, "merge successful"}}, }, { Query: "select count(*) from dolt_schemas where type = 'trigger';", - Expected: []sql.Row{{4}}, + Expected: []sql.UntypedSqlRow{{4}}, }, }, }, @@ -1658,15 +1658,15 @@ var MergeScripts = []queries.ScriptTest{ Assertions: []queries.ScriptTestAssertion{ { Query: "CALL dolt_merge('test');", - Expected: []sql.Row{{doltCommit, 1, 0, "merge successful"}}, + Expected: []sql.UntypedSqlRow{{doltCommit, 1, 0, "merge successful"}}, }, { Query: "INSERT INTO t VALUES (NULL,5),(6,6),(NULL,7);", - Expected: []sql.Row{{types.OkResult{RowsAffected: 3, InsertID: 5}}}, + Expected: []sql.UntypedSqlRow{{types.OkResult{RowsAffected: 3, InsertID: 5}}}, }, { Query: "SELECT * FROM t ORDER BY pk;", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {1, 1}, {2, 2}, {3, 3}, @@ -1695,15 +1695,15 @@ var MergeScripts = []queries.ScriptTest{ Assertions: []queries.ScriptTestAssertion{ { Query: "CALL dolt_merge('test');", - Expected: []sql.Row{{doltCommit, 0, 0, "merge successful"}}, + Expected: []sql.UntypedSqlRow{{doltCommit, 0, 0, "merge successful"}}, }, { Query: "INSERT INTO t VALUES (NULL,6),(7,7),(NULL,8);", - Expected: []sql.Row{{types.OkResult{RowsAffected: 3, InsertID: 6}}}, + Expected: []sql.UntypedSqlRow{{types.OkResult{RowsAffected: 3, InsertID: 6}}}, }, { Query: "SELECT * FROM t ORDER BY pk;", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {1, 1}, {3, 3}, {4, 4}, @@ -1730,15 +1730,15 @@ var MergeScripts = []queries.ScriptTest{ Assertions: []queries.ScriptTestAssertion{ { Query: "CALL dolt_merge('test');", - Expected: []sql.Row{{doltCommit, 1, 0, "merge successful"}}, + Expected: []sql.UntypedSqlRow{{doltCommit, 1, 0, "merge successful"}}, }, { Query: "INSERT INTO t VALUES (3,3),(NULL,6);", - Expected: []sql.Row{{types.OkResult{RowsAffected: 2, InsertID: 6}}}, + Expected: []sql.UntypedSqlRow{{types.OkResult{RowsAffected: 2, InsertID: 6}}}, }, { Query: "SELECT * FROM t ORDER BY pk;", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {1, 1}, {2, 2}, {3, 3}, @@ -1766,15 +1766,15 @@ var MergeScripts = []queries.ScriptTest{ Assertions: []queries.ScriptTestAssertion{ { Query: "CALL dolt_merge('test');", - Expected: []sql.Row{{doltCommit, 0, 0, "merge successful"}}, + Expected: []sql.UntypedSqlRow{{doltCommit, 0, 0, "merge successful"}}, }, { Query: "INSERT INTO t VALUES (3,3),(NULL,7);", - Expected: []sql.Row{{types.OkResult{RowsAffected: 2, InsertID: 7}}}, + Expected: []sql.UntypedSqlRow{{types.OkResult{RowsAffected: 2, InsertID: 7}}}, }, { Query: "SELECT * FROM t ORDER BY pk;", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {1, 1}, {3, 3}, {4, 4}, @@ -1805,11 +1805,11 @@ var MergeScripts = []queries.ScriptTest{ Assertions: []queries.ScriptTestAssertion{ { Query: "CALL DOLT_MERGE('right');", - Expected: []sql.Row{{doltCommit, 0, 0, "merge successful"}}, + Expected: []sql.UntypedSqlRow{{doltCommit, 0, 0, "merge successful"}}, }, { Query: "SELECT * FROM t;", - Expected: []sql.Row{{2, nil, nil}}, + Expected: []sql.UntypedSqlRow{{2, nil, nil}}, }, }, }, @@ -1831,11 +1831,11 @@ var MergeScripts = []queries.ScriptTest{ Assertions: []queries.ScriptTestAssertion{ { Query: "CALL DOLT_MERGE('other');", - Expected: []sql.Row{{doltCommit, 0, 0, "merge successful"}}, + Expected: []sql.UntypedSqlRow{{doltCommit, 0, 0, "merge successful"}}, }, { Query: "select * from t", - Expected: []sql.Row{{1}}, + Expected: []sql.UntypedSqlRow{{1}}, }, }, }, @@ -1861,15 +1861,15 @@ var MergeScripts = []queries.ScriptTest{ }, { Query: "CALL DOLT_MERGE('other');", - Expected: []sql.Row{{doltCommit, 1, 0, "merge successful"}}, + Expected: []sql.UntypedSqlRow{{doltCommit, 1, 0, "merge successful"}}, }, { Query: "select * from t", - Expected: []sql.Row{{1}}, + Expected: []sql.UntypedSqlRow{{1}}, }, { Query: "insert into t values (-1)", - Expected: []sql.Row{{types.NewOkResult(1)}}, + Expected: []sql.UntypedSqlRow{{types.NewOkResult(1)}}, }, }, }, @@ -1890,11 +1890,11 @@ var MergeScripts = []queries.ScriptTest{ Assertions: []queries.ScriptTestAssertion{ { Query: "CALL DOLT_MERGE('other');", - Expected: []sql.Row{{doltCommit, 0, 0, "merge successful"}}, + Expected: []sql.UntypedSqlRow{{doltCommit, 0, 0, "merge successful"}}, }, { Query: "select * from t", - Expected: []sql.Row{{1}}, + Expected: []sql.UntypedSqlRow{{1}}, }, }, }, @@ -1920,11 +1920,11 @@ var MergeScripts = []queries.ScriptTest{ Assertions: []queries.ScriptTestAssertion{ { Query: "CALL DOLT_MERGE('other');", - Expected: []sql.Row{{doltCommit, 0, 0, "merge successful"}}, + Expected: []sql.UntypedSqlRow{{doltCommit, 0, 0, "merge successful"}}, }, { Query: "select * from test", - Expected: []sql.Row{}, + Expected: []sql.UntypedSqlRow{}, }, }, }, @@ -1952,11 +1952,11 @@ var MergeScripts = []queries.ScriptTest{ Assertions: []queries.ScriptTestAssertion{ { Query: "CALL DOLT_MERGE('other');", - Expected: []sql.Row{{"", 0, 1, "conflicts found"}}, + Expected: []sql.UntypedSqlRow{{"", 0, 1, "conflicts found"}}, }, { Query: "select a, b, c from dolt_constraint_violations_test;", - Expected: []sql.Row{{1, nil, nil}}, + Expected: []sql.UntypedSqlRow{{1, nil, nil}}, }, }, }, @@ -1978,15 +1978,15 @@ var MergeScripts = []queries.ScriptTest{ Assertions: []queries.ScriptTestAssertion{ { Query: "CALL DOLT_MERGE('feature');", - Expected: []sql.Row{{doltCommit, 0, 0, "merge successful"}}, + Expected: []sql.UntypedSqlRow{{doltCommit, 0, 0, "merge successful"}}, }, { Query: "select y from xyz where y >= 0", - Expected: []sql.Row{{0}, {2}}, + Expected: []sql.UntypedSqlRow{{0}, {2}}, }, { Query: "select z from xyz where y >= 0", - Expected: []sql.Row{{0}, {2}}, + Expected: []sql.UntypedSqlRow{{0}, {2}}, }, }, }, @@ -2008,15 +2008,15 @@ var MergeScripts = []queries.ScriptTest{ Assertions: []queries.ScriptTestAssertion{ { Query: "CALL DOLT_MERGE('feature');", - Expected: []sql.Row{{doltCommit, 0, 0, "merge successful"}}, + Expected: []sql.UntypedSqlRow{{doltCommit, 0, 0, "merge successful"}}, }, { Query: "select y from xyz where y >= 0", - Expected: []sql.Row{{0}, {1}, {2}}, + Expected: []sql.UntypedSqlRow{{0}, {1}, {2}}, }, { Query: "select z from xyz where y >= 0", - Expected: []sql.Row{{0}, {1}, {2}}, + Expected: []sql.UntypedSqlRow{{0}, {1}, {2}}, }, }, }, @@ -2040,15 +2040,15 @@ var MergeScripts = []queries.ScriptTest{ Assertions: []queries.ScriptTestAssertion{ { Query: "CALL DOLT_MERGE('feature');", - Expected: []sql.Row{{doltCommit, 0, 0, "merge successful"}}, + Expected: []sql.UntypedSqlRow{{doltCommit, 0, 0, "merge successful"}}, }, { Query: "select y from xyz where y >= 0 order by 1", - Expected: []sql.Row{{0}, {2}, {3}, {4}}, + Expected: []sql.UntypedSqlRow{{0}, {2}, {3}, {4}}, }, { Query: "select z from xyz where y >= 0 order by 1", - Expected: []sql.Row{{0}, {3}, {4}, {5}}, + Expected: []sql.UntypedSqlRow{{0}, {3}, {4}, {5}}, }, }, }, @@ -2070,15 +2070,15 @@ var MergeScripts = []queries.ScriptTest{ Assertions: []queries.ScriptTestAssertion{ { Query: "CALL DOLT_MERGE('feature');", - Expected: []sql.Row{{doltCommit, 0, 0, "merge successful"}}, + Expected: []sql.UntypedSqlRow{{doltCommit, 0, 0, "merge successful"}}, }, { Query: "select y from xyz where y >= 0 order by 1", - Expected: []sql.Row{{0}, {2}}, + Expected: []sql.UntypedSqlRow{{0}, {2}}, }, { Query: "select z from xyz where y >= 0 order by 1", - Expected: []sql.Row{{0}, {2}}, + Expected: []sql.UntypedSqlRow{{0}, {2}}, }, }, }, @@ -2101,11 +2101,11 @@ var MergeScripts = []queries.ScriptTest{ Assertions: []queries.ScriptTestAssertion{ { Query: "CALL DOLT_MERGE('feature');", - Expected: []sql.Row{{"", 0, 1, "conflicts found"}}, + Expected: []sql.UntypedSqlRow{{"", 0, 1, "conflicts found"}}, }, { Query: "select our_y, our_diff_type, their_y, their_diff_type from dolt_conflicts_xyz", - Expected: []sql.Row{{2, "modified", nil, "removed"}}, + Expected: []sql.UntypedSqlRow{{2, "modified", nil, "removed"}}, }, }, }, @@ -2128,11 +2128,11 @@ var MergeScripts = []queries.ScriptTest{ Assertions: []queries.ScriptTestAssertion{ { Query: "CALL DOLT_MERGE('feature');", - Expected: []sql.Row{{"", 0, 1, "conflicts found"}}, + Expected: []sql.UntypedSqlRow{{"", 0, 1, "conflicts found"}}, }, { Query: "select our_y, our_diff_type, their_y, their_diff_type from dolt_conflicts_xyz", - Expected: []sql.Row{{2, "modified", 3, "modified"}}, + Expected: []sql.UntypedSqlRow{{2, "modified", 3, "modified"}}, }, }, }, @@ -2165,22 +2165,22 @@ var MergeScripts = []queries.ScriptTest{ Assertions: []queries.ScriptTestAssertion{ { Query: "select base_pk, base_col1, our_pk, our_col1, their_pk, their_col1 from dolt_conflicts_t;", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {nil, nil, 1, -100, 1, 100}, {nil, nil, 2, -200, 2, 200}, }, }, { Query: "delete from t;", - Expected: []sql.Row{{types.NewOkResult(2)}}, + Expected: []sql.UntypedSqlRow{{types.NewOkResult(2)}}, }, { Query: "select * from t;", - Expected: []sql.Row{}, + Expected: []sql.UntypedSqlRow{}, }, { Query: "select base_pk, base_col1, our_pk, our_col1, their_pk, their_col1 from dolt_conflicts_t;", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {nil, nil, nil, nil, 1, 100}, {nil, nil, nil, nil, 2, 200}, }, @@ -2193,22 +2193,22 @@ var MergeScripts = []queries.ScriptTest{ Assertions: []queries.ScriptTestAssertion{ { Query: "select base_pk, base_col1, our_pk, our_col1, their_pk, their_col1 from dolt_conflicts_t;", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {nil, nil, 1, -100, 1, 100}, {nil, nil, 2, -200, 2, 200}, }, }, { Query: "truncate t;", - Expected: []sql.Row{{types.NewOkResult(2)}}, + Expected: []sql.UntypedSqlRow{{types.NewOkResult(2)}}, }, { Query: "select * from t;", - Expected: []sql.Row{}, + Expected: []sql.UntypedSqlRow{}, }, { Query: "select base_pk, base_col1, our_pk, our_col1, their_pk, their_col1 from dolt_conflicts_t;", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {nil, nil, nil, nil, 1, 100}, {nil, nil, nil, nil, 2, 200}, }, @@ -2221,19 +2221,19 @@ var MergeScripts = []queries.ScriptTest{ Assertions: []queries.ScriptTestAssertion{ { Query: "select pk, col1 from dolt_constraint_violations_t;", - Expected: []sql.Row{{1, 1}, {2, 1}}, + Expected: []sql.UntypedSqlRow{{1, 1}, {2, 1}}, }, { Query: "delete from t;", - Expected: []sql.Row{{types.NewOkResult(4)}}, + Expected: []sql.UntypedSqlRow{{types.NewOkResult(4)}}, }, { Query: "select * from t;", - Expected: []sql.Row{}, + Expected: []sql.UntypedSqlRow{}, }, { Query: "select pk, col1 from dolt_constraint_violations_t;", - Expected: []sql.Row{{1, 1}, {2, 1}}, + Expected: []sql.UntypedSqlRow{{1, 1}, {2, 1}}, }, }, }, @@ -2243,19 +2243,19 @@ var MergeScripts = []queries.ScriptTest{ Assertions: []queries.ScriptTestAssertion{ { Query: "select pk, col1 from dolt_constraint_violations_t;", - Expected: []sql.Row{{1, 1}, {2, 1}}, + Expected: []sql.UntypedSqlRow{{1, 1}, {2, 1}}, }, { Query: "truncate t;", - Expected: []sql.Row{{types.NewOkResult(4)}}, + Expected: []sql.UntypedSqlRow{{types.NewOkResult(4)}}, }, { Query: "select * from t;", - Expected: []sql.Row{}, + Expected: []sql.UntypedSqlRow{}, }, { Query: "select pk, col1 from dolt_constraint_violations_t;", - Expected: []sql.Row{{1, 1}, {2, 1}}, + Expected: []sql.UntypedSqlRow{{1, 1}, {2, 1}}, }, }, }, @@ -2283,17 +2283,17 @@ var MergeScripts = []queries.ScriptTest{ Assertions: []queries.ScriptTestAssertion{ { Query: "SELECT * from dolt_constraint_violations", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {"child", uint64(1)}, }, }, { Query: "SELECT * from dolt_constraint_violations_parent", - Expected: []sql.Row{}, + Expected: []sql.UntypedSqlRow{}, }, { Query: "SELECT y, x from dolt_constraint_violations_child", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {1, 2}, }, }, @@ -2318,15 +2318,15 @@ var MergeScripts = []queries.ScriptTest{ Assertions: []queries.ScriptTestAssertion{ { Query: "CALL DOLT_MERGE('other')", - Expected: []sql.Row{{doltCommit, 0, 0, "merge successful"}}, + Expected: []sql.UntypedSqlRow{{doltCommit, 0, 0, "merge successful"}}, }, { Query: "SELECT * from dolt_constraint_violations_t", - Expected: []sql.Row{}, + Expected: []sql.UntypedSqlRow{}, }, { Query: "SELECT * from t", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {1, "1", "2", "key-a", "other", "main"}, }, }, @@ -2350,15 +2350,15 @@ var MergeScripts = []queries.ScriptTest{ Assertions: []queries.ScriptTestAssertion{ { Query: "call dolt_merge('other')", - Expected: []sql.Row{{"", 0, 1, "conflicts found"}}, + Expected: []sql.UntypedSqlRow{{"", 0, 1, "conflicts found"}}, }, { Query: "select * from dolt_constraint_violations", - Expected: []sql.Row{{"test", uint(1)}}, + Expected: []sql.UntypedSqlRow{{"test", uint(1)}}, }, { Query: "select violation_type, pk, violation_info from dolt_constraint_violations_test", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {"not null", 2, merge.NullViolationMeta{Columns: []string{"c0"}}}, }, }, @@ -2389,7 +2389,7 @@ var MergeScripts = []queries.ScriptTest{ }, { Query: "SELECT v1 FROM test WHERE MATCH(v1) AGAINST ('abc def ghi');", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {"abc"}, {"def"}, {"ghi"}, @@ -2422,29 +2422,29 @@ var MergeScripts = []queries.ScriptTest{ { // We can merge from main -> branch1, even though the column tags are not identical Query: "call dolt_merge('main')", - Expected: []sql.Row{{doltCommit, 0, 0, "merge successful"}}, + Expected: []sql.UntypedSqlRow{{doltCommit, 0, 0, "merge successful"}}, }, { Query: "SELECT * FROM t;", - Expected: []sql.Row{{1, "one"}, {2, "two"}, {3, "three"}}, + Expected: []sql.UntypedSqlRow{{1, "one"}, {2, "two"}, {3, "three"}}, }, { // Reset branch1 to the pre-merge commit, so we can test merging branch1 -> main Query: "CALL dolt_reset('--hard', @PreMergeBranch1Commit);", - Expected: []sql.Row{{0}}, + Expected: []sql.UntypedSqlRow{{0}}, }, { Query: "CALL dolt_checkout('main');", - Expected: []sql.Row{{0, "Switched to branch 'main'"}}, + Expected: []sql.UntypedSqlRow{{0, "Switched to branch 'main'"}}, }, { // We can merge from branch1 -> main, even though the column tags are not identical Query: "call dolt_merge('branch1')", - Expected: []sql.Row{{doltCommit, 0, 0, "merge successful"}}, + Expected: []sql.UntypedSqlRow{{doltCommit, 0, 0, "merge successful"}}, }, { Query: "SELECT * FROM t;", - Expected: []sql.Row{{1, "one"}, {2, "two"}, {3, "three"}}, + Expected: []sql.UntypedSqlRow{{1, "one"}, {2, "two"}, {3, "three"}}, }, }, }, @@ -2464,7 +2464,7 @@ var MergeScripts = []queries.ScriptTest{ Assertions: []queries.ScriptTestAssertion{ { Query: "call dolt_merge('main')", - Expected: []sql.Row{{doltCommit, 0, 0, "merge successful"}}, + Expected: []sql.UntypedSqlRow{{doltCommit, 0, 0, "merge successful"}}, }, }, }, @@ -2484,7 +2484,7 @@ var MergeScripts = []queries.ScriptTest{ Assertions: []queries.ScriptTestAssertion{ { Query: "call dolt_merge('main')", - Expected: []sql.Row{{doltCommit, 0, 0, "merge successful"}}, + Expected: []sql.UntypedSqlRow{{doltCommit, 0, 0, "merge successful"}}, }, }, }, @@ -2504,7 +2504,7 @@ var MergeScripts = []queries.ScriptTest{ Assertions: []queries.ScriptTestAssertion{ { Query: "call dolt_merge('main')", - Expected: []sql.Row{{doltCommit, 0, 0, "merge successful"}}, + Expected: []sql.UntypedSqlRow{{doltCommit, 0, 0, "merge successful"}}, }, }, }, @@ -2524,7 +2524,7 @@ var MergeScripts = []queries.ScriptTest{ Assertions: []queries.ScriptTestAssertion{ { Query: "call dolt_merge('main')", - Expected: []sql.Row{{doltCommit, 0, 0, "merge successful"}}, + Expected: []sql.UntypedSqlRow{{doltCommit, 0, 0, "merge successful"}}, }, }, }, @@ -2550,15 +2550,15 @@ var KeylessMergeCVsAndConflictsScripts = []queries.ScriptTest{ Assertions: []queries.ScriptTestAssertion{ { Query: "CALL DOLT_MERGE('right');", - Expected: []sql.Row{{"", 0, 1, "conflicts found"}}, + Expected: []sql.UntypedSqlRow{{"", 0, 1, "conflicts found"}}, }, { Query: "SELECT violation_type, col1, col2 from dolt_constraint_violations_t ORDER BY col1 ASC;", - Expected: []sql.Row{{"unique index", 1, 1}, {"unique index", 2, 1}}, + Expected: []sql.UntypedSqlRow{{"unique index", 1, 1}, {"unique index", 2, 1}}, }, { Query: "SELECT * from t ORDER BY col1 ASC;", - Expected: []sql.Row{{1, 1}, {2, 1}}, + Expected: []sql.UntypedSqlRow{{1, 1}, {2, 1}}, }, }, }, @@ -2583,19 +2583,19 @@ var KeylessMergeCVsAndConflictsScripts = []queries.ScriptTest{ Assertions: []queries.ScriptTestAssertion{ { Query: "CALL DOLT_MERGE('right');", - Expected: []sql.Row{{"", 0, 1, "conflicts found"}}, + Expected: []sql.UntypedSqlRow{{"", 0, 1, "conflicts found"}}, }, { Query: "SELECT violation_type, parent_fk from dolt_constraint_violations_child;", - Expected: []sql.Row{{"foreign key", 1}}, + Expected: []sql.UntypedSqlRow{{"foreign key", 1}}, }, { Query: "SELECT * from parent;", - Expected: []sql.Row{}, + Expected: []sql.UntypedSqlRow{}, }, { Query: "SELECT * from child;", - Expected: []sql.Row{{1}}, + Expected: []sql.UntypedSqlRow{{1}}, }, }, }, @@ -2618,11 +2618,11 @@ var KeylessMergeCVsAndConflictsScripts = []queries.ScriptTest{ Assertions: []queries.ScriptTestAssertion{ { Query: "CALL DOLT_MERGE('right');", - Expected: []sql.Row{{"", 0, 1, "conflicts found"}}, + Expected: []sql.UntypedSqlRow{{"", 0, 1, "conflicts found"}}, }, { Query: "SELECT base_col1, base_col2, our_col1, our_col2, their_col1, their_col2 from dolt_conflicts_t;", - Expected: []sql.Row{{nil, nil, 1, 1, 1, 1}}, + Expected: []sql.UntypedSqlRow{{nil, nil, 1, 1, 1, 1}}, }, }, }, @@ -2649,11 +2649,11 @@ var KeylessMergeCVsAndConflictsScripts = []queries.ScriptTest{ Assertions: []queries.ScriptTestAssertion{ { Query: "call dolt_merge('right');", - Expected: []sql.Row{{"", 0, 1, "conflicts found"}}, + Expected: []sql.UntypedSqlRow{{"", 0, 1, "conflicts found"}}, }, { Query: "select col1, col2, col3 from dolt_constraint_violations_t;", - Expected: []sql.Row{{3, 3, nil}, {3, 3, 1}}, + Expected: []sql.UntypedSqlRow{{3, 3, nil}, {3, 3, 1}}, }, }, }, @@ -2688,12 +2688,12 @@ var DoltConflictTableNameTableTests = []queries.ScriptTest{ Assertions: []queries.ScriptTestAssertion{ { Query: "CALL DOLT_MERGE('other');", - Expected: []sql.Row{{"", 0, 1, "conflicts found"}}, + Expected: []sql.UntypedSqlRow{{"", 0, 1, "conflicts found"}}, }, { Query: "SELECT base_pk, base_col1, our_pk, our_col1, our_diff_type, their_pk, their_col1, their_diff_type" + " from dolt_conflicts_t ORDER BY COALESCE(base_pk, our_pk, their_pk) ASC;", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {1, 1, 1, 2, "modified", 1, 3, "modified"}, {2, 2, nil, nil, "removed", 2, 0, "modified"}, {3, 3, 3, 0, "modified", nil, nil, "removed"}, @@ -2732,11 +2732,11 @@ var DoltConflictTableNameTableTests = []queries.ScriptTest{ Assertions: []queries.ScriptTestAssertion{ { Query: "CALL DOLT_MERGE('right');", - Expected: []sql.Row{{"", 0, 1, "conflicts found"}}, + Expected: []sql.UntypedSqlRow{{"", 0, 1, "conflicts found"}}, }, { Query: "SELECT base_col1, our_col1, their_col1, our_diff_type, their_diff_type, base_cardinality, our_cardinality, their_cardinality from dolt_conflicts_t ORDER BY COALESCE(base_col1, our_col1, their_col1) ASC;", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {1, nil, 1, "removed", "modified", uint64(1), uint64(0), uint64(2)}, {2, 2, nil, "modified", "removed", uint64(1), uint64(2), uint64(0)}, {3, 3, 3, "modified", "modified", uint64(1), uint64(2), uint64(2)}, @@ -2796,24 +2796,24 @@ var Dolt1ConflictTableNameTableTests = []queries.ScriptTest{ }, { Query: "select base_pk, base_col1, our_pk, our_col1, their_pk, their_col1 from dolt_conflicts_t where dolt_conflict_id = @hash1;", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {nil, nil, 1, -100, 1, 100}, }, }, { Query: "select base_pk, base_col1, our_pk, our_col1, their_pk, their_col1 from dolt_conflicts_t where dolt_conflict_id = @hash2;", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {nil, nil, 2, -200, 2, 200}, }, }, // Make sure that we can update using it { Query: "update dolt_conflicts_t SET our_col1 = their_col1 where dolt_conflict_id = @hash1;", - Expected: []sql.Row{{types.OkResult{RowsAffected: 1, Info: plan.UpdateInfo{Matched: 1, Updated: 1}}}}, + Expected: []sql.UntypedSqlRow{{types.OkResult{RowsAffected: 1, Info: plan.UpdateInfo{Matched: 1, Updated: 1}}}}, }, { Query: "select base_pk, base_col1, our_pk, our_col1, their_pk, their_col1 from dolt_conflicts_t;", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {nil, nil, 1, 100, 1, 100}, {nil, nil, 2, -200, 2, 200}, }, @@ -2821,11 +2821,11 @@ var Dolt1ConflictTableNameTableTests = []queries.ScriptTest{ // And delete { Query: "delete from dolt_conflicts_t where dolt_conflict_id = @hash1;", - Expected: []sql.Row{{types.OkResult{RowsAffected: 1}}}, + Expected: []sql.UntypedSqlRow{{types.OkResult{RowsAffected: 1}}}, }, { Query: "select base_pk, base_col1, our_pk, our_col1, their_pk, their_col1 from dolt_conflicts_t;", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {nil, nil, 2, -200, 2, 200}, }, }, @@ -2853,7 +2853,7 @@ var Dolt1ConflictTableNameTableTests = []queries.ScriptTest{ Assertions: []queries.ScriptTestAssertion{ { Query: "select @hash1 != @hash2 AND @hash2 != @hash3;", - Expected: []sql.Row{{true}}, + Expected: []sql.UntypedSqlRow{{true}}, }, }, }, @@ -2863,43 +2863,43 @@ var Dolt1ConflictTableNameTableTests = []queries.ScriptTest{ Assertions: []queries.ScriptTestAssertion{ { Query: "select base_pk, base_col1, our_pk, our_col1, their_pk, their_col1 from dolt_conflicts_t;", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {nil, nil, 1, -100, 1, 100}, {nil, nil, 2, -200, 2, 200}, }, }, { Query: "update dolt_conflicts_t set our_col1 = 1000 where our_pk = 1;", - Expected: []sql.Row{{types.OkResult{RowsAffected: 1, Info: plan.UpdateInfo{Matched: 1, Updated: 1}}}}, + Expected: []sql.UntypedSqlRow{{types.OkResult{RowsAffected: 1, Info: plan.UpdateInfo{Matched: 1, Updated: 1}}}}, }, { Query: "select base_pk, base_col1, our_pk, our_col1, their_pk, their_col1 from dolt_conflicts_t;", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {nil, nil, 1, 1000, 1, 100}, {nil, nil, 2, -200, 2, 200}, }, }, { Query: "select * from t;", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {1, 1000}, {2, -200}, }, }, { Query: "update dolt_conflicts_t set our_col1 = their_col1;", - Expected: []sql.Row{{types.OkResult{RowsAffected: 2, Info: plan.UpdateInfo{Matched: 2, Updated: 2}}}}, + Expected: []sql.UntypedSqlRow{{types.OkResult{RowsAffected: 2, Info: plan.UpdateInfo{Matched: 2, Updated: 2}}}}, }, { Query: "select base_pk, base_col1, our_pk, our_col1, their_pk, their_col1 from dolt_conflicts_t;", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {nil, nil, 1, 100, 1, 100}, {nil, nil, 2, 200, 2, 200}, }, }, { Query: "select * from t;", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {1, 100}, {2, 200}, }, @@ -2926,25 +2926,25 @@ var Dolt1ConflictTableNameTableTests = []queries.ScriptTest{ Assertions: []queries.ScriptTestAssertion{ { Query: "select base_pk1, base_pk2, base_col1, our_pk1, our_pk2, our_col1, their_pk1, their_pk2, their_col1 from dolt_conflicts_t;", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {nil, nil, nil, 1, 1, -100, 1, 1, 100}, {nil, nil, nil, 1, 2, -200, 1, 2, 200}, }, }, { Query: "Update dolt_conflicts_t set our_col1 = 1000;", - Expected: []sql.Row{{types.OkResult{RowsAffected: 2, Info: plan.UpdateInfo{Matched: 2, Updated: 2}}}}, + Expected: []sql.UntypedSqlRow{{types.OkResult{RowsAffected: 2, Info: plan.UpdateInfo{Matched: 2, Updated: 2}}}}, }, { Query: "select base_pk1, base_pk2, base_col1, our_pk1, our_pk2, our_col1, their_pk1, their_pk2, their_col1 from dolt_conflicts_t;", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {nil, nil, nil, 1, 1, 1000, 1, 1, 100}, {nil, nil, nil, 1, 2, 1000, 1, 2, 200}, }, }, { Query: "select * from t;", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {1, 1, 1000}, {2, 1, 1000}, }, @@ -2971,7 +2971,7 @@ var Dolt1ConflictTableNameTableTests = []queries.ScriptTest{ Assertions: []queries.ScriptTestAssertion{ { Query: "select base_name, base_price, base_cardinality, our_name, our_price, our_cardinality, their_name, their_price, their_cardinality from dolt_conflicts_t;", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {nil, nil, uint64(0), "apple", 1, uint64(2), "apple", 1, uint64(1)}, }, }, @@ -2980,19 +2980,19 @@ var Dolt1ConflictTableNameTableTests = []queries.ScriptTest{ // was run against the conflicts table, only one row is updated. { Query: "update dolt_conflicts_t set our_name = 'orange' where our_name = 'apple'", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {types.OkResult{RowsAffected: 1, Info: plan.UpdateInfo{Updated: 1, Matched: 1}}}, }, }, { Query: "select base_name, base_price, base_cardinality, our_name, our_price, our_cardinality, their_name, their_price, their_cardinality from dolt_conflicts_t;", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {nil, nil, uint64(0), "apple", 1, uint64(1), "apple", 1, uint64(1)}, }, }, { Query: "select * from t;", - Expected: []sql.Row{{"apple", 1}, {"orange", 1}}, + Expected: []sql.UntypedSqlRow{{"apple", 1}, {"orange", 1}}, }, // Updating cardinality should be no-op. { @@ -3000,13 +3000,13 @@ var Dolt1ConflictTableNameTableTests = []queries.ScriptTest{ }, { Query: "select base_name, base_price, base_cardinality, our_name, our_price, our_cardinality, their_name, their_price, their_cardinality from dolt_conflicts_t;", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {nil, nil, uint64(0), "apple", 1, uint64(1), "apple", 1, uint64(1)}, }, }, { Query: "select * from t;", - Expected: []sql.Row{{"apple", 1}, {"orange", 1}}, + Expected: []sql.UntypedSqlRow{{"apple", 1}, {"orange", 1}}, }, }, }, @@ -3039,7 +3039,7 @@ var Dolt1ConflictTableNameTableTests = []queries.ScriptTest{ Assertions: []queries.ScriptTestAssertion{ { Query: "select base_pk, base_col1, our_pk, our_col1, their_pk, their_col1 from dolt_conflicts_t;", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {1, nil, 1, -100, 1, 100}, {2, nil, 2, -200, nil, nil}, {3, nil, nil, nil, 3, 300}, @@ -3048,11 +3048,11 @@ var Dolt1ConflictTableNameTableTests = []queries.ScriptTest{ }, { Query: "delete from t;", - Expected: []sql.Row{{types.NewOkResult(3)}}, + Expected: []sql.UntypedSqlRow{{types.NewOkResult(3)}}, }, { Query: "select base_pk, base_col1, our_pk, our_col1, their_pk, their_col1 from dolt_conflicts_t;", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {1, nil, nil, nil, 1, 100}, {2, nil, nil, nil, nil, nil}, {3, nil, nil, nil, 3, 300}, @@ -3061,7 +3061,7 @@ var Dolt1ConflictTableNameTableTests = []queries.ScriptTest{ }, { Query: "select * from t;", - Expected: []sql.Row{}, + Expected: []sql.UntypedSqlRow{}, }, // The new rows PKs must be fully specified { @@ -3071,11 +3071,11 @@ var Dolt1ConflictTableNameTableTests = []queries.ScriptTest{ // Take theirs { Query: "update dolt_conflicts_t set our_pk = their_pk, our_col1 = their_col1;", - Expected: []sql.Row{{types.OkResult{RowsAffected: 3, Info: plan.UpdateInfo{Matched: 4, Updated: 3}}}}, + Expected: []sql.UntypedSqlRow{{types.OkResult{RowsAffected: 3, Info: plan.UpdateInfo{Matched: 4, Updated: 3}}}}, }, { Query: "select * from t;", - Expected: []sql.Row{{1, 100}, {3, 300}, {4, 400}}, + Expected: []sql.UntypedSqlRow{{1, 100}, {3, 300}, {4, 400}}, }, }, }, @@ -3085,22 +3085,22 @@ var Dolt1ConflictTableNameTableTests = []queries.ScriptTest{ Assertions: []queries.ScriptTestAssertion{ { Query: "show create table dolt_conflicts_t;", - Expected: []sql.Row{{"dolt_conflicts_t", "CREATE TABLE `dolt_conflicts_t` (\n `from_root_ish` varchar(1023),\n `base_pk` int,\n `base_col1` int,\n `our_pk` int NOT NULL,\n `our_col2` int,\n `our_col1` int,\n `our_diff_type` varchar(1023),\n `their_pk` int,\n `their_col1` int,\n `their_diff_type` varchar(1023),\n `dolt_conflict_id` varchar(1023)\n) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_bin"}}, + Expected: []sql.UntypedSqlRow{{"dolt_conflicts_t", "CREATE TABLE `dolt_conflicts_t` (\n `from_root_ish` varchar(1023),\n `base_pk` int,\n `base_col1` int,\n `our_pk` int NOT NULL,\n `our_col2` int,\n `our_col1` int,\n `our_diff_type` varchar(1023),\n `their_pk` int,\n `their_col1` int,\n `their_diff_type` varchar(1023),\n `dolt_conflict_id` varchar(1023)\n) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_bin"}}, }, { Query: "select base_pk, base_col1, our_pk, our_col1, our_col2, their_pk, their_col1 from dolt_conflicts_t;", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {nil, nil, 1, -100, nil, 1, 100}, {nil, nil, 2, -200, nil, 2, 200}, }, }, { Query: "update dolt_conflicts_t set our_col2 = their_col1", - Expected: []sql.Row{{types.OkResult{RowsAffected: 2, Info: plan.UpdateInfo{Matched: 2, Updated: 2}}}}, + Expected: []sql.UntypedSqlRow{{types.OkResult{RowsAffected: 2, Info: plan.UpdateInfo{Matched: 2, Updated: 2}}}}, }, { Query: "select pk, col1, col2 from t;", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {1, -100, 100}, {2, -200, 200}, }, @@ -3113,29 +3113,29 @@ var Dolt1ConflictTableNameTableTests = []queries.ScriptTest{ Assertions: []queries.ScriptTestAssertion{ { Query: "select base_pk, base_col1, our_pk, our_col1, their_pk, their_col1 from dolt_conflicts_t;", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {nil, nil, 1, -100, 1, 100}, {nil, nil, 2, -200, 2, 200}, }, }, { Query: "select * from t;", - Expected: []sql.Row{{1, -100}, {2, -200}}, + Expected: []sql.UntypedSqlRow{{1, -100}, {2, -200}}, }, { Query: "update dolt_conflicts_t set base_col1 = 9999, their_col1 = 9999;", - Expected: []sql.Row{{types.OkResult{RowsAffected: 2, Info: plan.UpdateInfo{Matched: 2, Updated: 2}}}}, + Expected: []sql.UntypedSqlRow{{types.OkResult{RowsAffected: 2, Info: plan.UpdateInfo{Matched: 2, Updated: 2}}}}, }, { Query: "select base_pk, base_col1, our_pk, our_col1, their_pk, their_col1 from dolt_conflicts_t;", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {nil, nil, 1, -100, 1, 100}, {nil, nil, 2, -200, 2, 200}, }, }, { Query: "select * from t;", - Expected: []sql.Row{{1, -100}, {2, -200}}, + Expected: []sql.UntypedSqlRow{{1, -100}, {2, -200}}, }, }, }, @@ -3188,45 +3188,45 @@ var MergeArtifactsScripts = []queries.ScriptTest{ Assertions: []queries.ScriptTestAssertion{ { Query: "SELECT base_pk, base_col1, our_pk, our_col1, their_pk, their_col1 from dolt_conflicts_t;", - Expected: []sql.Row{{1, 1, 1, 100, 1, -100}}, + Expected: []sql.UntypedSqlRow{{1, 1, 1, 100, 1, -100}}, }, { Query: "SELECT pk, col1 from t;", - Expected: []sql.Row{{1, 100}}, + Expected: []sql.UntypedSqlRow{{1, 100}}, }, { Query: "CALL DOLT_CHECKOUT('conflicts2');", - Expected: []sql.Row{{0, "Switched to branch 'conflicts2'"}}, + Expected: []sql.UntypedSqlRow{{0, "Switched to branch 'conflicts2'"}}, }, { Query: "SELECT base_pk, base_col1, our_pk, our_col1, their_pk, their_col1 from dolt_conflicts_t;", - Expected: []sql.Row{{2, 2, 2, 100, 2, -100}}, + Expected: []sql.UntypedSqlRow{{2, 2, 2, 100, 2, -100}}, }, { Query: "SELECT pk, col1 from t;", - Expected: []sql.Row{{2, 100}}, + Expected: []sql.UntypedSqlRow{{2, 100}}, }, { Query: "CALL DOLT_MERGE('conflicts1');", - Expected: []sql.Row{{"", 0, 1, "conflicts found"}}, + Expected: []sql.UntypedSqlRow{{"", 0, 1, "conflicts found"}}, }, { Query: "SELECT base_pk, base_col1, our_pk, our_col1, their_pk, their_col1 from dolt_conflicts_t;", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {1, 1, 1, 100, 1, -100}, {2, 2, 2, 100, 2, -100}, }, }, { Query: "SELECT pk, col1 from t;", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {1, 100}, {2, 100}, }, }, { Query: "UPDATE t SET col1 = 300;", - Expected: []sql.Row{{types.OkResult{ + Expected: []sql.UntypedSqlRow{{types.OkResult{ RowsAffected: 2, Info: plan.UpdateInfo{ Matched: 2, @@ -3236,7 +3236,7 @@ var MergeArtifactsScripts = []queries.ScriptTest{ }, { Query: "SELECT base_pk, base_col1, our_pk, our_col1, their_pk, their_col1 from dolt_conflicts_t;", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {1, 1, 1, 300, 1, -100}, {2, 2, 2, 300, 2, -100}, }, @@ -3279,11 +3279,11 @@ var MergeArtifactsScripts = []queries.ScriptTest{ }, { Query: "SELECT base_pk, base_col1, our_pk, our_col1, their_pk, their_col1 from dolt_conflicts_t;", - Expected: []sql.Row{{1, 1, 1, 100, 1, -100}}, + Expected: []sql.UntypedSqlRow{{1, 1, 1, 100, 1, -100}}, }, { Query: "SELECT pk, col1, col2 from t;", - Expected: []sql.Row{{1, 100, 1000}}, + Expected: []sql.UntypedSqlRow{{1, 100, 1000}}, }, }, }, @@ -3335,72 +3335,72 @@ var MergeArtifactsScripts = []queries.ScriptTest{ Assertions: []queries.ScriptTestAssertion{ { Query: "SELECT violation_type, pk, fk from dolt_constraint_violations_child;", - Expected: []sql.Row{{"foreign key", 1, 1}}, + Expected: []sql.UntypedSqlRow{{"foreign key", 1, 1}}, }, { Query: "SELECT pk, fk from child;", - Expected: []sql.Row{{1, 1}}, + Expected: []sql.UntypedSqlRow{{1, 1}}, }, { Query: "SELECT * from parent;", - Expected: []sql.Row{}, + Expected: []sql.UntypedSqlRow{}, }, { Query: "CALL DOLT_CHECKOUT('viol2');", - Expected: []sql.Row{{0, "Switched to branch 'viol2'"}}, + Expected: []sql.UntypedSqlRow{{0, "Switched to branch 'viol2'"}}, }, { Query: "SELECT violation_type, pk, fk from dolt_constraint_violations_child;", - Expected: []sql.Row{{"foreign key", 2, 2}}, + Expected: []sql.UntypedSqlRow{{"foreign key", 2, 2}}, }, { Query: "SELECT pk, fk from child;", - Expected: []sql.Row{{2, 2}}, + Expected: []sql.UntypedSqlRow{{2, 2}}, }, { Query: "SELECT * from parent;", - Expected: []sql.Row{}, + Expected: []sql.UntypedSqlRow{}, }, { Query: "CALL DOLT_MERGE('viol1');", - Expected: []sql.Row{{"", 0, 1, "conflicts found"}}, + Expected: []sql.UntypedSqlRow{{"", 0, 1, "conflicts found"}}, }, // the commit hashes for the above two violations change in this merge { Query: "SELECT violation_type, fk, pk from dolt_constraint_violations_child;", - Expected: []sql.Row{{"foreign key", 1, 1}, {"foreign key", 2, 2}}, + Expected: []sql.UntypedSqlRow{{"foreign key", 1, 1}, {"foreign key", 2, 2}}, }, { Query: "SELECT pk, fk from child;", - Expected: []sql.Row{{1, 1}, {2, 2}}, + Expected: []sql.UntypedSqlRow{{1, 1}, {2, 2}}, }, { Query: "SELECT * from parent;", - Expected: []sql.Row{}, + Expected: []sql.UntypedSqlRow{}, }, { Query: "CALL DOLT_COMMIT('-afm', 'commit active merge');", - Expected: []sql.Row{{doltCommit}}, + Expected: []sql.UntypedSqlRow{{doltCommit}}, }, { Query: "SET FOREIGN_KEY_CHECKS=0;", - Expected: []sql.Row{{}}, + Expected: []sql.UntypedSqlRow{{}}, }, { Query: "UPDATE child set fk = 4;", - Expected: []sql.Row{{types.OkResult{RowsAffected: 2, InsertID: 0, Info: plan.UpdateInfo{Matched: 2, Updated: 2}}}}, + Expected: []sql.UntypedSqlRow{{types.OkResult{RowsAffected: 2, InsertID: 0, Info: plan.UpdateInfo{Matched: 2, Updated: 2}}}}, }, { Query: "CALL DOLT_COMMIT('-afm', 'update children to new value');", - Expected: []sql.Row{{doltCommit}}, + Expected: []sql.UntypedSqlRow{{doltCommit}}, }, { Query: "CALL DOLT_MERGE('other3');", - Expected: []sql.Row{{"", 0, 1, "conflicts found"}}, + Expected: []sql.UntypedSqlRow{{"", 0, 1, "conflicts found"}}, }, { Query: "SELECT violation_type, pk, fk from dolt_constraint_violations_child;", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {"foreign key", 1, 1}, {"foreign key", 1, 4}, {"foreign key", 2, 2}, @@ -3437,55 +3437,55 @@ var MergeArtifactsScripts = []queries.ScriptTest{ Assertions: []queries.ScriptTestAssertion{ { Query: "CALL DOLT_MERGE('left2');", - Expected: []sql.Row{{"", 0, 1, "conflicts found"}}, + Expected: []sql.UntypedSqlRow{{"", 0, 1, "conflicts found"}}, }, { Query: "SELECT * from t;", - Expected: []sql.Row{{1, 1}, {2, 1}}, + Expected: []sql.UntypedSqlRow{{1, 1}, {2, 1}}, }, { Query: "SELECT violation_type, pk, col1 from dolt_constraint_violations_t;", - Expected: []sql.Row{{"unique index", 1, 1}, {"unique index", 2, 1}}, + Expected: []sql.UntypedSqlRow{{"unique index", 1, 1}, {"unique index", 2, 1}}, }, { Query: "CALL DOLT_COMMIT('-afm', 'commit unique key viol');", - Expected: []sql.Row{{doltCommit}}, + Expected: []sql.UntypedSqlRow{{doltCommit}}, }, { Query: "CALL DOLT_CHECKOUT('right');", - Expected: []sql.Row{{0, "Switched to branch 'right'"}}, + Expected: []sql.UntypedSqlRow{{0, "Switched to branch 'right'"}}, }, { Query: "CALL DOLT_MERGE('right2');", - Expected: []sql.Row{{"", 0, 1, "conflicts found"}}, + Expected: []sql.UntypedSqlRow{{"", 0, 1, "conflicts found"}}, }, { Query: "SELECT * from t;", - Expected: []sql.Row{{3, 1}, {4, 1}}, + Expected: []sql.UntypedSqlRow{{3, 1}, {4, 1}}, }, { Query: "SELECT violation_type, pk, col1 from dolt_constraint_violations_t;", - Expected: []sql.Row{{"unique index", 3, 1}, {"unique index", 4, 1}}, + Expected: []sql.UntypedSqlRow{{"unique index", 3, 1}, {"unique index", 4, 1}}, }, { Query: "CALL DOLT_COMMIT('-afm', 'commit unique key viol');", - Expected: []sql.Row{{doltCommit}}, + Expected: []sql.UntypedSqlRow{{doltCommit}}, }, { Query: "CALL DOLT_CHECKOUT('main');", - Expected: []sql.Row{{0, "Switched to branch 'main'"}}, + Expected: []sql.UntypedSqlRow{{0, "Switched to branch 'main'"}}, }, { Query: "CALL DOLT_MERGE('right');", - Expected: []sql.Row{{"", 0, 1, "conflicts found"}}, + Expected: []sql.UntypedSqlRow{{"", 0, 1, "conflicts found"}}, }, { Query: "SELECT * from t;", - Expected: []sql.Row{{1, 1}, {2, 1}, {3, 1}, {4, 1}}, + Expected: []sql.UntypedSqlRow{{1, 1}, {2, 1}, {3, 1}, {4, 1}}, }, { Query: "SELECT violation_type, pk, col1 from dolt_constraint_violations_t;", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {"unique index", 1, 1}, {"unique index", 2, 1}, {"unique index", 3, 1}, @@ -3514,11 +3514,11 @@ var MergeArtifactsScripts = []queries.ScriptTest{ Assertions: []queries.ScriptTestAssertion{ { Query: "CALL DOLT_MERGE('right');", - Expected: []sql.Row{{doltCommit, 0, 0, "merge successful"}}, + Expected: []sql.UntypedSqlRow{{doltCommit, 0, 0, "merge successful"}}, }, { Query: "SELECT * from t;", - Expected: []sql.Row{{1, 1}, {2, 2}, {3, 3}}, + Expected: []sql.UntypedSqlRow{{1, 1}, {2, 2}, {3, 3}}, }, }, }, @@ -3542,11 +3542,11 @@ var MergeArtifactsScripts = []queries.ScriptTest{ Assertions: []queries.ScriptTestAssertion{ { Query: "call dolt_merge('right');", - Expected: []sql.Row{{"", 0, 1, "conflicts found"}}, + Expected: []sql.UntypedSqlRow{{"", 0, 1, "conflicts found"}}, }, { Query: "select col1, col2, col3 from dolt_constraint_violations_t;", - Expected: []sql.Row{{1, 2, 3}, {2, 2, 3}}, + Expected: []sql.UntypedSqlRow{{1, 2, 3}, {2, 2, 3}}, }, }, }, @@ -3570,11 +3570,11 @@ var MergeArtifactsScripts = []queries.ScriptTest{ Assertions: []queries.ScriptTestAssertion{ { Query: "call dolt_merge('right');", - Expected: []sql.Row{{"", 0, 1, "conflicts found"}}, + Expected: []sql.UntypedSqlRow{{"", 0, 1, "conflicts found"}}, }, { Query: "select w, x, y, z from dolt_constraint_violations_wxyz;", - Expected: []sql.Row{{1, 2, 3, 4}, {5, 2, 6, 4}}, + Expected: []sql.UntypedSqlRow{{1, 2, 3, 4}, {5, 2, 6, 4}}, }, }, }, @@ -3598,15 +3598,15 @@ var MergeArtifactsScripts = []queries.ScriptTest{ Assertions: []queries.ScriptTestAssertion{ { Query: "call dolt_merge('right');", - Expected: []sql.Row{{doltCommit, 0, 0, "merge successful"}}, + Expected: []sql.UntypedSqlRow{{doltCommit, 0, 0, "merge successful"}}, }, { Query: "select count(*) from dolt_constraint_violations;", - Expected: []sql.Row{{0}}, + Expected: []sql.UntypedSqlRow{{0}}, }, { Query: "select * from t;", - Expected: []sql.Row{{1, 2, nil}, {2, 2, nil}}, + Expected: []sql.UntypedSqlRow{{1, 2, nil}, {2, 2, nil}}, }, }, }, @@ -3630,11 +3630,11 @@ var MergeArtifactsScripts = []queries.ScriptTest{ Assertions: []queries.ScriptTestAssertion{ { Query: "call dolt_merge('right');", - Expected: []sql.Row{{"", 0, 1, "conflicts found"}}, + Expected: []sql.UntypedSqlRow{{"", 0, 1, "conflicts found"}}, }, { Query: "select col1, col2 from dolt_constraint_violations_t;", - Expected: []sql.Row{{"A", "first"}, {"A", "second"}}, + Expected: []sql.UntypedSqlRow{{"A", "first"}, {"A", "second"}}, }, }, }, @@ -3677,11 +3677,11 @@ var MergeArtifactsScripts = []queries.ScriptTest{ }, { Query: "SELECT * from parent;", - Expected: []sql.Row{}, + Expected: []sql.UntypedSqlRow{}, }, { Query: "SELECT * from child;", - Expected: []sql.Row{}, + Expected: []sql.UntypedSqlRow{}, }, }, }, @@ -3708,7 +3708,7 @@ var MergeArtifactsScripts = []queries.ScriptTest{ }, { Query: "SELECT * from t;", - Expected: []sql.Row{{1, 1, 1}}, + Expected: []sql.UntypedSqlRow{{1, 1, 1}}, }, }, }, @@ -3731,15 +3731,15 @@ var MergeArtifactsScripts = []queries.ScriptTest{ Assertions: []queries.ScriptTestAssertion{ { Query: "CALL DOLT_MERGE('right');", - Expected: []sql.Row{{"", 0, 1, "conflicts found"}}, + Expected: []sql.UntypedSqlRow{{"", 0, 1, "conflicts found"}}, }, { Query: "select * from dolt_constraint_violations;", - Expected: []sql.Row{{"t", uint64(4)}}, + Expected: []sql.UntypedSqlRow{{"t", uint64(4)}}, }, { Query: "select id, col1, col2, col3 from dolt_constraint_violations_t;", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {1, "val1", "val1", "val1"}, {2, "val1", "val1", "val1"}, {3, "val1", "val1", "val2"}, @@ -3768,15 +3768,15 @@ var MergeArtifactsScripts = []queries.ScriptTest{ Assertions: []queries.ScriptTestAssertion{ { Query: "CALL DOLT_MERGE('right');", - Expected: []sql.Row{{"", 0, 1, "conflicts found"}}, + Expected: []sql.UntypedSqlRow{{"", 0, 1, "conflicts found"}}, }, { Query: "select * from dolt_constraint_violations;", - Expected: []sql.Row{{"t", uint64(2)}}, + Expected: []sql.UntypedSqlRow{{"t", uint64(2)}}, }, { Query: "select id, col1, col2, col3 from dolt_constraint_violations_t;", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {1, "val1", "val1", "val2"}, {3, "val1", "val1", "val2"}, }, @@ -3804,15 +3804,15 @@ var MergeArtifactsScripts = []queries.ScriptTest{ Assertions: []queries.ScriptTestAssertion{ { Query: "CALL DOLT_MERGE('main');", - Expected: []sql.Row{{"", 0, 1, "conflicts found"}}, + Expected: []sql.UntypedSqlRow{{"", 0, 1, "conflicts found"}}, }, { Query: "select * from dolt_constraint_violations;", - Expected: []sql.Row{{"t", uint64(2)}}, + Expected: []sql.UntypedSqlRow{{"t", uint64(2)}}, }, { Query: "select id, col1, col2, col3 from dolt_constraint_violations_t;", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {1, "val1", "val1", "val2"}, {3, "val1", "val1", "val2"}, }, @@ -3842,11 +3842,11 @@ var SchemaConflictScripts = []queries.ScriptTest{ }, { Query: "select * from dolt_schema_conflicts", - Expected: []sql.Row{}, + Expected: []sql.UntypedSqlRow{}, }, { Query: "select * from dolt_status", - Expected: []sql.Row{}, + Expected: []sql.UntypedSqlRow{}, }, }, }, @@ -3866,11 +3866,11 @@ var SchemaConflictScripts = []queries.ScriptTest{ Assertions: []queries.ScriptTestAssertion{ { Query: "call dolt_merge('other')", - Expected: []sql.Row{{"", 0, 1, "conflicts found"}}, + Expected: []sql.UntypedSqlRow{{"", 0, 1, "conflicts found"}}, }, { Query: "select * from dolt_schema_conflicts", - Expected: []sql.Row{{ + Expected: []sql.UntypedSqlRow{{ "t", "CREATE TABLE `t` (\n `pk` int NOT NULL,\n `c0` varchar(20),\n PRIMARY KEY (`pk`)\n) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_bin;", "CREATE TABLE `t` (\n `pk` int NOT NULL,\n `c0` datetime(6),\n PRIMARY KEY (`pk`)\n) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_bin;", @@ -3880,7 +3880,7 @@ var SchemaConflictScripts = []queries.ScriptTest{ }, { Query: "select * from dolt_status", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {"t", false, "schema conflict"}, }, }, @@ -3910,43 +3910,43 @@ var OldFormatMergeConflictsAndCVsScripts = []queries.ScriptTest{ // transaction commit constraint violations that occur as a // result of a merge. Query: "set autocommit = off, dolt_force_transaction_commit = on", - Expected: []sql.Row{{}}, + Expected: []sql.UntypedSqlRow{{}}, }, { Query: "DELETE FROM parent where pk = 1;", - Expected: []sql.Row{{types.NewOkResult(1)}}, + Expected: []sql.UntypedSqlRow{{types.NewOkResult(1)}}, }, { Query: "CALL DOLT_COMMIT('-am', 'delete parent 1');", - Expected: []sql.Row{{doltCommit}}, + Expected: []sql.UntypedSqlRow{{doltCommit}}, }, { Query: "CALL DOLT_CHECKOUT('branch1');", - Expected: []sql.Row{{0, "Switched to branch 'branch1'"}}, + Expected: []sql.UntypedSqlRow{{0, "Switched to branch 'branch1'"}}, }, { Query: "INSERT INTO CHILD VALUES (1, 1);", - Expected: []sql.Row{{types.NewOkResult(1)}}, + Expected: []sql.UntypedSqlRow{{types.NewOkResult(1)}}, }, { Query: "CALL DOLT_COMMIT('-am', 'insert child of parent 1');", - Expected: []sql.Row{{doltCommit}}, + Expected: []sql.UntypedSqlRow{{doltCommit}}, }, { Query: "CALL DOLT_CHECKOUT('main');", - Expected: []sql.Row{{0, "Switched to branch 'main'"}}, + Expected: []sql.UntypedSqlRow{{0, "Switched to branch 'main'"}}, }, { Query: "CALL DOLT_MERGE('branch1');", - Expected: []sql.Row{{"", 0, 1, "conflicts found"}}, + Expected: []sql.UntypedSqlRow{{"", 0, 1, "conflicts found"}}, }, { Query: "SELECT violation_type, pk, parent_fk from dolt_constraint_violations_child;", - Expected: []sql.Row{{uint16(1), 1, 1}}, + Expected: []sql.UntypedSqlRow{{uint16(1), 1, 1}}, }, { Query: "COMMIT;", - Expected: []sql.Row{}, + Expected: []sql.UntypedSqlRow{}, }, { Query: "CALL DOLT_COMMIT('-am', 'commit constraint violations');", @@ -3954,47 +3954,47 @@ var OldFormatMergeConflictsAndCVsScripts = []queries.ScriptTest{ }, { Query: "CALL DOLT_COMMIT('-afm', 'commit constraint violations');", - Expected: []sql.Row{{doltCommit}}, + Expected: []sql.UntypedSqlRow{{doltCommit}}, }, { Query: "CALL DOLT_BRANCH('branch3');", - Expected: []sql.Row{{0}}, + Expected: []sql.UntypedSqlRow{{0}}, }, { Query: "DELETE FROM parent where pk = 2;", - Expected: []sql.Row{{types.NewOkResult(1)}}, + Expected: []sql.UntypedSqlRow{{types.NewOkResult(1)}}, }, { Query: "CALL DOLT_COMMIT('-afm', 'remove parent 2');", - Expected: []sql.Row{{doltCommit}}, + Expected: []sql.UntypedSqlRow{{doltCommit}}, }, { Query: "CALL DOLT_CHECKOUT('branch2');", - Expected: []sql.Row{{0, "Switched to branch 'branch2'"}}, + Expected: []sql.UntypedSqlRow{{0, "Switched to branch 'branch2'"}}, }, { Query: "INSERT INTO OTHER VALUES (1);", - Expected: []sql.Row{{types.NewOkResult(1)}}, + Expected: []sql.UntypedSqlRow{{types.NewOkResult(1)}}, }, { Query: "CALL DOLT_COMMIT('-am', 'non-fk insert');", - Expected: []sql.Row{{doltCommit}}, + Expected: []sql.UntypedSqlRow{{doltCommit}}, }, { Query: "CALL DOLT_CHECKOUT('main');", - Expected: []sql.Row{{0, "Switched to branch 'main'"}}, + Expected: []sql.UntypedSqlRow{{0, "Switched to branch 'main'"}}, }, { Query: "CALL DOLT_MERGE('branch2');", - Expected: []sql.Row{{"", 0, 1, "conflicts found"}}, + Expected: []sql.UntypedSqlRow{{"", 0, 1, "conflicts found"}}, }, { Query: "SELECT violation_type, pk, parent_fk from dolt_constraint_violations_child;", - Expected: []sql.Row{{uint16(1), 1, 1}}, + Expected: []sql.UntypedSqlRow{{uint16(1), 1, 1}}, }, { Query: "COMMIT;", - Expected: []sql.Row{}, + Expected: []sql.UntypedSqlRow{}, }, { Query: "CALL DOLT_COMMIT('-am', 'commit non-conflicting merge');", @@ -4002,31 +4002,31 @@ var OldFormatMergeConflictsAndCVsScripts = []queries.ScriptTest{ }, { Query: "CALL DOLT_COMMIT('-afm', 'commit non-conflicting merge');", - Expected: []sql.Row{{doltCommit}}, + Expected: []sql.UntypedSqlRow{{doltCommit}}, }, { Query: "CALL DOLT_CHECKOUT('branch3');", - Expected: []sql.Row{{0, "Switched to branch 'branch3'"}}, + Expected: []sql.UntypedSqlRow{{0, "Switched to branch 'branch3'"}}, }, { Query: "INSERT INTO CHILD VALUES (2, 2);", - Expected: []sql.Row{{types.NewOkResult(1)}}, + Expected: []sql.UntypedSqlRow{{types.NewOkResult(1)}}, }, { Query: "CALL DOLT_COMMIT('-afm', 'add child of parent 2');", - Expected: []sql.Row{{doltCommit}}, + Expected: []sql.UntypedSqlRow{{doltCommit}}, }, { Query: "CALL DOLT_CHECKOUT('main');", - Expected: []sql.Row{{0, "Switched to branch 'main'"}}, + Expected: []sql.UntypedSqlRow{{0, "Switched to branch 'main'"}}, }, { Query: "CALL DOLT_MERGE('branch3');", - Expected: []sql.Row{{"", 0, 1, "conflicts found"}}, + Expected: []sql.UntypedSqlRow{{"", 0, 1, "conflicts found"}}, }, { Query: "SELECT violation_type, pk, parent_fk from dolt_constraint_violations_child;", - Expected: []sql.Row{{uint16(1), 1, 1}, {uint16(1), 2, 2}}, + Expected: []sql.UntypedSqlRow{{uint16(1), 1, 1}, {uint16(1), 2, 2}}, }, }, }, @@ -4055,32 +4055,32 @@ var OldFormatMergeConflictsAndCVsScripts = []queries.ScriptTest{ Assertions: []queries.ScriptTestAssertion{ { Query: "SET dolt_force_transaction_commit = 1", - Expected: []sql.Row{{}}, + Expected: []sql.UntypedSqlRow{{}}, }, { Query: "CALL DOLT_MERGE('other');", - Expected: []sql.Row{{"", 0, 1, "conflicts found"}}, + Expected: []sql.UntypedSqlRow{{"", 0, 1, "conflicts found"}}, }, { Query: "SELECT * from parent;", - Expected: []sql.Row{{1, 2}}, + Expected: []sql.UntypedSqlRow{{1, 2}}, }, { Query: "SELECT * from child;", - Expected: []sql.Row{{1, 2}}, + Expected: []sql.UntypedSqlRow{{1, 2}}, }, { Query: "SELECT base_col1, base_pk, our_col1, our_pk, their_col1, their_pk from dolt_conflicts_parent;", - Expected: []sql.Row{{1, 1, 2, 1, 3, 1}}, + Expected: []sql.UntypedSqlRow{{1, 1, 2, 1, 3, 1}}, }, { Query: "SELECT violation_type, pk, parent_fk from dolt_constraint_violations_child;", - Expected: []sql.Row{{uint16(1), 1, 2}}, + Expected: []sql.UntypedSqlRow{{uint16(1), 1, 2}}, }, // commit so we can merge again { Query: "CALL DOLT_COMMIT('-afm', 'committing merge conflicts');", - Expected: []sql.Row{{doltCommit}}, + Expected: []sql.UntypedSqlRow{{doltCommit}}, }, { Query: "CALL DOLT_MERGE('other2');", @@ -4088,19 +4088,19 @@ var OldFormatMergeConflictsAndCVsScripts = []queries.ScriptTest{ }, { Query: "SELECT * from parent;", - Expected: []sql.Row{{1, 2}}, + Expected: []sql.UntypedSqlRow{{1, 2}}, }, { Query: "SELECT * from child;", - Expected: []sql.Row{{1, 2}}, + Expected: []sql.UntypedSqlRow{{1, 2}}, }, { Query: "SELECT base_col1, base_pk, our_col1, our_pk, their_col1, their_pk from dolt_conflicts_parent;", - Expected: []sql.Row{{1, 1, 2, 1, 3, 1}}, + Expected: []sql.UntypedSqlRow{{1, 1, 2, 1, 3, 1}}, }, { Query: "SELECT violation_type, pk, parent_fk from dolt_constraint_violations_child;", - Expected: []sql.Row{{uint16(1), 1, 2}}, + Expected: []sql.UntypedSqlRow{{uint16(1), 1, 2}}, }, }, }, @@ -4129,52 +4129,52 @@ var OldFormatMergeConflictsAndCVsScripts = []queries.ScriptTest{ Assertions: []queries.ScriptTestAssertion{ { Query: "SET dolt_force_transaction_commit = 1;", - Expected: []sql.Row{{}}, + Expected: []sql.UntypedSqlRow{{}}, }, { Query: "CALL DOLT_MERGE('other');", - Expected: []sql.Row{{"", 0, 1, "conflicts found"}}, + Expected: []sql.UntypedSqlRow{{"", 0, 1, "conflicts found"}}, }, { Query: "SELECT * from parent;", - Expected: []sql.Row{{1, 2}}, + Expected: []sql.UntypedSqlRow{{1, 2}}, }, { Query: "SELECT * from child;", - Expected: []sql.Row{{1, 2}}, + Expected: []sql.UntypedSqlRow{{1, 2}}, }, { Query: "SELECT base_col1, base_pk, our_col1, our_pk, their_col1, their_pk from dolt_conflicts_parent;", - Expected: []sql.Row{{1, 1, 2, 1, 3, 1}}, + Expected: []sql.UntypedSqlRow{{1, 1, 2, 1, 3, 1}}, }, { Query: "SELECT violation_type, pk, parent_fk from dolt_constraint_violations_child;", - Expected: []sql.Row{{uint16(1), 1, 2}}, + Expected: []sql.UntypedSqlRow{{uint16(1), 1, 2}}, }, // commit so we can merge again { Query: "CALL DOLT_COMMIT('-afm', 'committing merge conflicts');", - Expected: []sql.Row{{doltCommit}}, + Expected: []sql.UntypedSqlRow{{doltCommit}}, }, { Query: "CALL DOLT_MERGE('other2');", - Expected: []sql.Row{{"", 0, 1, "conflicts found"}}, + Expected: []sql.UntypedSqlRow{{"", 0, 1, "conflicts found"}}, }, { Query: "SELECT * from parent;", - Expected: []sql.Row{{1, 2}, {3, 1}}, + Expected: []sql.UntypedSqlRow{{1, 2}, {3, 1}}, }, { Query: "SELECT * from child;", - Expected: []sql.Row{{1, 2}}, + Expected: []sql.UntypedSqlRow{{1, 2}}, }, { Query: "SELECT base_col1, base_pk, our_col1, our_pk, their_col1, their_pk from dolt_conflicts_parent;", - Expected: []sql.Row{{1, 1, 2, 1, 3, 1}}, + Expected: []sql.UntypedSqlRow{{1, 1, 2, 1, 3, 1}}, }, { Query: "SELECT violation_type, pk, parent_fk from dolt_constraint_violations_child;", - Expected: []sql.Row{{uint16(1), 1, 2}}, + Expected: []sql.UntypedSqlRow{{uint16(1), 1, 2}}, }, }, }, @@ -4203,11 +4203,11 @@ var OldFormatMergeConflictsAndCVsScripts = []queries.ScriptTest{ }, { Query: "SELECT * from t", - Expected: []sql.Row{{1, 1}, {2, 1}}, + Expected: []sql.UntypedSqlRow{{1, 1}, {2, 1}}, }, { Query: "show create table t", - Expected: []sql.Row{{"t", + Expected: []sql.UntypedSqlRow{{"t", "CREATE TABLE `t` (\n" + " `pk` int NOT NULL,\n" + " `col1` int,\n" + @@ -4263,11 +4263,11 @@ var GeneratedColumnMergeTestScripts = []queries.ScriptTest{ Assertions: []queries.ScriptTestAssertion{ { Query: "call dolt_merge('branch1')", - Expected: []sql.Row{{doltCommit, 1, 0, "merge successful"}}, + Expected: []sql.UntypedSqlRow{{doltCommit, 1, 0, "merge successful"}}, }, { Query: "select * from t1 order by id", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {1, 1, 1, 2}, {2, 2, 2, 4}, {3, 3, 3, 6}, @@ -4275,15 +4275,15 @@ var GeneratedColumnMergeTestScripts = []queries.ScriptTest{ }, { Query: "select id from t1 where v3 = 6", - Expected: []sql.Row{{3}}, + Expected: []sql.UntypedSqlRow{{3}}, }, { Query: "call dolt_merge('branch2')", - Expected: []sql.Row{{doltCommit, 0, 0, "merge successful"}}, + Expected: []sql.UntypedSqlRow{{doltCommit, 0, 0, "merge successful"}}, }, { Query: "select * from t1 order by id", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {1, 1, 1, 2}, {2, 2, 2, 4}, {3, 3, 3, 6}, @@ -4292,7 +4292,7 @@ var GeneratedColumnMergeTestScripts = []queries.ScriptTest{ }, { Query: "select id from t1 where v3 = 8", - Expected: []sql.Row{{4}}, + Expected: []sql.UntypedSqlRow{{4}}, }, }, }, @@ -4315,33 +4315,33 @@ var GeneratedColumnMergeTestScripts = []queries.ScriptTest{ Assertions: []queries.ScriptTestAssertion{ { Query: "call dolt_merge('branch1')", - Expected: []sql.Row{{doltCommit, 1, 0, "merge successful"}}, + Expected: []sql.UntypedSqlRow{{doltCommit, 1, 0, "merge successful"}}, }, { Query: "select * from t1 order by id", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {1, 4, 1, 5}, {2, 2, 2, 4}, }, }, { Query: "select id from t1 where v3 = 5", - Expected: []sql.Row{{1}}, + Expected: []sql.UntypedSqlRow{{1}}, }, { Query: "call dolt_merge('branch2')", - Expected: []sql.Row{{doltCommit, 0, 0, "merge successful"}}, + Expected: []sql.UntypedSqlRow{{doltCommit, 0, 0, "merge successful"}}, }, { Query: "select * from t1 order by id", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {1, 4, 5, 9}, {2, 2, 2, 4}, }, }, { Query: "select id from t1 where v3 = 9", - Expected: []sql.Row{{1}}, + Expected: []sql.UntypedSqlRow{{1}}, }, }, }, @@ -4364,11 +4364,11 @@ var GeneratedColumnMergeTestScripts = []queries.ScriptTest{ Assertions: []queries.ScriptTestAssertion{ { Query: "call dolt_merge('branch1')", - Expected: []sql.Row{{doltCommit, 0, 0, "merge successful"}}, + Expected: []sql.UntypedSqlRow{{doltCommit, 0, 0, "merge successful"}}, }, { Query: "select * from t1 order by id", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {1, 1, 1, 2}, {2, 2, 2, 4}, {3, 3, 3, 6}, @@ -4377,11 +4377,11 @@ var GeneratedColumnMergeTestScripts = []queries.ScriptTest{ }, { Query: "select id from t1 where v3 = 6", - Expected: []sql.Row{{3}}, + Expected: []sql.UntypedSqlRow{{3}}, }, { Query: "select id from t1 where v3 = 8", - Expected: []sql.Row{{4}}, + Expected: []sql.UntypedSqlRow{{4}}, }, }, }, @@ -4403,11 +4403,11 @@ var GeneratedColumnMergeTestScripts = []queries.ScriptTest{ Assertions: []queries.ScriptTestAssertion{ { Query: "call dolt_merge('branch1')", - Expected: []sql.Row{{doltCommit, 1, 0, "merge successful"}}, + Expected: []sql.UntypedSqlRow{{doltCommit, 1, 0, "merge successful"}}, }, { Query: "select * from t1 order by id", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {1, 2, 3, 5}, {4, 5, 6, 11}, {7, 8, 9, 17}, @@ -4415,15 +4415,15 @@ var GeneratedColumnMergeTestScripts = []queries.ScriptTest{ }, { Query: "select id from t1 where v3 = 17", - Expected: []sql.Row{{7}}, + Expected: []sql.UntypedSqlRow{{7}}, }, { Query: "call dolt_merge('branch2')", - Expected: []sql.Row{{doltCommit, 0, 0, "merge successful"}}, + Expected: []sql.UntypedSqlRow{{doltCommit, 0, 0, "merge successful"}}, }, { Query: "select * from t1 order by id", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {1, 2, 3, 5}, {4, 5, 6, 11}, {7, 8, 9, 17}, @@ -4432,7 +4432,7 @@ var GeneratedColumnMergeTestScripts = []queries.ScriptTest{ }, { Query: "select id from t1 where v3 = 23", - Expected: []sql.Row{{10}}, + Expected: []sql.UntypedSqlRow{{10}}, }, }, }, @@ -4455,11 +4455,11 @@ var GeneratedColumnMergeTestScripts = []queries.ScriptTest{ Assertions: []queries.ScriptTestAssertion{ { Query: "call dolt_merge('branch1')", - Expected: []sql.Row{{doltCommit, 0, 0, "merge successful"}}, + Expected: []sql.UntypedSqlRow{{doltCommit, 0, 0, "merge successful"}}, }, { Query: "select * from t1 order by id", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {1, 2, 3, 5}, {4, 5, 6, 11}, {7, 8, 9, 17}, @@ -4468,11 +4468,11 @@ var GeneratedColumnMergeTestScripts = []queries.ScriptTest{ }, { Query: "select id from t1 where v3 = 17", - Expected: []sql.Row{{7}}, + Expected: []sql.UntypedSqlRow{{7}}, }, { Query: "select id from t1 where v3 = 23", - Expected: []sql.Row{{10}}, + Expected: []sql.UntypedSqlRow{{10}}, }, }, }, diff --git a/go/libraries/doltcore/sqle/enginetest/dolt_queries_rebase.go b/go/libraries/doltcore/sqle/enginetest/dolt_queries_rebase.go index bc5b7f0a6e0..138fc682d9d 100644 --- a/go/libraries/doltcore/sqle/enginetest/dolt_queries_rebase.go +++ b/go/libraries/doltcore/sqle/enginetest/dolt_queries_rebase.go @@ -67,7 +67,7 @@ var DoltRebaseScriptTests = []queries.ScriptTest{ }, { Query: "call dolt_add('t');", - Expected: []sql.Row{{0}}, + Expected: []sql.UntypedSqlRow{{0}}, }, { Query: "call dolt_rebase('-i', 'main');", @@ -86,7 +86,7 @@ var DoltRebaseScriptTests = []queries.ScriptTest{ Assertions: []queries.ScriptTestAssertion{ { Query: "select database();", - Expected: []sql.Row{{nil}}, + Expected: []sql.UntypedSqlRow{{nil}}, }, { Query: "call dolt_rebase('-i', 'main');", @@ -114,7 +114,7 @@ var DoltRebaseScriptTests = []queries.ScriptTest{ // Merging main creates a conflict, so we're in an active // merge until we resolve. Query: "call dolt_merge('main');", - Expected: []sql.Row{{"", 0, 1, "conflicts found"}}, + Expected: []sql.UntypedSqlRow{{"", 0, 1, "conflicts found"}}, }, { Query: "call dolt_rebase('-i', 'main');", @@ -165,7 +165,7 @@ var DoltRebaseScriptTests = []queries.ScriptTest{ Assertions: []queries.ScriptTestAssertion{ { Query: "call dolt_rebase('-i', 'main');", - Expected: []sql.Row{{0, "interactive rebase started on branch dolt_rebase_branch1; " + + Expected: []sql.UntypedSqlRow{{0, "interactive rebase started on branch dolt_rebase_branch1; " + "adjust the rebase plan in the dolt_rebase table, then " + "continue rebasing by calling dolt_rebase('--continue')"}}, }, @@ -175,7 +175,7 @@ var DoltRebaseScriptTests = []queries.ScriptTest{ }, { Query: "update dolt_rebase set action='squash';", - Expected: []sql.Row{{gmstypes.OkResult{ + Expected: []sql.UntypedSqlRow{{gmstypes.OkResult{ RowsAffected: 2, InsertID: 0, Info: plan.UpdateInfo{ @@ -191,7 +191,7 @@ var DoltRebaseScriptTests = []queries.ScriptTest{ }, { Query: "update dolt_rebase set action='drop' where rebase_order=1;", - Expected: []sql.Row{{gmstypes.OkResult{ + Expected: []sql.UntypedSqlRow{{gmstypes.OkResult{ RowsAffected: 1, InsertID: 0, Info: plan.UpdateInfo{ @@ -207,7 +207,7 @@ var DoltRebaseScriptTests = []queries.ScriptTest{ }, { Query: "update dolt_rebase set action='pick', commit_hash='doesnotexist' where rebase_order=1;", - Expected: []sql.Row{{gmstypes.OkResult{ + Expected: []sql.UntypedSqlRow{{gmstypes.OkResult{ RowsAffected: 1, InsertID: 0, Info: plan.UpdateInfo{ @@ -223,7 +223,7 @@ var DoltRebaseScriptTests = []queries.ScriptTest{ }, { Query: "update dolt_rebase set commit_hash='0123456789abcdef0123456789abcdef' where rebase_order=1;", - Expected: []sql.Row{{gmstypes.OkResult{ + Expected: []sql.UntypedSqlRow{{gmstypes.OkResult{ RowsAffected: 1, InsertID: 0, Info: plan.UpdateInfo{ @@ -260,17 +260,17 @@ var DoltRebaseScriptTests = []queries.ScriptTest{ Assertions: []queries.ScriptTestAssertion{ { Query: "call dolt_rebase('-i', 'main');", - Expected: []sql.Row{{0, "interactive rebase started on branch dolt_rebase_branch1; " + + Expected: []sql.UntypedSqlRow{{0, "interactive rebase started on branch dolt_rebase_branch1; " + "adjust the rebase plan in the dolt_rebase table, then " + "continue rebasing by calling dolt_rebase('--continue')"}}, }, { Query: "delete from dolt_rebase where rebase_order=1;", - Expected: []sql.Row{{gmstypes.NewOkResult(1)}}, + Expected: []sql.UntypedSqlRow{{gmstypes.NewOkResult(1)}}, }, { Query: "select * from dolt_rebase order by rebase_order ASC;", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {"2", "pick", doltCommit, "updating row 1 on branch1"}, }, }, @@ -280,7 +280,7 @@ var DoltRebaseScriptTests = []queries.ScriptTest{ }, { Query: "select * from dolt_conflicts;", - Expected: []sql.Row{{"t", uint64(1)}}, + Expected: []sql.UntypedSqlRow{{"t", uint64(1)}}, }, { // Trying to --continue a rebase when there are conflicts results in an error. @@ -310,13 +310,13 @@ var DoltRebaseScriptTests = []queries.ScriptTest{ Assertions: []queries.ScriptTestAssertion{ { Query: "call dolt_rebase('-i', 'main');", - Expected: []sql.Row{{0, "interactive rebase started on branch dolt_rebase_branch1; " + + Expected: []sql.UntypedSqlRow{{0, "interactive rebase started on branch dolt_rebase_branch1; " + "adjust the rebase plan in the dolt_rebase table, then " + "continue rebasing by calling dolt_rebase('--continue')"}}, }, { Query: "insert into t values (100, 'hundo');", - Expected: []sql.Row{{gmstypes.NewOkResult(1)}}, + Expected: []sql.UntypedSqlRow{{gmstypes.NewOkResult(1)}}, }, { Query: "call dolt_rebase('--continue');", @@ -342,20 +342,20 @@ var DoltRebaseScriptTests = []queries.ScriptTest{ Assertions: []queries.ScriptTestAssertion{ { Query: "call dolt_rebase('-i', 'main');", - Expected: []sql.Row{{0, "interactive rebase started on branch dolt_rebase_branch1; " + + Expected: []sql.UntypedSqlRow{{0, "interactive rebase started on branch dolt_rebase_branch1; " + "adjust the rebase plan in the dolt_rebase table, then " + "continue rebasing by calling dolt_rebase('--continue')"}}, }, { Query: "update dolt_rebase set rebase_order=3 where rebase_order=1;", - Expected: []sql.Row{{gmstypes.OkResult{RowsAffected: uint64(1), Info: plan.UpdateInfo{ + Expected: []sql.UntypedSqlRow{{gmstypes.OkResult{RowsAffected: uint64(1), Info: plan.UpdateInfo{ Matched: 1, Updated: 1, }}}}, }, { Query: "select * from dolt_rebase order by rebase_order ASC;", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {"2", "pick", doltCommit, "updating row 1 on branch1"}, {"3.00", "pick", doltCommit, "inserting row 1 on branch1"}, }, @@ -385,21 +385,21 @@ var DoltRebaseScriptTests = []queries.ScriptTest{ Assertions: []queries.ScriptTestAssertion{ { Query: "call dolt_rebase('-i', 'main');", - Expected: []sql.Row{{0, "interactive rebase started on branch dolt_rebase_branch1; " + + Expected: []sql.UntypedSqlRow{{0, "interactive rebase started on branch dolt_rebase_branch1; " + "adjust the rebase plan in the dolt_rebase table, then " + "continue rebasing by calling dolt_rebase('--continue')"}}, }, { Query: "select active_branch();", - Expected: []sql.Row{{"dolt_rebase_branch1"}}, + Expected: []sql.UntypedSqlRow{{"dolt_rebase_branch1"}}, }, { Query: "call dolt_rebase('--continue');", - Expected: []sql.Row{{0, "Successfully rebased and updated refs/heads/branch1"}}, + Expected: []sql.UntypedSqlRow{{0, "Successfully rebased and updated refs/heads/branch1"}}, }, { Query: "select message from dolt_log;", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {"inserting row 10 on branch1"}, {"inserting row 0 on main"}, {"creating table t"}, @@ -427,21 +427,21 @@ var DoltRebaseScriptTests = []queries.ScriptTest{ Assertions: []queries.ScriptTestAssertion{ { Query: "call dolt_rebase('-i', '--empty', 'keep', 'main');", - Expected: []sql.Row{{0, "interactive rebase started on branch dolt_rebase_branch1; " + + Expected: []sql.UntypedSqlRow{{0, "interactive rebase started on branch dolt_rebase_branch1; " + "adjust the rebase plan in the dolt_rebase table, then " + "continue rebasing by calling dolt_rebase('--continue')"}}, }, { Query: "select active_branch();", - Expected: []sql.Row{{"dolt_rebase_branch1"}}, + Expected: []sql.UntypedSqlRow{{"dolt_rebase_branch1"}}, }, { Query: "call dolt_rebase('--continue');", - Expected: []sql.Row{{0, "Successfully rebased and updated refs/heads/branch1"}}, + Expected: []sql.UntypedSqlRow{{0, "Successfully rebased and updated refs/heads/branch1"}}, }, { Query: "select message from dolt_log;", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {"inserting row 10 on branch1"}, {"inserting row 0 on branch1"}, {"inserting row 0 on main"}, @@ -470,21 +470,21 @@ var DoltRebaseScriptTests = []queries.ScriptTest{ Assertions: []queries.ScriptTestAssertion{ { Query: "call dolt_rebase('-i', '--empty', 'drop', 'main');", - Expected: []sql.Row{{0, "interactive rebase started on branch dolt_rebase_branch1; " + + Expected: []sql.UntypedSqlRow{{0, "interactive rebase started on branch dolt_rebase_branch1; " + "adjust the rebase plan in the dolt_rebase table, then " + "continue rebasing by calling dolt_rebase('--continue')"}}, }, { Query: "select active_branch();", - Expected: []sql.Row{{"dolt_rebase_branch1"}}, + Expected: []sql.UntypedSqlRow{{"dolt_rebase_branch1"}}, }, { Query: "call dolt_rebase('--continue');", - Expected: []sql.Row{{0, "Successfully rebased and updated refs/heads/branch1"}}, + Expected: []sql.UntypedSqlRow{{0, "Successfully rebased and updated refs/heads/branch1"}}, }, { Query: "select message from dolt_log;", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {"inserting row 10 on branch1"}, {"inserting row 0 on main"}, {"creating table t"}, @@ -520,7 +520,7 @@ var DoltRebaseScriptTests = []queries.ScriptTest{ Assertions: []queries.ScriptTestAssertion{ { Query: "select active_branch();", - Expected: []sql.Row{{"branch1"}}, + Expected: []sql.UntypedSqlRow{{"branch1"}}, }, { Query: "call dolt_rebase('-i', 'HEAD');", @@ -529,12 +529,12 @@ var DoltRebaseScriptTests = []queries.ScriptTest{ { // if the rebase doesn't start, then we should remain on the original branch Query: "select active_branch();", - Expected: []sql.Row{{"branch1"}}, + Expected: []sql.UntypedSqlRow{{"branch1"}}, }, { // and the rebase working branch shouldn't be present Query: "select * from dolt_branches where name='dolt_rebase_branch1';", - Expected: []sql.Row{}, + Expected: []sql.UntypedSqlRow{}, }, }, }, @@ -565,25 +565,25 @@ var DoltRebaseScriptTests = []queries.ScriptTest{ Assertions: []queries.ScriptTestAssertion{ { Query: "call dolt_rebase('-i', 'main');", - Expected: []sql.Row{{0, "interactive rebase started on branch dolt_rebase_branch1; " + + Expected: []sql.UntypedSqlRow{{0, "interactive rebase started on branch dolt_rebase_branch1; " + "adjust the rebase plan in the dolt_rebase table, then " + "continue rebasing by calling dolt_rebase('--continue')"}}, }, { Query: "select active_branch();", - Expected: []sql.Row{{"dolt_rebase_branch1"}}, + Expected: []sql.UntypedSqlRow{{"dolt_rebase_branch1"}}, }, { Query: "call dolt_rebase('--abort');", - Expected: []sql.Row{{0, "Interactive rebase aborted"}}, + Expected: []sql.UntypedSqlRow{{0, "Interactive rebase aborted"}}, }, { Query: "select active_branch();", - Expected: []sql.Row{{"branch1"}}, + Expected: []sql.UntypedSqlRow{{"branch1"}}, }, { Query: "select name from dolt_branches", - Expected: []sql.Row{{"main"}, {"branch1"}}, + Expected: []sql.UntypedSqlRow{{"main"}, {"branch1"}}, }, }, }, @@ -614,13 +614,13 @@ var DoltRebaseScriptTests = []queries.ScriptTest{ Assertions: []queries.ScriptTestAssertion{ { Query: "call dolt_rebase('-i', 'main');", - Expected: []sql.Row{{0, "interactive rebase started on branch dolt_rebase_branch1; " + + Expected: []sql.UntypedSqlRow{{0, "interactive rebase started on branch dolt_rebase_branch1; " + "adjust the rebase plan in the dolt_rebase table, then " + "continue rebasing by calling dolt_rebase('--continue')"}}, }, { Query: "select * from dolt_rebase order by rebase_order ASC;", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {"1", "pick", doltCommit, "inserting row 1"}, {"2", "pick", doltCommit, "inserting row 10"}, {"3", "pick", doltCommit, "inserting row 100"}, @@ -631,42 +631,42 @@ var DoltRebaseScriptTests = []queries.ScriptTest{ }, { Query: "update dolt_rebase set rebase_order=6.1 where rebase_order=6;", - Expected: []sql.Row{{gmstypes.OkResult{RowsAffected: uint64(1), Info: plan.UpdateInfo{ + Expected: []sql.UntypedSqlRow{{gmstypes.OkResult{RowsAffected: uint64(1), Info: plan.UpdateInfo{ Matched: 1, Updated: 1, }}}}, }, { Query: "update dolt_rebase set action='squash' where rebase_order in (2, 3);", - Expected: []sql.Row{{gmstypes.OkResult{RowsAffected: uint64(2), Info: plan.UpdateInfo{ + Expected: []sql.UntypedSqlRow{{gmstypes.OkResult{RowsAffected: uint64(2), Info: plan.UpdateInfo{ Matched: 2, Updated: 2, }}}}, }, { Query: "update dolt_rebase set action='drop' where rebase_order = 4;", - Expected: []sql.Row{{gmstypes.OkResult{RowsAffected: uint64(1), Info: plan.UpdateInfo{ + Expected: []sql.UntypedSqlRow{{gmstypes.OkResult{RowsAffected: uint64(1), Info: plan.UpdateInfo{ Matched: 1, Updated: 1, }}}}, }, { Query: "update dolt_rebase set action='reword', commit_message='reworded!' where rebase_order = 5;", - Expected: []sql.Row{{gmstypes.OkResult{RowsAffected: uint64(1), Info: plan.UpdateInfo{ + Expected: []sql.UntypedSqlRow{{gmstypes.OkResult{RowsAffected: uint64(1), Info: plan.UpdateInfo{ Matched: 1, Updated: 1, }}}}, }, { Query: "update dolt_rebase set action='fixup' where rebase_order = 6.10;", - Expected: []sql.Row{{gmstypes.OkResult{RowsAffected: uint64(1), Info: plan.UpdateInfo{ + Expected: []sql.UntypedSqlRow{{gmstypes.OkResult{RowsAffected: uint64(1), Info: plan.UpdateInfo{ Matched: 1, Updated: 1, }}}}, }, { Query: "select * from dolt_rebase order by rebase_order ASC;", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {"1", "pick", doltCommit, "inserting row 1"}, {"2", "squash", doltCommit, "inserting row 10"}, {"3", "squash", doltCommit, "inserting row 100"}, @@ -677,7 +677,7 @@ var DoltRebaseScriptTests = []queries.ScriptTest{ }, { Query: "call dolt_rebase('--continue');", - Expected: []sql.Row{{0, "Successfully rebased and updated refs/heads/branch1"}}, + Expected: []sql.UntypedSqlRow{{0, "Successfully rebased and updated refs/heads/branch1"}}, }, { // When rebase completes, rebase status should be cleared @@ -692,12 +692,12 @@ var DoltRebaseScriptTests = []queries.ScriptTest{ { // The working branch for the rebase is deleted after rebasing completes Query: "select name from dolt_branches", - Expected: []sql.Row{{"main"}, {"branch1"}}, + Expected: []sql.UntypedSqlRow{{"main"}, {"branch1"}}, }, { // Assert that the commit history is now composed of different commits Query: "select message from dolt_log order by date desc;", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {"reworded!"}, {"inserting row 1\n\ninserting row 10\n\ninserting row 100"}, {"inserting row 0"}, @@ -706,7 +706,7 @@ var DoltRebaseScriptTests = []queries.ScriptTest{ }, { Query: "select * from t;", - Expected: []sql.Row{{0}, {1}, {10}, {100}, {10000}, {100000}}, + Expected: []sql.UntypedSqlRow{{0}, {1}, {10}, {100}, {10000}, {100000}}, }, }, }, @@ -731,20 +731,20 @@ var DoltRebaseScriptTests = []queries.ScriptTest{ Assertions: []queries.ScriptTestAssertion{ { Query: "call dolt_rebase('-i', 'main');", - Expected: []sql.Row{{0, "interactive rebase started on branch dolt_rebase_branch1; " + + Expected: []sql.UntypedSqlRow{{0, "interactive rebase started on branch dolt_rebase_branch1; " + "adjust the rebase plan in the dolt_rebase table, then " + "continue rebasing by calling dolt_rebase('--continue')"}}, }, { Query: "update dolt_rebase set rebase_order=rebase_order-12.34;", - Expected: []sql.Row{{gmstypes.OkResult{RowsAffected: uint64(3), Info: plan.UpdateInfo{ + Expected: []sql.UntypedSqlRow{{gmstypes.OkResult{RowsAffected: uint64(3), Info: plan.UpdateInfo{ Matched: 3, Updated: 3, }}}}, }, { Query: "select * from dolt_rebase order by rebase_order ASC;", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {"-11.34", "pick", doltCommit, "inserting row 1 on branch1"}, {"-10.34", "pick", doltCommit, "updating row 1 on branch1"}, {"-9.34", "pick", doltCommit, "updating row 1, again, on branch1"}, @@ -752,19 +752,19 @@ var DoltRebaseScriptTests = []queries.ScriptTest{ }, { Query: "call dolt_rebase('--continue');", - Expected: []sql.Row{{0, "Successfully rebased and updated refs/heads/branch1"}}, + Expected: []sql.UntypedSqlRow{{0, "Successfully rebased and updated refs/heads/branch1"}}, }, { Query: "select * from t;", - Expected: []sql.Row{{0, "zero"}, {1, "ein"}}, + Expected: []sql.UntypedSqlRow{{0, "zero"}, {1, "ein"}}, }, { Query: "select active_branch();", - Expected: []sql.Row{{"branch1"}}, + Expected: []sql.UntypedSqlRow{{"branch1"}}, }, { Query: "select message from dolt_log;", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {"updating row 1, again, on branch1"}, {"updating row 1 on branch1"}, {"inserting row 1 on branch1"}, @@ -798,13 +798,13 @@ var DoltRebaseScriptTests = []queries.ScriptTest{ Assertions: []queries.ScriptTestAssertion{ { Query: "call dolt_rebase('-i', 'main');", - Expected: []sql.Row{{0, "interactive rebase started on branch dolt_rebase_branch1; " + + Expected: []sql.UntypedSqlRow{{0, "interactive rebase started on branch dolt_rebase_branch1; " + "adjust the rebase plan in the dolt_rebase table, then " + "continue rebasing by calling dolt_rebase('--continue')"}}, }, { Query: "select * from dolt_rebase order by rebase_order ASC;", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {"1", "pick", doltCommit, "inserting row 1 on branch1"}, {"2", "pick", doltCommit, "updating row 1 on branch1"}, {"3", "pick", doltCommit, "updating row 1, again, on branch1"}, @@ -812,7 +812,7 @@ var DoltRebaseScriptTests = []queries.ScriptTest{ }, { Query: "update dolt_rebase set rebase_order=3.5 where rebase_order=1;", - Expected: []sql.Row{{gmstypes.OkResult{RowsAffected: uint64(1), Info: plan.UpdateInfo{ + Expected: []sql.UntypedSqlRow{{gmstypes.OkResult{RowsAffected: uint64(1), Info: plan.UpdateInfo{ Matched: 1, Updated: 1, }}}}, @@ -824,25 +824,25 @@ var DoltRebaseScriptTests = []queries.ScriptTest{ { // We remain on the rebase working branch while resolving conflicts Query: "select active_branch();", - Expected: []sql.Row{{"dolt_rebase_branch1"}}, + Expected: []sql.UntypedSqlRow{{"dolt_rebase_branch1"}}, }, { Query: "select * from dolt_conflicts;", - Expected: []sql.Row{{"t", uint64(1)}}, + Expected: []sql.UntypedSqlRow{{"t", uint64(1)}}, }, { // The base of the cherry-picked commit has (1, "one"), but ours doesn't have that record (nil, nil) // since we reordered the insert. The cherry-picked commit is trying to modify the row to (1, "uno"). Query: "select base_pk, base_c1, our_pk, our_c1, our_diff_type, their_pk, their_c1, their_diff_type from dolt_conflicts_t;", - Expected: []sql.Row{{1, "one", nil, nil, "removed", 1, "uno", "modified"}}, + Expected: []sql.UntypedSqlRow{{1, "one", nil, nil, "removed", 1, "uno", "modified"}}, }, { Query: "select active_branch();", - Expected: []sql.Row{{"dolt_rebase_branch1"}}, + Expected: []sql.UntypedSqlRow{{"dolt_rebase_branch1"}}, }, { Query: "select message from dolt_log;", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {"inserting row 0 on main"}, {"creating table t"}, {"Initialize data repository"}, @@ -852,12 +852,12 @@ var DoltRebaseScriptTests = []queries.ScriptTest{ // Resolve conflicts, by accepting theirs, which inserts (1, "uno") into t // When we continue the rebase, a Dolt commit will be created for these changes Query: "CALL DOLT_CONFLICTS_RESOLVE('--theirs', 't');", - Expected: []sql.Row{{0}}, + Expected: []sql.UntypedSqlRow{{0}}, }, { // Our new commit shows up as the first commit on top of the latest commit from the upstream branch Query: "select message from dolt_log;", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {"inserting row 0 on main"}, {"creating table t"}, {"Initialize data repository"}, @@ -866,7 +866,7 @@ var DoltRebaseScriptTests = []queries.ScriptTest{ { // Table t includes the change from the tip of main (0, "zero"), as well as the conflict we just resolved Query: "SELECT * FROM t;", - Expected: []sql.Row{{0, "zero"}, {1, "uno"}}, + Expected: []sql.UntypedSqlRow{{0, "zero"}, {1, "uno"}}, }, { // If we don't stage the table, then rebase will give us an error about having unstaged changes @@ -875,7 +875,7 @@ var DoltRebaseScriptTests = []queries.ScriptTest{ }, { Query: "call dolt_add('t');", - Expected: []sql.Row{{0}}, + Expected: []sql.UntypedSqlRow{{0}}, }, { Query: "call dolt_rebase('--continue');", @@ -883,15 +883,15 @@ var DoltRebaseScriptTests = []queries.ScriptTest{ }, { Query: "select * from t;", - Expected: []sql.Row{{0, "zero"}, {1, "ein"}}, + Expected: []sql.UntypedSqlRow{{0, "zero"}, {1, "ein"}}, }, { Query: "select active_branch();", - Expected: []sql.Row{{"dolt_rebase_branch1"}}, + Expected: []sql.UntypedSqlRow{{"dolt_rebase_branch1"}}, }, { Query: "select message from dolt_log;", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {"updating row 1, again, on branch1"}, {"updating row 1 on branch1"}, {"inserting row 0 on main"}, @@ -903,33 +903,33 @@ var DoltRebaseScriptTests = []queries.ScriptTest{ // Now we're resolving a conflict from reordering the insert of (1, "one"). This was originally // an insert, so the base has (nil, nil), ours is (1, "ein"). Query: "select base_pk, base_c1, our_pk, our_c1, our_diff_type, their_pk, their_c1, their_diff_type from dolt_conflicts_t;", - Expected: []sql.Row{{nil, nil, 1, "ein", "added", 1, "one", "added"}}, + Expected: []sql.UntypedSqlRow{{nil, nil, 1, "ein", "added", 1, "one", "added"}}, }, { // Accept the new values from the cherry-picked commit (1, "ein"). Query: "CALL DOLT_CONFLICTS_RESOLVE('--theirs', 't');", - Expected: []sql.Row{{0}}, + Expected: []sql.UntypedSqlRow{{0}}, }, { // We can commit manually, or we can continue the rebase and let it commit for us Query: "CALL DOLT_COMMIT('-am', 'OVERRIDDEN COMMIT MESSAGE');", - Expected: []sql.Row{{doltCommit}}, + Expected: []sql.UntypedSqlRow{{doltCommit}}, }, { Query: "call dolt_rebase('--continue');", - Expected: []sql.Row{{0, "Successfully rebased and updated refs/heads/branch1"}}, + Expected: []sql.UntypedSqlRow{{0, "Successfully rebased and updated refs/heads/branch1"}}, }, { Query: "select * from t;", - Expected: []sql.Row{{0, "zero"}, {1, "one"}}, + Expected: []sql.UntypedSqlRow{{0, "zero"}, {1, "one"}}, }, { Query: "select active_branch();", - Expected: []sql.Row{{"branch1"}}, + Expected: []sql.UntypedSqlRow{{"branch1"}}, }, { Query: "select message from dolt_log;", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {"OVERRIDDEN COMMIT MESSAGE"}, {"updating row 1, again, on branch1"}, {"updating row 1 on branch1"}, @@ -963,13 +963,13 @@ var DoltRebaseScriptTests = []queries.ScriptTest{ Assertions: []queries.ScriptTestAssertion{ { Query: "call dolt_rebase('-i', 'main');", - Expected: []sql.Row{{0, "interactive rebase started on branch dolt_rebase_branch1; " + + Expected: []sql.UntypedSqlRow{{0, "interactive rebase started on branch dolt_rebase_branch1; " + "adjust the rebase plan in the dolt_rebase table, then " + "continue rebasing by calling dolt_rebase('--continue')"}}, }, { Query: "select * from dolt_rebase order by rebase_order ASC;", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {"1", "pick", doltCommit, "inserting row 1 on branch1"}, {"2", "pick", doltCommit, "updating row 1 on branch1"}, {"3", "pick", doltCommit, "updating row 1, again, on branch1"}, @@ -977,14 +977,14 @@ var DoltRebaseScriptTests = []queries.ScriptTest{ }, { Query: "update dolt_rebase set rebase_order=3.5 where rebase_order=2;", - Expected: []sql.Row{{gmstypes.OkResult{RowsAffected: uint64(1), Info: plan.UpdateInfo{ + Expected: []sql.UntypedSqlRow{{gmstypes.OkResult{RowsAffected: uint64(1), Info: plan.UpdateInfo{ Matched: 1, Updated: 1, }}}}, }, { Query: "update dolt_rebase set action='squash' where rebase_order=3;", - Expected: []sql.Row{{gmstypes.OkResult{RowsAffected: uint64(1), Info: plan.UpdateInfo{ + Expected: []sql.UntypedSqlRow{{gmstypes.OkResult{RowsAffected: uint64(1), Info: plan.UpdateInfo{ Matched: 1, Updated: 1, }}}}, @@ -996,21 +996,21 @@ var DoltRebaseScriptTests = []queries.ScriptTest{ { // We remain on the rebase working branch while resolving conflicts Query: "select active_branch();", - Expected: []sql.Row{{"dolt_rebase_branch1"}}, + Expected: []sql.UntypedSqlRow{{"dolt_rebase_branch1"}}, }, { Query: "select * from dolt_conflicts;", - Expected: []sql.Row{{"t", uint64(1)}}, + Expected: []sql.UntypedSqlRow{{"t", uint64(1)}}, }, { // The base of the cherry-picked commit has (1, "uno"), but ours has (1, "one"), so this is a data // conflict. The cherry-picked commit is trying to modify the row to (1, "ein"). Query: "select base_pk, base_c1, our_pk, our_c1, our_diff_type, their_pk, their_c1, their_diff_type from dolt_conflicts_t;", - Expected: []sql.Row{{1, "uno", 1, "one", "modified", 1, "ein", "modified"}}, + Expected: []sql.UntypedSqlRow{{1, "uno", 1, "one", "modified", 1, "ein", "modified"}}, }, { Query: "select message from dolt_log;", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {"inserting row 1 on branch1"}, {"inserting row 0 on main"}, {"creating table t"}, @@ -1021,12 +1021,12 @@ var DoltRebaseScriptTests = []queries.ScriptTest{ // Resolve conflicts, by accepting theirs, which inserts (1, "ein") into t // When we continue the rebase, a Dolt commit will be created for these changes Query: "CALL DOLT_CONFLICTS_RESOLVE('--theirs', 't');", - Expected: []sql.Row{{0}}, + Expected: []sql.UntypedSqlRow{{0}}, }, { // Table t includes the change from the tip of main (0, "zero"), as well as the conflict we just resolved Query: "SELECT * FROM t;", - Expected: []sql.Row{{0, "zero"}, {1, "ein"}}, + Expected: []sql.UntypedSqlRow{{0, "zero"}, {1, "ein"}}, }, { // If we don't stage the table, then rebase will give us an error about having unstaged changes @@ -1035,7 +1035,7 @@ var DoltRebaseScriptTests = []queries.ScriptTest{ }, { Query: "call dolt_add('t');", - Expected: []sql.Row{{0}}, + Expected: []sql.UntypedSqlRow{{0}}, }, { Query: "call dolt_rebase('--continue');", @@ -1043,15 +1043,15 @@ var DoltRebaseScriptTests = []queries.ScriptTest{ }, { Query: "select * from t;", - Expected: []sql.Row{{0, "zero"}, {1, "ein"}}, + Expected: []sql.UntypedSqlRow{{0, "zero"}, {1, "ein"}}, }, { Query: "select active_branch();", - Expected: []sql.Row{{"dolt_rebase_branch1"}}, + Expected: []sql.UntypedSqlRow{{"dolt_rebase_branch1"}}, }, { Query: "select message from dolt_log;", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {"inserting row 1 on branch1\n\nupdating row 1, again, on branch1"}, {"inserting row 0 on main"}, {"creating table t"}, @@ -1062,32 +1062,32 @@ var DoltRebaseScriptTests = []queries.ScriptTest{ // Now we're resolving a conflict from updating (1, "one") to (1, "uno"). Our side currently has // (1, "ein"), so this is marked as a conflict. Query: "select base_pk, base_c1, our_pk, our_c1, our_diff_type, their_pk, their_c1, their_diff_type from dolt_conflicts_t;", - Expected: []sql.Row{{1, "one", 1, "ein", "modified", 1, "uno", "modified"}}, + Expected: []sql.UntypedSqlRow{{1, "one", 1, "ein", "modified", 1, "uno", "modified"}}, }, { // Accept the new values from the cherry-picked commit (1, "uno"). Query: "CALL DOLT_CONFLICTS_RESOLVE('--theirs', 't');", - Expected: []sql.Row{{0}}, + Expected: []sql.UntypedSqlRow{{0}}, }, { Query: "CALL DOLT_COMMIT('-am', 'OVERRIDDEN COMMIT MESSAGE');", - Expected: []sql.Row{{doltCommit}}, + Expected: []sql.UntypedSqlRow{{doltCommit}}, }, { Query: "call dolt_rebase('--continue');", - Expected: []sql.Row{{0, "Successfully rebased and updated refs/heads/branch1"}}, + Expected: []sql.UntypedSqlRow{{0, "Successfully rebased and updated refs/heads/branch1"}}, }, { Query: "select * from t;", - Expected: []sql.Row{{0, "zero"}, {1, "uno"}}, + Expected: []sql.UntypedSqlRow{{0, "zero"}, {1, "uno"}}, }, { Query: "select active_branch();", - Expected: []sql.Row{{"branch1"}}, + Expected: []sql.UntypedSqlRow{{"branch1"}}, }, { Query: "select message from dolt_log;", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {"OVERRIDDEN COMMIT MESSAGE"}, {"inserting row 1 on branch1\n\nupdating row 1, again, on branch1"}, {"inserting row 0 on main"}, @@ -1121,13 +1121,13 @@ var DoltRebaseScriptTests = []queries.ScriptTest{ Assertions: []queries.ScriptTestAssertion{ { Query: "call dolt_rebase('-i', 'main');", - Expected: []sql.Row{{0, "interactive rebase started on branch dolt_rebase_branch1; " + + Expected: []sql.UntypedSqlRow{{0, "interactive rebase started on branch dolt_rebase_branch1; " + "adjust the rebase plan in the dolt_rebase table, then " + "continue rebasing by calling dolt_rebase('--continue')"}}, }, { Query: "select * from dolt_rebase order by rebase_order ASC;", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {"1", "pick", doltCommit, "updating row -1 on branch1"}, {"2", "pick", doltCommit, "deleting -1 on branch1"}, {"3", "pick", doltCommit, "inserting row 999 on branch1"}, @@ -1135,14 +1135,14 @@ var DoltRebaseScriptTests = []queries.ScriptTest{ }, { Query: "update dolt_rebase set rebase_order=3.5, action='fixup' where rebase_order=1;", - Expected: []sql.Row{{gmstypes.OkResult{RowsAffected: uint64(1), Info: plan.UpdateInfo{ + Expected: []sql.UntypedSqlRow{{gmstypes.OkResult{RowsAffected: uint64(1), Info: plan.UpdateInfo{ Matched: 1, Updated: 1, }}}}, }, { Query: "select * from dolt_rebase order by rebase_order ASC;", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {"2", "pick", doltCommit, "deleting -1 on branch1"}, {"3", "pick", doltCommit, "inserting row 999 on branch1"}, {"3.50", "fixup", doltCommit, "updating row -1 on branch1"}, @@ -1155,21 +1155,21 @@ var DoltRebaseScriptTests = []queries.ScriptTest{ { // We remain on the rebase working branch while resolving conflicts Query: "select active_branch();", - Expected: []sql.Row{{"dolt_rebase_branch1"}}, + Expected: []sql.UntypedSqlRow{{"dolt_rebase_branch1"}}, }, { Query: "select * from dolt_conflicts;", - Expected: []sql.Row{{"t", uint64(1)}}, + Expected: []sql.UntypedSqlRow{{"t", uint64(1)}}, }, { // The base of the cherry-picked commit has (-1, "-1"), but ours has (-1, "negative"), so this is a // data conflict. The cherry-picked commit is trying to delete the row, but can't find an exact match. Query: "select base_pk, base_c1, our_pk, our_c1, our_diff_type, their_pk, their_c1, their_diff_type from dolt_conflicts_t;", - Expected: []sql.Row{{-1, "-1", -1, "negative", "modified", nil, nil, "removed"}}, + Expected: []sql.UntypedSqlRow{{-1, "-1", -1, "negative", "modified", nil, nil, "removed"}}, }, { Query: "select message from dolt_log;", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {"inserting row 0 on main"}, {"creating table t"}, {"Initialize data repository"}, @@ -1179,11 +1179,11 @@ var DoltRebaseScriptTests = []queries.ScriptTest{ // Resolve conflicts, by accepting theirs, which inserts (1, "ein") into t // When we continue the rebase, a Dolt commit will be created for these changes Query: "CALL DOLT_CONFLICTS_RESOLVE('--theirs', 't');", - Expected: []sql.Row{{0}}, + Expected: []sql.UntypedSqlRow{{0}}, }, { Query: "SELECT * FROM t;", - Expected: []sql.Row{{0, "zero"}}, + Expected: []sql.UntypedSqlRow{{0, "zero"}}, }, { // If we don't stage the table, then rebase will give us an error about having unstaged changes @@ -1192,7 +1192,7 @@ var DoltRebaseScriptTests = []queries.ScriptTest{ }, { Query: "call dolt_add('t');", - Expected: []sql.Row{{0}}, + Expected: []sql.UntypedSqlRow{{0}}, }, { Query: "call dolt_rebase('--continue');", @@ -1200,15 +1200,15 @@ var DoltRebaseScriptTests = []queries.ScriptTest{ }, { Query: "select * from t;", - Expected: []sql.Row{{0, "zero"}, {999, "nines"}}, + Expected: []sql.UntypedSqlRow{{0, "zero"}, {999, "nines"}}, }, { Query: "select active_branch();", - Expected: []sql.Row{{"dolt_rebase_branch1"}}, + Expected: []sql.UntypedSqlRow{{"dolt_rebase_branch1"}}, }, { Query: "select message from dolt_log;", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {"inserting row 999 on branch1"}, {"deleting -1 on branch1"}, {"inserting row 0 on main"}, @@ -1219,32 +1219,32 @@ var DoltRebaseScriptTests = []queries.ScriptTest{ { // Now we're resolving a conflict where row -1 is updated, but it has already been deleted Query: "select base_pk, base_c1, our_pk, our_c1, our_diff_type, their_pk, their_c1, their_diff_type from dolt_conflicts_t;", - Expected: []sql.Row{{-1, "negative", nil, nil, "removed", -1, "-1", "modified"}}, + Expected: []sql.UntypedSqlRow{{-1, "negative", nil, nil, "removed", -1, "-1", "modified"}}, }, { // Accept the new values from the cherry-picked commit (1, "uno"). Query: "CALL DOLT_CONFLICTS_RESOLVE('--theirs', 't');", - Expected: []sql.Row{{0}}, + Expected: []sql.UntypedSqlRow{{0}}, }, { Query: "call dolt_add('t');", - Expected: []sql.Row{{0}}, + Expected: []sql.UntypedSqlRow{{0}}, }, { Query: "call dolt_rebase('--continue');", - Expected: []sql.Row{{0, "Successfully rebased and updated refs/heads/branch1"}}, + Expected: []sql.UntypedSqlRow{{0, "Successfully rebased and updated refs/heads/branch1"}}, }, { Query: "select * from t;", - Expected: []sql.Row{{-1, "-1"}, {0, "zero"}, {999, "nines"}}, + Expected: []sql.UntypedSqlRow{{-1, "-1"}, {0, "zero"}, {999, "nines"}}, }, { Query: "select active_branch();", - Expected: []sql.Row{{"branch1"}}, + Expected: []sql.UntypedSqlRow{{"branch1"}}, }, { Query: "select message from dolt_log;", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {"inserting row 999 on branch1"}, {"deleting -1 on branch1"}, {"inserting row 0 on main"}, @@ -1277,13 +1277,13 @@ var DoltRebaseScriptTests = []queries.ScriptTest{ Assertions: []queries.ScriptTestAssertion{ { Query: "call dolt_rebase('-i', 'main');", - Expected: []sql.Row{{0, "interactive rebase started on branch dolt_rebase_branch1; " + + Expected: []sql.UntypedSqlRow{{0, "interactive rebase started on branch dolt_rebase_branch1; " + "adjust the rebase plan in the dolt_rebase table, then " + "continue rebasing by calling dolt_rebase('--continue')"}}, }, { Query: "select * from dolt_rebase order by rebase_order ASC;", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {"1", "pick", doltCommit, "updating row -1 on branch1"}, {"2", "pick", doltCommit, "deleting -1 on branch1"}, {"3", "pick", doltCommit, "inserting row 999 on branch1"}, @@ -1291,14 +1291,14 @@ var DoltRebaseScriptTests = []queries.ScriptTest{ }, { Query: "update dolt_rebase set rebase_order=3.5, action='reword', commit_message='reworded message!' where rebase_order=1;", - Expected: []sql.Row{{gmstypes.OkResult{RowsAffected: uint64(1), Info: plan.UpdateInfo{ + Expected: []sql.UntypedSqlRow{{gmstypes.OkResult{RowsAffected: uint64(1), Info: plan.UpdateInfo{ Matched: 1, Updated: 1, }}}}, }, { Query: "select * from dolt_rebase order by rebase_order ASC;", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {"2", "pick", doltCommit, "deleting -1 on branch1"}, {"3", "pick", doltCommit, "inserting row 999 on branch1"}, {"3.50", "reword", doltCommit, "reworded message!"}, @@ -1311,21 +1311,21 @@ var DoltRebaseScriptTests = []queries.ScriptTest{ { // We remain on the rebase working branch while resolving conflicts Query: "select active_branch();", - Expected: []sql.Row{{"dolt_rebase_branch1"}}, + Expected: []sql.UntypedSqlRow{{"dolt_rebase_branch1"}}, }, { Query: "select * from dolt_conflicts;", - Expected: []sql.Row{{"t", uint64(1)}}, + Expected: []sql.UntypedSqlRow{{"t", uint64(1)}}, }, { // The base of the cherry-picked commit has (-1, "-1"), but ours has (-1, "negative"), so this is a // data conflict. The cherry-picked commit is trying to delete the row, but can't find an exact match. Query: "select base_pk, base_c1, our_pk, our_c1, our_diff_type, their_pk, their_c1, their_diff_type from dolt_conflicts_t;", - Expected: []sql.Row{{-1, "-1", -1, "negative", "modified", nil, nil, "removed"}}, + Expected: []sql.UntypedSqlRow{{-1, "-1", -1, "negative", "modified", nil, nil, "removed"}}, }, { Query: "select message from dolt_log;", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {"inserting row 0 on main"}, {"creating table t"}, {"Initialize data repository"}, @@ -1335,11 +1335,11 @@ var DoltRebaseScriptTests = []queries.ScriptTest{ // Resolve conflicts, by accepting theirs, which inserts (1, "ein") into t // When we continue the rebase, a Dolt commit will be created for these changes Query: "CALL DOLT_CONFLICTS_RESOLVE('--theirs', 't');", - Expected: []sql.Row{{0}}, + Expected: []sql.UntypedSqlRow{{0}}, }, { Query: "SELECT * FROM t;", - Expected: []sql.Row{{0, "zero"}}, + Expected: []sql.UntypedSqlRow{{0, "zero"}}, }, { // If we don't stage the table, then rebase will give us an error about having unstaged changes @@ -1348,7 +1348,7 @@ var DoltRebaseScriptTests = []queries.ScriptTest{ }, { Query: "call dolt_add('t');", - Expected: []sql.Row{{0}}, + Expected: []sql.UntypedSqlRow{{0}}, }, { Query: "call dolt_rebase('--continue');", @@ -1356,11 +1356,11 @@ var DoltRebaseScriptTests = []queries.ScriptTest{ }, { Query: "select * from t;", - Expected: []sql.Row{{0, "zero"}, {999, "nines"}}, + Expected: []sql.UntypedSqlRow{{0, "zero"}, {999, "nines"}}, }, { Query: "select message from dolt_log;", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {"inserting row 999 on branch1"}, {"deleting -1 on branch1"}, {"inserting row 0 on main"}, @@ -1371,32 +1371,32 @@ var DoltRebaseScriptTests = []queries.ScriptTest{ { // Now we're resolving a conflict where row -1 is updated, but it has already been deleted Query: "select base_pk, base_c1, our_pk, our_c1, our_diff_type, their_pk, their_c1, their_diff_type from dolt_conflicts_t;", - Expected: []sql.Row{{-1, "negative", nil, nil, "removed", -1, "-1", "modified"}}, + Expected: []sql.UntypedSqlRow{{-1, "negative", nil, nil, "removed", -1, "-1", "modified"}}, }, { // Accept the new values from the cherry-picked commit (-1, "-1") Query: "CALL DOLT_CONFLICTS_RESOLVE('--theirs', 't');", - Expected: []sql.Row{{0}}, + Expected: []sql.UntypedSqlRow{{0}}, }, { Query: "call dolt_add('t');", - Expected: []sql.Row{{0}}, + Expected: []sql.UntypedSqlRow{{0}}, }, { Query: "call dolt_rebase('--continue');", - Expected: []sql.Row{{0, "Successfully rebased and updated refs/heads/branch1"}}, + Expected: []sql.UntypedSqlRow{{0, "Successfully rebased and updated refs/heads/branch1"}}, }, { Query: "select * from t;", - Expected: []sql.Row{{-1, "-1"}, {0, "zero"}, {999, "nines"}}, + Expected: []sql.UntypedSqlRow{{-1, "-1"}, {0, "zero"}, {999, "nines"}}, }, { Query: "select active_branch();", - Expected: []sql.Row{{"branch1"}}, + Expected: []sql.UntypedSqlRow{{"branch1"}}, }, { Query: "select message from dolt_log;", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {"reworded message!"}, {"inserting row 999 on branch1"}, {"deleting -1 on branch1"}, @@ -1428,13 +1428,13 @@ var DoltRebaseScriptTests = []queries.ScriptTest{ Assertions: []queries.ScriptTestAssertion{ { Query: "call dolt_rebase('-i', 'main');", - Expected: []sql.Row{{0, "interactive rebase started on branch dolt_rebase_branch1; " + + Expected: []sql.UntypedSqlRow{{0, "interactive rebase started on branch dolt_rebase_branch1; " + "adjust the rebase plan in the dolt_rebase table, then " + "continue rebasing by calling dolt_rebase('--continue')"}}, }, { Query: "select * from dolt_rebase order by rebase_order ASC;", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {"1", "pick", doltCommit, "inserting row 1"}, {"2", "pick", doltCommit, "adding column c1"}, {"3", "pick", doltCommit, "altering column c1"}, @@ -1442,7 +1442,7 @@ var DoltRebaseScriptTests = []queries.ScriptTest{ }, { Query: "update dolt_rebase set rebase_order=3.1 where rebase_order=2;", - Expected: []sql.Row{{gmstypes.OkResult{RowsAffected: uint64(1), Info: plan.UpdateInfo{ + Expected: []sql.UntypedSqlRow{{gmstypes.OkResult{RowsAffected: uint64(1), Info: plan.UpdateInfo{ Matched: 1, Updated: 1, }}}}, @@ -1460,12 +1460,12 @@ var DoltRebaseScriptTests = []queries.ScriptTest{ { // We're back to the original branch Query: "select active_branch();", - Expected: []sql.Row{{"branch1"}}, + Expected: []sql.UntypedSqlRow{{"branch1"}}, }, { // The schema conflicts table should be empty, since the rebase was aborted Query: "select * from dolt_schema_conflicts;", - Expected: []sql.Row{}, + Expected: []sql.UntypedSqlRow{}, }, }, }, @@ -1497,21 +1497,21 @@ var DoltRebaseScriptTests = []queries.ScriptTest{ Assertions: []queries.ScriptTestAssertion{ { Query: "select active_branch();", - Expected: []sql.Row{{"branch1"}}, + Expected: []sql.UntypedSqlRow{{"branch1"}}, }, { Query: "select * from t;", - Expected: []sql.Row{{1}, {2}, {3}}, + Expected: []sql.UntypedSqlRow{{1}, {2}, {3}}, }, { Query: "call dolt_rebase('-i', 'main');", - Expected: []sql.Row{{0, "interactive rebase started on branch dolt_rebase_branch1; " + + Expected: []sql.UntypedSqlRow{{0, "interactive rebase started on branch dolt_rebase_branch1; " + "adjust the rebase plan in the dolt_rebase table, then " + "continue rebasing by calling dolt_rebase('--continue')"}}, }, { Query: "select * from dolt_rebase order by rebase_order;", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {"1", "pick", doltCommit, "inserting row 1"}, {"2", "pick", doltCommit, "inserting row 2"}, {"3", "pick", doltCommit, "inserting row 3"}, @@ -1519,21 +1519,21 @@ var DoltRebaseScriptTests = []queries.ScriptTest{ }, { Query: "delete from dolt_rebase where rebase_order > 1;", - Expected: []sql.Row{{gmstypes.NewOkResult(2)}}, + Expected: []sql.UntypedSqlRow{{gmstypes.NewOkResult(2)}}, }, { // NOTE: This uses "pick", not reword, so we expect the commit message from the commit to be // used, and not the custom commit message inserted into the table. Query: "insert into dolt_rebase values (2.12, 'pick', hashof('branch2'), 'inserting row 0');", - Expected: []sql.Row{{gmstypes.NewOkResult(1)}}, + Expected: []sql.UntypedSqlRow{{gmstypes.NewOkResult(1)}}, }, { Query: "call dolt_rebase('--continue');", - Expected: []sql.Row{{0, "Successfully rebased and updated refs/heads/branch1"}}, + Expected: []sql.UntypedSqlRow{{0, "Successfully rebased and updated refs/heads/branch1"}}, }, { Query: "select message from dolt_log;", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {"inserting row 999"}, {"inserting row 1"}, {"inserting row 0"}, @@ -1543,7 +1543,7 @@ var DoltRebaseScriptTests = []queries.ScriptTest{ }, { Query: "select * from t;", - Expected: []sql.Row{{0}, {1}, {999}}, + Expected: []sql.UntypedSqlRow{{0}, {1}, {999}}, }, }, }, @@ -1570,7 +1570,7 @@ var DoltRebaseScriptTests = []queries.ScriptTest{ Assertions: []queries.ScriptTestAssertion{ { Query: "select message from dolt_log;", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {"inserting row 3"}, {"Merge branch 'main' into branch1"}, {"inserting row 2"}, @@ -1582,13 +1582,13 @@ var DoltRebaseScriptTests = []queries.ScriptTest{ }, { Query: "call dolt_rebase('-i', 'main');", - Expected: []sql.Row{{0, "interactive rebase started on branch dolt_rebase_branch1; " + + Expected: []sql.UntypedSqlRow{{0, "interactive rebase started on branch dolt_rebase_branch1; " + "adjust the rebase plan in the dolt_rebase table, then " + "continue rebasing by calling dolt_rebase('--continue')"}}, }, { Query: "select * from dolt_rebase order by rebase_order;", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {"1", "pick", doltCommit, "inserting row 1"}, {"2", "pick", doltCommit, "inserting row 2"}, {"3", "pick", doltCommit, "inserting row 3"}, @@ -1596,11 +1596,11 @@ var DoltRebaseScriptTests = []queries.ScriptTest{ }, { Query: "call dolt_rebase('--continue');", - Expected: []sql.Row{{0, "Successfully rebased and updated refs/heads/branch1"}}, + Expected: []sql.UntypedSqlRow{{0, "Successfully rebased and updated refs/heads/branch1"}}, }, { Query: "select message from dolt_log;", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {"inserting row 3"}, {"inserting row 2"}, {"inserting row 1"}, @@ -1631,25 +1631,25 @@ var DoltRebaseMultiSessionScriptTests = []queries.ScriptTest{ Assertions: []queries.ScriptTestAssertion{ { Query: "/* client a */ select active_branch();", - Expected: []sql.Row{{"branch1"}}, + Expected: []sql.UntypedSqlRow{{"branch1"}}, }, { Query: "/* client b */ call dolt_checkout('branch1');", - Expected: []sql.Row{{0, "Switched to branch 'branch1'"}}, + Expected: []sql.UntypedSqlRow{{0, "Switched to branch 'branch1'"}}, }, { Query: "/* client b */ select active_branch();", - Expected: []sql.Row{{"branch1"}}, + Expected: []sql.UntypedSqlRow{{"branch1"}}, }, { Query: "/* client a */ call dolt_rebase('-i', 'main');", - Expected: []sql.Row{{0, "interactive rebase started on branch dolt_rebase_branch1; " + + Expected: []sql.UntypedSqlRow{{0, "interactive rebase started on branch dolt_rebase_branch1; " + "adjust the rebase plan in the dolt_rebase table, then " + "continue rebasing by calling dolt_rebase('--continue')"}}, }, { Query: "/* client b */ insert into t values (1000);", - Expected: []sql.Row{}, + Expected: []sql.UntypedSqlRow{}, }, { Query: "/* client b */ call dolt_commit('-am', 'inserting row 1000');", diff --git a/go/libraries/doltcore/sqle/enginetest/dolt_queries_revert.go b/go/libraries/doltcore/sqle/enginetest/dolt_queries_revert.go index f416f69e03c..d1391f30497 100644 --- a/go/libraries/doltcore/sqle/enginetest/dolt_queries_revert.go +++ b/go/libraries/doltcore/sqle/enginetest/dolt_queries_revert.go @@ -34,11 +34,11 @@ var RevertScripts = []queries.ScriptTest{ Assertions: []queries.ScriptTestAssertion{ { Query: "select * from test as of 'HEAD' where pk = 2;", - Expected: []sql.Row{{2, 2}}, + Expected: []sql.UntypedSqlRow{{2, 2}}, }, { Query: "select * from test as of 'HEAD~1' where pk = 2;", - Expected: []sql.Row{{2, 42}}, + Expected: []sql.UntypedSqlRow{{2, 42}}, }, }, }, @@ -58,15 +58,15 @@ var RevertScripts = []queries.ScriptTest{ Assertions: []queries.ScriptTestAssertion{ { Query: "select * from test as of 'HEAD' where pk = 2;", - Expected: []sql.Row{{2, 2}}, + Expected: []sql.UntypedSqlRow{{2, 2}}, }, { Query: "select * from test as of 'HEAD~2' where pk = 2;", - Expected: []sql.Row{{2, 42}}, + Expected: []sql.UntypedSqlRow{{2, 42}}, }, { Query: "select * from test as of 'HEAD' where pk = 3;", - Expected: []sql.Row{{3, 23}}, + Expected: []sql.UntypedSqlRow{{3, 23}}, }, }, }, @@ -123,11 +123,11 @@ var RevertScripts = []queries.ScriptTest{ Assertions: []queries.ScriptTestAssertion{ { Query: "select * from test as of 'HEAD' where pk = 2;", - Expected: []sql.Row{{2, 2}}, + Expected: []sql.UntypedSqlRow{{2, 2}}, }, { Query: "select * from test as of 'HEAD~1' where pk = 2;", - Expected: []sql.Row{{2, 42}}, + Expected: []sql.UntypedSqlRow{{2, 42}}, }, { Query: "select * from dont_track as of 'HEAD'", @@ -135,7 +135,7 @@ var RevertScripts = []queries.ScriptTest{ }, { Query: "select * from dolt_status", - Expected: []sql.Row{{"dont_track", false, "new table"}}, + Expected: []sql.UntypedSqlRow{{"dont_track", false, "new table"}}, }, }, }, @@ -175,7 +175,7 @@ var RevertScripts = []queries.ScriptTest{ Assertions: []queries.ScriptTestAssertion{ { Query: "select * from tableA", - Expected: []sql.Row{}, + Expected: []sql.UntypedSqlRow{}, }, }, }, diff --git a/go/libraries/doltcore/sqle/enginetest/dolt_queries_schema_merge.go b/go/libraries/doltcore/sqle/enginetest/dolt_queries_schema_merge.go index b213935282b..7a2249afc00 100644 --- a/go/libraries/doltcore/sqle/enginetest/dolt_queries_schema_merge.go +++ b/go/libraries/doltcore/sqle/enginetest/dolt_queries_schema_merge.go @@ -43,17 +43,17 @@ var SchemaChangeTestsForDataConflicts = []MergeScriptTest{ Assertions: []queries.ScriptTestAssertion{ { Query: "call dolt_merge('right');", - Expected: []sql.Row{{"", 0, 1, "conflicts found"}}, + Expected: []sql.UntypedSqlRow{{"", 0, 1, "conflicts found"}}, }, { Query: "select * from dolt_conflicts;", - Expected: []sql.Row{{"t", uint(1)}}, + Expected: []sql.UntypedSqlRow{{"t", uint(1)}}, }, { Query: "select base_pk, base_col1, base_col2, base_col3, base_col4, " + "our_pk, our_col1, our_col2, our_col4, " + "their_pk, their_col1, their_col2, their_col4 from dolt_conflicts_t;", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ { 1, 10, "100", "1", "11", 1, -1000, "100", "11", @@ -63,11 +63,11 @@ var SchemaChangeTestsForDataConflicts = []MergeScriptTest{ }, { Query: "update dolt_conflicts_t set our_col1 = their_col1, their_col2 = our_col2;", - Expected: []sql.Row{{types.OkResult{RowsAffected: 1, InsertID: 0, Info: plan.UpdateInfo{Matched: 1, Updated: 1, Warnings: 0}}}}, + Expected: []sql.UntypedSqlRow{{types.OkResult{RowsAffected: 1, InsertID: 0, Info: plan.UpdateInfo{Matched: 1, Updated: 1, Warnings: 0}}}}, }, { Query: "select * from t;", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {1, -100, "100", "11"}, {2, 20, "200", "22"}, }, @@ -98,11 +98,11 @@ var SchemaChangeTestsBasicCases = []MergeScriptTest{ Assertions: []queries.ScriptTestAssertion{ { Query: "call dolt_merge('right');", - Expected: []sql.Row{{doltCommit, 0, 0, "merge successful"}}, + Expected: []sql.UntypedSqlRow{{doltCommit, 0, 0, "merge successful"}}, }, { Query: "select pk, col2 from t;", - Expected: []sql.Row{{1, "100"}, {2, "200"}, {3, "300"}, {4, "400"}, {5, "500"}, {6, "600"}}, + Expected: []sql.UntypedSqlRow{{1, "100"}, {2, "200"}, {3, "300"}, {4, "400"}, {5, "500"}, {6, "600"}}, }, }, }, @@ -126,11 +126,11 @@ var SchemaChangeTestsBasicCases = []MergeScriptTest{ Assertions: []queries.ScriptTestAssertion{ { Query: "call dolt_merge('right');", - Expected: []sql.Row{{doltCommit, 0, 0, "merge successful"}}, + Expected: []sql.UntypedSqlRow{{doltCommit, 0, 0, "merge successful"}}, }, { Query: "select * from t;", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {1, 10, "100"}, {2, 20, "200"}, {3, 30, "300"}, {4, 40, "400"}, {5, 50, "500"}, {6, 60, "600"}, @@ -161,11 +161,11 @@ var SchemaChangeTestsBasicCases = []MergeScriptTest{ Assertions: []queries.ScriptTestAssertion{ { Query: "call dolt_merge('right');", - Expected: []sql.Row{{doltCommit, 0, 0, "merge successful"}}, + Expected: []sql.UntypedSqlRow{{doltCommit, 0, 0, "merge successful"}}, }, { Query: "select pk, col11, col2 from t;", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {1, 10, "100"}, {2, 20, "200"}, {3, 30, "300"}, {4, 40, "400"}, {5, 50, "500"}, {6, 60, "600"}, @@ -195,11 +195,11 @@ var SchemaChangeTestsBasicCases = []MergeScriptTest{ Assertions: []queries.ScriptTestAssertion{ { Query: "call dolt_merge('right');", - Expected: []sql.Row{{doltCommit, 0, 0, "merge successful"}}, + Expected: []sql.UntypedSqlRow{{doltCommit, 0, 0, "merge successful"}}, }, { Query: "select pk, col1, col2 from t;", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {1, 10, "100"}, {2, 20, "200"}, {3, 30, "300"}, {4, 40, "400"}, {5, 50, "500"}, {6, 60, "600"}}, @@ -225,11 +225,11 @@ var SchemaChangeTestsBasicCases = []MergeScriptTest{ Assertions: []queries.ScriptTestAssertion{ { Query: "call dolt_merge('right');", - Expected: []sql.Row{{doltCommit, 0, 0, "merge successful"}}, + Expected: []sql.UntypedSqlRow{{doltCommit, 0, 0, "merge successful"}}, }, { Query: "select * from t;", - Expected: []sql.Row{{1, 1, nil, nil}, {2, 2, 2, 2}, {3, 3, nil, nil}}, + Expected: []sql.UntypedSqlRow{{1, 1, nil, nil}, {2, 2, 2, 2}, {3, 3, nil, nil}}, }, }, }, @@ -250,11 +250,11 @@ var SchemaChangeTestsBasicCases = []MergeScriptTest{ Assertions: []queries.ScriptTestAssertion{ { Query: "call dolt_merge('right');", - Expected: []sql.Row{{doltCommit, 0, 0, "merge successful"}}, + Expected: []sql.UntypedSqlRow{{doltCommit, 0, 0, "merge successful"}}, }, { Query: "select * from t;", - Expected: []sql.Row{{1, "hello"}, {2, "hi"}, {3, "hello"}}, + Expected: []sql.UntypedSqlRow{{1, "hello"}, {2, "hi"}, {3, "hello"}}, }, }, }, @@ -275,11 +275,11 @@ var SchemaChangeTestsBasicCases = []MergeScriptTest{ Assertions: []queries.ScriptTestAssertion{ { Query: "call dolt_merge('right');", - Expected: []sql.Row{{doltCommit, 0, 0, "merge successful"}}, + Expected: []sql.UntypedSqlRow{{doltCommit, 0, 0, "merge successful"}}, }, { Query: "select * from t;", - Expected: []sql.Row{{1, nil}, {2, "hello"}, {3, nil}}, + Expected: []sql.UntypedSqlRow{{1, nil}, {2, "hello"}, {3, nil}}, }, }, }, @@ -300,11 +300,11 @@ var SchemaChangeTestsBasicCases = []MergeScriptTest{ Assertions: []queries.ScriptTestAssertion{ { Query: "call dolt_merge('right');", - Expected: []sql.Row{{doltCommit, 0, 0, "merge successful"}}, + Expected: []sql.UntypedSqlRow{{doltCommit, 0, 0, "merge successful"}}, }, { Query: "select * from t;", - Expected: []sql.Row{{"1", "1hello"}, {"2", "hi"}, {"3", "3hello"}}, + Expected: []sql.UntypedSqlRow{{"1", "1hello"}, {"2", "hi"}, {"3", "3hello"}}, }, }, }, @@ -328,11 +328,11 @@ var SchemaChangeTestsBasicCases = []MergeScriptTest{ Assertions: []queries.ScriptTestAssertion{ { Query: "call dolt_merge('right');", - Expected: []sql.Row{{doltCommit, 0, 0, "merge successful"}}, + Expected: []sql.UntypedSqlRow{{doltCommit, 0, 0, "merge successful"}}, }, { Query: "select * from t;", - Expected: []sql.Row{{1, "hello", "hellohello"}, {2, "hello", "hi"}, {3, "hello", "hellohello"}}, + Expected: []sql.UntypedSqlRow{{1, "hello", "hellohello"}, {2, "hello", "hi"}, {3, "hello", "hellohello"}}, }, }, }, @@ -352,11 +352,11 @@ var SchemaChangeTestsBasicCases = []MergeScriptTest{ Assertions: []queries.ScriptTestAssertion{ { Query: "call dolt_merge('right');", - Expected: []sql.Row{{doltCommit, 0, 0, "merge successful"}}, + Expected: []sql.UntypedSqlRow{{doltCommit, 0, 0, "merge successful"}}, }, { Query: "select * from t order by pk;", - Expected: []sql.Row{{1, "BAD", "hello", "helloBADdefault"}, {2, "BAD", "hello", "hi"}, {3, "BAD", "hi", "hiBADdefault"}}, + Expected: []sql.UntypedSqlRow{{1, "BAD", "hello", "helloBADdefault"}, {2, "BAD", "hello", "hi"}, {3, "BAD", "hi", "hiBADdefault"}}, }, }, }, @@ -378,11 +378,11 @@ var SchemaChangeTestsBasicCases = []MergeScriptTest{ Assertions: []queries.ScriptTestAssertion{ { Query: "call dolt_merge('right');", - Expected: []sql.Row{{doltCommit, 0, 0, "merge successful"}}, + Expected: []sql.UntypedSqlRow{{doltCommit, 0, 0, "merge successful"}}, }, { Query: "select pk, col1, col2 from t;", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {1, nil, nil}, {2, nil, nil}, {3, nil, "300"}, @@ -411,11 +411,11 @@ var SchemaChangeTestsBasicCases = []MergeScriptTest{ Assertions: []queries.ScriptTestAssertion{ { Query: "call dolt_merge('right');", - Expected: []sql.Row{{doltCommit, 0, 0, "merge successful"}}, + Expected: []sql.UntypedSqlRow{{doltCommit, 0, 0, "merge successful"}}, }, { Query: "select pk, col1, col2 from t;", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {1, 101, "abc"}, {2, 101, "abc"}, {3, 101, "300"}, @@ -445,11 +445,11 @@ var SchemaChangeTestsBasicCases = []MergeScriptTest{ Assertions: []queries.ScriptTestAssertion{ { Query: "call dolt_merge('right');", - Expected: []sql.Row{{doltCommit, 0, 0, "merge successful"}}, + Expected: []sql.UntypedSqlRow{{doltCommit, 0, 0, "merge successful"}}, }, { Query: "select pk, col1, col2 from t;", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {1, 101, nil}, {2, 102, nil}, {3, 103, "3hello"}, @@ -481,13 +481,13 @@ var SchemaChangeTestsBasicCases = []MergeScriptTest{ Assertions: []queries.ScriptTestAssertion{ { Query: "call dolt_merge('right');", - Expected: []sql.Row{{doltCommit, 0, 0, "merge successful"}}, + Expected: []sql.UntypedSqlRow{{doltCommit, 0, 0, "merge successful"}}, }, { // NOTE: If we can't find an exact tag mapping, then we fall back to // matching by name and exact type. Query: "select pk, col1, col2 from t order by pk;", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {1, nil, "100"}, {2, nil, "200"}, {3, 30, "300"}, @@ -515,11 +515,11 @@ var SchemaChangeTestsBasicCases = []MergeScriptTest{ Assertions: []queries.ScriptTestAssertion{ { Query: "call dolt_merge('right');", - Expected: []sql.Row{{doltCommit, 0, 0, "merge successful"}}, + Expected: []sql.UntypedSqlRow{{doltCommit, 0, 0, "merge successful"}}, }, { Query: "select * from t;", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {1, "a", "b"}, {2, "c", "d"}, {300, "e", "f"}}, @@ -551,15 +551,15 @@ var SchemaChangeTestsBasicCases = []MergeScriptTest{ Assertions: []queries.ScriptTestAssertion{ { Query: "call dolt_merge('right');", - Expected: []sql.Row{{doltCommit, 0, 0, "merge successful"}}, + Expected: []sql.UntypedSqlRow{{doltCommit, 0, 0, "merge successful"}}, }, { Query: "show create table t;", - Expected: []sql.Row{{"t", "CREATE TABLE `t` (\n `pk` int NOT NULL,\n `col1` int NOT NULL,\n `col3` int,\n PRIMARY KEY (`pk`),\n KEY `idx1` (`col3`,`col1`),\n CONSTRAINT `fk1` FOREIGN KEY (`col3`) REFERENCES `parent` (`id`)\n) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_bin"}}, + Expected: []sql.UntypedSqlRow{{"t", "CREATE TABLE `t` (\n `pk` int NOT NULL,\n `col1` int NOT NULL,\n `col3` int,\n PRIMARY KEY (`pk`),\n KEY `idx1` (`col3`,`col1`),\n CONSTRAINT `fk1` FOREIGN KEY (`col3`) REFERENCES `parent` (`id`)\n) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_bin"}}, }, { Query: "select * from t;", - Expected: []sql.Row{{1, -1000, nil}}, + Expected: []sql.UntypedSqlRow{{1, -1000, nil}}, }, }, }, @@ -608,11 +608,11 @@ var SchemaChangeTestsBasicCases = []MergeScriptTest{ Assertions: []queries.ScriptTestAssertion{ { Query: "call dolt_merge('right');", - Expected: []sql.Row{{doltCommit, 0, 0, "merge successful"}}, + Expected: []sql.UntypedSqlRow{{doltCommit, 0, 0, "merge successful"}}, }, { Query: "select * from t;", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {1, 100}, {2, 200}, {3, 30}, {4, 40}, {5, 50}, {6, 60}, @@ -640,15 +640,15 @@ var SchemaChangeTestsCollations = []MergeScriptTest{ Assertions: []queries.ScriptTestAssertion{ { Query: "call dolt_merge('right');", - Expected: []sql.Row{{doltCommit, 0, 0, "merge successful"}}, + Expected: []sql.UntypedSqlRow{{doltCommit, 0, 0, "merge successful"}}, }, { Query: "select * from t;", - Expected: []sql.Row{{1, "10"}, {2, "20"}, {3, "30"}}, + Expected: []sql.UntypedSqlRow{{1, "10"}, {2, "20"}, {3, "30"}}, }, { Query: "show create table t;", - Expected: []sql.Row{{"t", "CREATE TABLE `t` (\n `pk` int NOT NULL,\n `col1` varchar(100) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci,\n PRIMARY KEY (`pk`)\n) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_bin"}}, + Expected: []sql.UntypedSqlRow{{"t", "CREATE TABLE `t` (\n `pk` int NOT NULL,\n `col1` varchar(100) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci,\n PRIMARY KEY (`pk`)\n) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_bin"}}, }, }, }, @@ -692,15 +692,15 @@ var SchemaChangeTestsCollations = []MergeScriptTest{ Assertions: []queries.ScriptTestAssertion{ { Query: "call dolt_merge('right');", - Expected: []sql.Row{{doltCommit, 0, 0, "merge successful"}}, + Expected: []sql.UntypedSqlRow{{doltCommit, 0, 0, "merge successful"}}, }, { Query: "select * from t;", - Expected: []sql.Row{{1, "10"}, {2, "20"}, {3, "30"}}, + Expected: []sql.UntypedSqlRow{{1, "10"}, {2, "20"}, {3, "30"}}, }, { Query: "show create table t;", - Expected: []sql.Row{{"t", "CREATE TABLE `t` (\n `pk` int NOT NULL,\n `col1` varchar(100) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci,\n PRIMARY KEY (`pk`)\n) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_bin"}}, + Expected: []sql.UntypedSqlRow{{"t", "CREATE TABLE `t` (\n `pk` int NOT NULL,\n `col1` varchar(100) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci,\n PRIMARY KEY (`pk`)\n) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_bin"}}, }, }, }, @@ -725,11 +725,11 @@ var SchemaChangeTestsConstraints = []MergeScriptTest{ Assertions: []queries.ScriptTestAssertion{ { Query: "call dolt_merge('right');", - Expected: []sql.Row{{doltCommit, 0, 0, "merge successful"}}, + Expected: []sql.UntypedSqlRow{{doltCommit, 0, 0, "merge successful"}}, }, { Query: "select * from t;", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {1, 1}, {2, 2}, {3, nil}, @@ -762,15 +762,15 @@ var SchemaChangeTestsConstraints = []MergeScriptTest{ Assertions: []queries.ScriptTestAssertion{ { Query: "call dolt_merge('right');", - Expected: []sql.Row{{"", 0, 1, "conflicts found"}}, + Expected: []sql.UntypedSqlRow{{"", 0, 1, "conflicts found"}}, }, { Query: "select pk, p_fk, col1, col2 from child order by pk;", - Expected: []sql.Row{{1, 3, nil, "1col2"}, {2, 2, nil, "2col2"}}, + Expected: []sql.UntypedSqlRow{{1, 3, nil, "1col2"}, {2, 2, nil, "2col2"}}, }, { Query: "select pk, p_fk, col1, col2 from dolt_constraint_violations_child order by pk;", - Expected: []sql.Row{{1, 3, nil, "1col2"}, {2, 2, nil, "2col2"}}, + Expected: []sql.UntypedSqlRow{{1, 3, nil, "1col2"}, {2, 2, nil, "2col2"}}, }, }, }, @@ -792,11 +792,11 @@ var SchemaChangeTestsConstraints = []MergeScriptTest{ Assertions: []queries.ScriptTestAssertion{ { Query: "call dolt_merge('right');", - Expected: []sql.Row{{doltCommit, 0, 0, "merge successful"}}, + Expected: []sql.UntypedSqlRow{{doltCommit, 0, 0, "merge successful"}}, }, { Query: "select * from t;", - Expected: []sql.Row{{1, "one"}, {2, "two"}, {3, "three"}}, + Expected: []sql.UntypedSqlRow{{1, "one"}, {2, "two"}, {3, "three"}}, }, }, }, @@ -818,15 +818,15 @@ var SchemaChangeTestsConstraints = []MergeScriptTest{ Assertions: []queries.ScriptTestAssertion{ { Query: "call dolt_merge('right');", - Expected: []sql.Row{{doltCommit, 0, 0, "merge successful"}}, + Expected: []sql.UntypedSqlRow{{doltCommit, 0, 0, "merge successful"}}, }, { Query: "select * from parent;", - Expected: []sql.Row{}, + Expected: []sql.UntypedSqlRow{}, }, { Query: "select * from child;", - Expected: []sql.Row{{1, 1}, {2, 1}}, + Expected: []sql.UntypedSqlRow{{1, 1}, {2, 1}}, }, }, }, @@ -847,15 +847,15 @@ var SchemaChangeTestsConstraints = []MergeScriptTest{ Assertions: []queries.ScriptTestAssertion{ { Query: "call dolt_merge('right');", - Expected: []sql.Row{{"", 0, 1, "conflicts found"}}, + Expected: []sql.UntypedSqlRow{{"", 0, 1, "conflicts found"}}, }, { Query: "select pk, col1 from t;", - Expected: []sql.Row{{1, 1}, {2, 1}, {3, 1}}, + Expected: []sql.UntypedSqlRow{{1, 1}, {2, 1}, {3, 1}}, }, { Query: "select pk, col1 from dolt_constraint_violations_t;", - Expected: []sql.Row{{1, 1}, {2, 1}, {3, 1}}, + Expected: []sql.UntypedSqlRow{{1, 1}, {2, 1}, {3, 1}}, }, }, }, @@ -877,26 +877,26 @@ var SchemaChangeTestsConstraints = []MergeScriptTest{ Assertions: []queries.ScriptTestAssertion{ { Query: "call dolt_merge('right');", - Expected: []sql.Row{{"", 0, 1, "conflicts found"}}, + Expected: []sql.UntypedSqlRow{{"", 0, 1, "conflicts found"}}, }, { Query: "select * from dolt_conflicts;", - Expected: []sql.Row{}, + Expected: []sql.UntypedSqlRow{}, }, { Query: "select * from dolt_constraint_violations;", - Expected: []sql.Row{{"t", uint(2)}}, + Expected: []sql.UntypedSqlRow{{"t", uint(2)}}, }, { Query: "select violation_type, pk, col2, violation_info from dolt_constraint_violations_t;", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {"unique index", "1", "same", merge.UniqCVMeta{Columns: []string{"col2"}, Name: "unique1"}}, {"unique index", "10", "same", merge.UniqCVMeta{Columns: []string{"col2"}, Name: "unique1"}}, }, }, { Query: "select pk, col2 from t;", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {"0", ""}, {"1", "same"}, {"10", "same"}, @@ -922,11 +922,11 @@ var SchemaChangeTestsConstraints = []MergeScriptTest{ Assertions: []queries.ScriptTestAssertion{ { Query: "call dolt_merge('right');", - Expected: []sql.Row{{doltCommit, 0, 0, "merge successful"}}, + Expected: []sql.UntypedSqlRow{{doltCommit, 0, 0, "merge successful"}}, }, { Query: "select * from t;", - Expected: []sql.Row{{1, 1}, {2, 1}, {3, 3}}, + Expected: []sql.UntypedSqlRow{{1, 1}, {2, 1}, {3, 3}}, }, }, }, @@ -948,11 +948,11 @@ var SchemaChangeTestsConstraints = []MergeScriptTest{ Assertions: []queries.ScriptTestAssertion{ { Query: "call dolt_merge('right');", - Expected: []sql.Row{{doltCommit, 0, 0, "merge successful"}}, + Expected: []sql.UntypedSqlRow{{doltCommit, 0, 0, "merge successful"}}, }, { Query: "select * from t;", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {1, 0, "1", nil}, {2, 1, "2", "hello"}, {3, 0, "3", nil}, @@ -977,15 +977,15 @@ var SchemaChangeTestsConstraints = []MergeScriptTest{ Assertions: []queries.ScriptTestAssertion{ { Query: "call dolt_merge('right');", - Expected: []sql.Row{{"", 0, 1, "conflicts found"}}, + Expected: []sql.UntypedSqlRow{{"", 0, 1, "conflicts found"}}, }, { Query: "select * from dolt_constraint_violations;", - Expected: []sql.Row{{"t", uint64(1)}}, + Expected: []sql.UntypedSqlRow{{"t", uint64(1)}}, }, { Query: "select violation_type, pk, col1, col2, violation_info like '\\%NOT((col1 = col2))\\%' from dolt_constraint_violations_t;", - Expected: []sql.Row{{"check constraint", 1, 4, 4, true}}, + Expected: []sql.UntypedSqlRow{{"check constraint", 1, 4, 4, true}}, }, }, }, @@ -1010,15 +1010,15 @@ var SchemaChangeTestsConstraints = []MergeScriptTest{ Assertions: []queries.ScriptTestAssertion{ { Query: "call dolt_merge('right');", - Expected: []sql.Row{{doltCommit, 0, 0, "merge successful"}}, + Expected: []sql.UntypedSqlRow{{doltCommit, 0, 0, "merge successful"}}, }, { Query: "select * from dolt_constraint_violations;", - Expected: []sql.Row{}, + Expected: []sql.UntypedSqlRow{}, }, { Query: "select * from t;", - Expected: []sql.Row{{1, 2, 0}}, + Expected: []sql.UntypedSqlRow{{1, 2, 0}}, }, }, }, @@ -1040,15 +1040,15 @@ var SchemaChangeTestsConstraints = []MergeScriptTest{ Assertions: []queries.ScriptTestAssertion{ { Query: "call dolt_merge('right');", - Expected: []sql.Row{{"", 0, 1, "conflicts found"}}, + Expected: []sql.UntypedSqlRow{{"", 0, 1, "conflicts found"}}, }, { Query: "select * from dolt_constraint_violations;", - Expected: []sql.Row{{"t", uint64(1)}}, + Expected: []sql.UntypedSqlRow{{"t", uint64(1)}}, }, { Query: "select violation_type, pk, col1, col2, violation_info like '%(col1 + col2)%' from dolt_constraint_violations_t;", - Expected: []sql.Row{{"check constraint", 1, 0, 0, true}}, + Expected: []sql.UntypedSqlRow{{"check constraint", 1, 0, 0, true}}, }, }, }, @@ -1070,15 +1070,15 @@ var SchemaChangeTestsConstraints = []MergeScriptTest{ Assertions: []queries.ScriptTestAssertion{ { Query: "call dolt_merge('right');", - Expected: []sql.Row{{"", 0, 1, "conflicts found"}}, + Expected: []sql.UntypedSqlRow{{"", 0, 1, "conflicts found"}}, }, { Query: "select * from dolt_constraint_violations;", - Expected: []sql.Row{{"t", uint64(1)}}, + Expected: []sql.UntypedSqlRow{{"t", uint64(1)}}, }, { Query: "select violation_type, pk, col2, col3, violation_info like '\\%NOT((col2 = col3))\\%' from dolt_constraint_violations_t;", - Expected: []sql.Row{{"check constraint", 1, 100, 100, true}}, + Expected: []sql.UntypedSqlRow{{"check constraint", 1, 100, 100, true}}, }, }, }, @@ -1099,7 +1099,7 @@ var SchemaChangeTestsConstraints = []MergeScriptTest{ Assertions: []queries.ScriptTestAssertion{ { Query: "call dolt_merge('right');", - Expected: []sql.Row{{doltCommit, 0, 0, "merge successful"}}, + Expected: []sql.UntypedSqlRow{{doltCommit, 0, 0, "merge successful"}}, }, }, }, @@ -1121,7 +1121,7 @@ var SchemaChangeTestsConstraints = []MergeScriptTest{ Assertions: []queries.ScriptTestAssertion{ { Query: "call dolt_merge('right');", - Expected: []sql.Row{{"", 0, 1, "conflicts found"}}, + Expected: []sql.UntypedSqlRow{{"", 0, 1, "conflicts found"}}, }, }, }, @@ -1141,7 +1141,7 @@ var SchemaChangeTestsConstraints = []MergeScriptTest{ Assertions: []queries.ScriptTestAssertion{ { Query: "call dolt_merge('right');", - Expected: []sql.Row{{doltCommit, 0, 0, "merge successful"}}, + Expected: []sql.UntypedSqlRow{{doltCommit, 0, 0, "merge successful"}}, }, }, }, @@ -1161,7 +1161,7 @@ var SchemaChangeTestsConstraints = []MergeScriptTest{ Assertions: []queries.ScriptTestAssertion{ { Query: "call dolt_merge('right');", - Expected: []sql.Row{{"", 0, 1, "conflicts found"}}, + Expected: []sql.UntypedSqlRow{{"", 0, 1, "conflicts found"}}, }, }, }, @@ -1184,15 +1184,15 @@ var SchemaChangeTestsConstraints = []MergeScriptTest{ Assertions: []queries.ScriptTestAssertion{ { Query: "call dolt_merge('right');", - Expected: []sql.Row{{"", 0, 1, "conflicts found"}}, + Expected: []sql.UntypedSqlRow{{"", 0, 1, "conflicts found"}}, }, { Query: "select * from dolt_constraint_violations;", - Expected: []sql.Row{{"t", uint64(1)}}, + Expected: []sql.UntypedSqlRow{{"t", uint64(1)}}, }, { Query: `select violation_type, pk, col1, violation_info like "\%NOT((col1 = concat('he','llo')))\%" from dolt_constraint_violations_t;`, - Expected: []sql.Row{{"check constraint", 2, "hello", true}}, + Expected: []sql.UntypedSqlRow{{"check constraint", 2, "hello", true}}, }, }, }, @@ -1213,15 +1213,15 @@ var SchemaChangeTestsConstraints = []MergeScriptTest{ Assertions: []queries.ScriptTestAssertion{ { Query: "call dolt_merge('right');", - Expected: []sql.Row{{"", 0, 1, "conflicts found"}}, + Expected: []sql.UntypedSqlRow{{"", 0, 1, "conflicts found"}}, }, { Query: "select * from dolt_constraint_violations;", - Expected: []sql.Row{{"t", uint64(1)}}, + Expected: []sql.UntypedSqlRow{{"t", uint64(1)}}, }, { Query: `select violation_type, c0, col0, col1, violation_info like "\%NOT((col1 = concat('he','llo')))\%" from dolt_constraint_violations_t;`, - Expected: []sql.Row{{"check constraint", 2, "hola", "hello", true}}, + Expected: []sql.UntypedSqlRow{{"check constraint", 2, "hola", "hello", true}}, }, }, }, @@ -1249,15 +1249,15 @@ var SchemaChangeTestsTypeChanges = []MergeScriptTest{ Assertions: []queries.ScriptTestAssertion{ { Query: "call dolt_merge('right');", - Expected: []sql.Row{{doltCommit, 0, 0, "merge successful"}}, + Expected: []sql.UntypedSqlRow{{doltCommit, 0, 0, "merge successful"}}, }, { Query: "select * from t;", - Expected: []sql.Row{{1, "123"}, {2, "12345678901234567890"}, {3, "321"}}, + Expected: []sql.UntypedSqlRow{{1, "123"}, {2, "12345678901234567890"}, {3, "321"}}, }, { Query: "show create table t;", - Expected: []sql.Row{{"t", "CREATE TABLE `t` (\n" + + Expected: []sql.UntypedSqlRow{{"t", "CREATE TABLE `t` (\n" + " `pk` int NOT NULL,\n" + " `col1` varchar(100),\n" + " PRIMARY KEY (`pk`),\n" + @@ -1266,7 +1266,7 @@ var SchemaChangeTestsTypeChanges = []MergeScriptTest{ }, { Query: "insert into t values (4, 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJJKLMNOPQRSTUVWXYZ!@#$%^&*()_+');", - Expected: []sql.Row{{types.NewOkResult(1)}}, + Expected: []sql.UntypedSqlRow{{types.NewOkResult(1)}}, }, }, }, @@ -1288,11 +1288,11 @@ var SchemaChangeTestsTypeChanges = []MergeScriptTest{ Assertions: []queries.ScriptTestAssertion{ { Query: "call dolt_merge('right');", - Expected: []sql.Row{{doltCommit, 0, 0, "merge successful"}}, + Expected: []sql.UntypedSqlRow{{doltCommit, 0, 0, "merge successful"}}, }, { Query: "select * from t order by pk;", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {1, "blue", "blue,green"}, {2, "green", "blue,green"}, {3, "red", "blue,red"}, @@ -1319,11 +1319,11 @@ var SchemaChangeTestsTypeChanges = []MergeScriptTest{ Assertions: []queries.ScriptTestAssertion{ { Query: "call dolt_merge('right');", - Expected: []sql.Row{{doltCommit, 0, 0, "merge successful"}}, + Expected: []sql.UntypedSqlRow{{doltCommit, 0, 0, "merge successful"}}, }, { Query: "select * from t order by pk;", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {1, "123", 40}, {2, "12345678901234567890", 20}, {3, "321", 30}, @@ -1349,11 +1349,11 @@ var SchemaChangeTestsTypeChanges = []MergeScriptTest{ Assertions: []queries.ScriptTestAssertion{ { Query: "call dolt_merge('right');", - Expected: []sql.Row{{doltCommit, 0, 0, "merge successful"}}, + Expected: []sql.UntypedSqlRow{{doltCommit, 0, 0, "merge successful"}}, }, { Query: "select * from t order by pk;", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {1, "123"}, {2, "12345678901234567890"}, {3, "321"}, @@ -1379,11 +1379,11 @@ var SchemaChangeTestsTypeChanges = []MergeScriptTest{ Assertions: []queries.ScriptTestAssertion{ { Query: "call dolt_merge('right');", - Expected: []sql.Row{{doltCommit, 0, 0, "merge successful"}}, + Expected: []sql.UntypedSqlRow{{doltCommit, 0, 0, "merge successful"}}, }, { Query: "select * from t order by pk;", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {1, []uint8{0x31, 0x32, 0x33}}, {2, []uint8{0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, 0x38, 0x39, 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, 0x38, 0x39, 0x30}}, {3, []uint8{0x33, 0x32, 0x31}}, @@ -1409,15 +1409,15 @@ var SchemaChangeTestsTypeChanges = []MergeScriptTest{ Assertions: []queries.ScriptTestAssertion{ { Query: "call dolt_merge('right');", - Expected: []sql.Row{{"", 0, 1, "conflicts found"}}, + Expected: []sql.UntypedSqlRow{{"", 0, 1, "conflicts found"}}, }, { Query: "select * from dolt_conflicts;", - Expected: []sql.Row{{"t", uint64(0)}}, + Expected: []sql.UntypedSqlRow{{"t", uint64(0)}}, }, { Query: "select count(*) from dolt_schema_conflicts where description like 'incompatible column types for column ''col1''%';", - Expected: []sql.Row{{1}}, + Expected: []sql.UntypedSqlRow{{1}}, }, }, }, @@ -1439,15 +1439,15 @@ var SchemaChangeTestsTypeChanges = []MergeScriptTest{ Assertions: []queries.ScriptTestAssertion{ { Query: "call dolt_merge('right');", - Expected: []sql.Row{{"", 0, 1, "conflicts found"}}, + Expected: []sql.UntypedSqlRow{{"", 0, 1, "conflicts found"}}, }, { Query: "select * from dolt_conflicts;", - Expected: []sql.Row{{"t", uint64(0)}}, + Expected: []sql.UntypedSqlRow{{"t", uint64(0)}}, }, { Query: "select count(*) from dolt_schema_conflicts where description like 'incompatible column types for column ''col1''%';", - Expected: []sql.Row{{1}}, + Expected: []sql.UntypedSqlRow{{1}}, }, }, }, @@ -1469,11 +1469,11 @@ var SchemaChangeTestsTypeChanges = []MergeScriptTest{ Assertions: []queries.ScriptTestAssertion{ { Query: "call dolt_merge('right');", - Expected: []sql.Row{{doltCommit, 0, 0, "merge successful"}}, + Expected: []sql.UntypedSqlRow{{doltCommit, 0, 0, "merge successful"}}, }, { Query: "select * from t order by pk;", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {1, "123"}, {2, "12345678901234567890"}, {3, "321"}, @@ -1499,11 +1499,11 @@ var SchemaChangeTestsTypeChanges = []MergeScriptTest{ Assertions: []queries.ScriptTestAssertion{ { Query: "call dolt_merge('right');", - Expected: []sql.Row{{"", 0, 1, "conflicts found"}}, + Expected: []sql.UntypedSqlRow{{"", 0, 1, "conflicts found"}}, }, { Query: "select count(*) from dolt_schema_conflicts where description like 'incompatible column types for column ''col1''%';", - Expected: []sql.Row{{1}}, + Expected: []sql.UntypedSqlRow{{1}}, }, }, }, @@ -1525,11 +1525,11 @@ var SchemaChangeTestsTypeChanges = []MergeScriptTest{ Assertions: []queries.ScriptTestAssertion{ { Query: "call dolt_merge('right');", - Expected: []sql.Row{{"", 0, 1, "conflicts found"}}, + Expected: []sql.UntypedSqlRow{{"", 0, 1, "conflicts found"}}, }, { Query: "select table_name, description like 'incompatible column types for column ''col1''%' from dolt_schema_conflicts;", - Expected: []sql.Row{{"t", true}}, + Expected: []sql.UntypedSqlRow{{"t", true}}, }, }, }, @@ -1551,11 +1551,11 @@ var SchemaChangeTestsTypeChanges = []MergeScriptTest{ Assertions: []queries.ScriptTestAssertion{ { Query: "call dolt_merge('right');", - Expected: []sql.Row{{"", 0, 1, "conflicts found"}}, + Expected: []sql.UntypedSqlRow{{"", 0, 1, "conflicts found"}}, }, { Query: "select table_name, description like 'incompatible column types for column ''col1''%' from dolt_schema_conflicts;", - Expected: []sql.Row{{"t", true}}, + Expected: []sql.UntypedSqlRow{{"t", true}}, }, }, }, @@ -1577,11 +1577,11 @@ var SchemaChangeTestsTypeChanges = []MergeScriptTest{ Assertions: []queries.ScriptTestAssertion{ { Query: "call dolt_merge('right');", - Expected: []sql.Row{{doltCommit, 0, 0, "merge successful"}}, + Expected: []sql.UntypedSqlRow{{doltCommit, 0, 0, "merge successful"}}, }, { Query: "select * from t order by pk;", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {1, "123"}, {2, "12345"}, {3, "321"}, @@ -1607,11 +1607,11 @@ var SchemaChangeTestsTypeChanges = []MergeScriptTest{ Assertions: []queries.ScriptTestAssertion{ { Query: "call dolt_merge('right');", - Expected: []sql.Row{{doltCommit, 0, 0, "merge successful"}}, + Expected: []sql.UntypedSqlRow{{doltCommit, 0, 0, "merge successful"}}, }, { Query: "select pk, col1 from t order by pk;", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ // NOTE: When MySQL converts from BINARY(N) to VARBINARY(N), it does not change any values. But... // when converting from VARBINARY(N) to BINARY(N), MySQL *DOES* right-pad any values up to // N bytes. @@ -1644,11 +1644,11 @@ var SchemaChangeTestsTypeChanges = []MergeScriptTest{ Assertions: []queries.ScriptTestAssertion{ { Query: "call dolt_merge('right');", - Expected: []sql.Row{{doltCommit, 0, 0, "merge successful"}}, + Expected: []sql.UntypedSqlRow{{doltCommit, 0, 0, "merge successful"}}, }, { Query: "select pk, col1 from t order by pk;", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ // NOTE: When MySQL converts from BINARY(N) to VARBINARY(N), it does not change any values. But... // when converting from VARBINARY(N) to BINARY(N), MySQL *DOES* right-pad any values up to // N bytes, so all values here are right padded, matching MySQL's behavior. @@ -1677,13 +1677,13 @@ var SchemaChangeTestsTypeChanges = []MergeScriptTest{ Assertions: []queries.ScriptTestAssertion{ { Query: "call dolt_merge('right');", - Expected: []sql.Row{{doltCommit, 0, 0, "merge successful"}}, + Expected: []sql.UntypedSqlRow{{doltCommit, 0, 0, "merge successful"}}, }, { // When MySQL converts from TINYTEXT to BINARY(255), MySQL right-pads each existing value // with null bytes, to expand the value up to 255 bytes. Query: "select pk, length(col1) from t order by pk;", - Expected: []sql.Row{{1, 255}, {2, 255}, {3, 255}}, + Expected: []sql.UntypedSqlRow{{1, 255}, {2, 255}, {3, 255}}, }, }, }, @@ -1705,11 +1705,11 @@ var SchemaChangeTestsTypeChanges = []MergeScriptTest{ Assertions: []queries.ScriptTestAssertion{ { Query: "call dolt_merge('right');", - Expected: []sql.Row{{doltCommit, 0, 0, "merge successful"}}, + Expected: []sql.UntypedSqlRow{{doltCommit, 0, 0, "merge successful"}}, }, { Query: "select pk, col1 from t order by pk;", - Expected: []sql.Row{{1, "tiny tiny text"}, {2, "more teeny tiny text"}, {3, "the teeniest of tiny text"}}, + Expected: []sql.UntypedSqlRow{{1, "tiny tiny text"}, {2, "more teeny tiny text"}, {3, "the teeniest of tiny text"}}, }, }, }, @@ -1744,11 +1744,11 @@ var SchemaChangeTestsSchemaConflicts = []MergeScriptTest{ Assertions: []queries.ScriptTestAssertion{ { Query: "call dolt_merge('right');", - Expected: []sql.Row{{"", 0, 1, "conflicts found"}}, + Expected: []sql.UntypedSqlRow{{"", 0, 1, "conflicts found"}}, }, { Query: "select table_name, our_schema, their_schema, base_schema from dolt_schema_conflicts;", - Expected: []sql.Row{{"t", + Expected: []sql.UntypedSqlRow{{"t", "CREATE TABLE `t` (\n `pk` int NOT NULL,\n `col1` enum('blue','green'),\n `col2` float,\n `col3` smallint,\n `col4` decimal(4,2),\n `col5` varchar(10),\n `col6` set('a','b'),\n `col7` bit(1),\n PRIMARY KEY (`pk`),\n KEY `idx1` (`col1`)\n) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_bin;", "CREATE TABLE `t` (\n `pk` int NOT NULL,\n `col1` enum('blue','green','red'),\n `col2` double,\n `col3` bigint,\n `col4` decimal(8,4),\n `col5` varchar(20),\n `col6` set('a','b','c'),\n `col7` bit(2),\n PRIMARY KEY (`pk`),\n KEY `idx1` (`col1`)\n) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_bin;", "CREATE TABLE `t` (\n `pk` int NOT NULL,\n `col1` enum('blue','green'),\n `col2` float,\n `col3` smallint,\n `col4` decimal(4,2),\n `col5` varchar(10),\n `col6` set('a','b'),\n `col7` bit(1),\n PRIMARY KEY (`pk`),\n KEY `idx1` (`col1`)\n) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_bin;"}}, @@ -1785,11 +1785,11 @@ var SchemaChangeTestsSchemaConflicts = []MergeScriptTest{ Assertions: []queries.ScriptTestAssertion{ { Query: "call dolt_merge('right');", - Expected: []sql.Row{{"", 0, 1, "conflicts found"}}, + Expected: []sql.UntypedSqlRow{{"", 0, 1, "conflicts found"}}, }, { Query: "select table_name, our_schema, their_schema, base_schema from dolt_schema_conflicts;", - Expected: []sql.Row{{"t", + Expected: []sql.UntypedSqlRow{{"t", "CREATE TABLE `t` (\n `pk` int NOT NULL,\n `col1` enum('blue','green','red'),\n `col2` double,\n `col3` bigint,\n `col4` decimal(8,4),\n `col5` varchar(20),\n `col6` set('a','b','c'),\n `col7` bit(2),\n PRIMARY KEY (`pk`),\n KEY `idx1` (`col1`)\n) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_bin;", "CREATE TABLE `t` (\n `pk` int NOT NULL,\n `col1` enum('blue','green'),\n `col2` float,\n `col3` smallint,\n `col4` decimal(4,2),\n `col5` varchar(10),\n `col6` set('a','b'),\n `col7` bit(1),\n PRIMARY KEY (`pk`),\n KEY `idx1` (`col1`)\n) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_bin;", "CREATE TABLE `t` (\n `pk` int NOT NULL,\n `col1` enum('blue','green','red'),\n `col2` double,\n `col3` bigint,\n `col4` decimal(8,4),\n `col5` varchar(20),\n `col6` set('a','b','c'),\n `col7` bit(2),\n PRIMARY KEY (`pk`),\n KEY `idx1` (`col1`)\n) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_bin;"}}, @@ -1817,11 +1817,11 @@ var SchemaChangeTestsSchemaConflicts = []MergeScriptTest{ Assertions: []queries.ScriptTestAssertion{ { Query: "call dolt_merge('right');", - Expected: []sql.Row{{"", 0, 1, "conflicts found"}}, + Expected: []sql.UntypedSqlRow{{"", 0, 1, "conflicts found"}}, }, { Query: "select table_name, our_schema, their_schema, base_schema, description from dolt_schema_conflicts;", - Expected: []sql.Row{{"t", + Expected: []sql.UntypedSqlRow{{"t", "CREATE TABLE `t` (\n `pk` int NOT NULL,\n `col1` varchar(100),\n PRIMARY KEY (`pk`),\n UNIQUE KEY `idx1` (`col1`)\n) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_bin;", "CREATE TABLE `t` (\n `pk` int NOT NULL,\n `col1` varchar(100),\n PRIMARY KEY (`pk`),\n UNIQUE KEY `idx1` (`col1`),\n KEY `idx2` (`col1`)\n) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_bin;", "CREATE TABLE `t` (\n `pk` int NOT NULL,\n `col1` varchar(100),\n PRIMARY KEY (`pk`),\n UNIQUE KEY `idx1` (`col1`)\n) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_bin;", @@ -1846,11 +1846,11 @@ var SchemaChangeTestsSchemaConflicts = []MergeScriptTest{ Assertions: []queries.ScriptTestAssertion{ { Query: "call dolt_merge('right');", - Expected: []sql.Row{{"", 0, 1, "conflicts found"}}, + Expected: []sql.UntypedSqlRow{{"", 0, 1, "conflicts found"}}, }, { Query: "select table_name, base_schema, our_schema, their_schema from dolt_schema_conflicts;", - Expected: []sql.Row{{"t", + Expected: []sql.UntypedSqlRow{{"t", "CREATE TABLE `t` (\n `pk` int NOT NULL,\n `col1` int,\n `col2` varchar(100),\n PRIMARY KEY (`pk`)\n) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_bin;", "CREATE TABLE `t` (\n `pk` int NOT NULL,\n `col1` int,\n `col2` varchar(100),\n PRIMARY KEY (`pk`),\n KEY `idx1` (`col2`)\n) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_bin;", "CREATE TABLE `t` (\n `pk` int NOT NULL,\n `col1` int,\n `col2` varchar(100),\n PRIMARY KEY (`pk`),\n KEY `idx1` (`col2`)\n) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_bin;", @@ -1874,11 +1874,11 @@ var SchemaChangeTestsSchemaConflicts = []MergeScriptTest{ Assertions: []queries.ScriptTestAssertion{ { Query: "call dolt_merge('right');", - Expected: []sql.Row{{"", 0, 1, "conflicts found"}}, + Expected: []sql.UntypedSqlRow{{"", 0, 1, "conflicts found"}}, }, { Query: "select table_name from dolt_schema_conflicts", - Expected: []sql.Row{{"t"}}, + Expected: []sql.UntypedSqlRow{{"t"}}, }, }, }, @@ -1897,11 +1897,11 @@ var SchemaChangeTestsSchemaConflicts = []MergeScriptTest{ Assertions: []queries.ScriptTestAssertion{ { Query: "call dolt_merge('right');", - Expected: []sql.Row{{"", 0, 1, "conflicts found"}}, + Expected: []sql.UntypedSqlRow{{"", 0, 1, "conflicts found"}}, }, { Query: "select table_name from dolt_schema_conflicts", - Expected: []sql.Row{{"t"}}, + Expected: []sql.UntypedSqlRow{{"t"}}, }, }, }, @@ -1922,11 +1922,11 @@ var SchemaChangeTestsSchemaConflicts = []MergeScriptTest{ Assertions: []queries.ScriptTestAssertion{ { Query: "call dolt_merge('right');", - Expected: []sql.Row{{"", 0, 1, "conflicts found"}}, + Expected: []sql.UntypedSqlRow{{"", 0, 1, "conflicts found"}}, }, { Query: "select table_name, our_schema, their_schema, base_schema from dolt_schema_conflicts;", - Expected: []sql.Row{{"t", + Expected: []sql.UntypedSqlRow{{"t", "CREATE TABLE `t` (\n `pk` int NOT NULL,\n `col1` int,\n PRIMARY KEY (`pk`)\n) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_bin;", "CREATE TABLE `t` (\n `pk` int NOT NULL,\n `col1` varchar(100),\n PRIMARY KEY (`pk`)\n) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_bin;", "CREATE TABLE `t` (\n `pk` int NOT NULL,\n `col1` int,\n PRIMARY KEY (`pk`)\n) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_bin;"}}, @@ -1950,11 +1950,11 @@ var SchemaChangeTestsSchemaConflicts = []MergeScriptTest{ Assertions: []queries.ScriptTestAssertion{ { Query: "call dolt_merge('right');", - Expected: []sql.Row{{"", 0, 1, "conflicts found"}}, + Expected: []sql.UntypedSqlRow{{"", 0, 1, "conflicts found"}}, }, { Query: "select table_name, our_schema, their_schema, base_schema from dolt_schema_conflicts;", - Expected: []sql.Row{{"t", + Expected: []sql.UntypedSqlRow{{"t", "CREATE TABLE `t` (\n `pk` int NOT NULL,\n `col1` int,\n PRIMARY KEY (`pk`),\n KEY `col1_idx` (`col1`)\n) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_bin;", "CREATE TABLE `t` (\n `pk` int NOT NULL,\n `col1` varchar(100),\n PRIMARY KEY (`pk`),\n KEY `col1_idx` (`col1`)\n) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_bin;", "CREATE TABLE `t` (\n `pk` int NOT NULL,\n `col1` int,\n PRIMARY KEY (`pk`),\n KEY `col1_idx` (`col1`)\n) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_bin;"}}, @@ -1978,7 +1978,7 @@ var SchemaChangeTestsSchemaConflicts = []MergeScriptTest{ Assertions: []queries.ScriptTestAssertion{ { Query: "call dolt_merge('right');", - Expected: []sql.Row{{doltCommit, 0, 0, "merge successful"}}, + Expected: []sql.UntypedSqlRow{{doltCommit, 0, 0, "merge successful"}}, }, }, }, @@ -2040,12 +2040,12 @@ var SchemaChangeTestsSchemaConflicts = []MergeScriptTest{ // See the comment above about why this should NOT report a conflict and why this is skipped Skip: true, Query: "call dolt_merge('right');", - Expected: []sql.Row{{doltCommit, 0, 0, "merge successful"}}, + Expected: []sql.UntypedSqlRow{{doltCommit, 0, 0, "merge successful"}}, }, { Skip: true, Query: "select pk, col2 from t;", - Expected: []sql.Row{{2, "200"}, {3, "300"}, {4, "400"}, {5, "500"}, {6, "600"}}, + Expected: []sql.UntypedSqlRow{{2, "200"}, {3, "300"}, {4, "400"}, {5, "500"}, {6, "600"}}, }, }, }, @@ -2067,15 +2067,15 @@ var SchemaChangeTestsSchemaConflicts = []MergeScriptTest{ Assertions: []queries.ScriptTestAssertion{ { Query: "call dolt_merge('right');", - Expected: []sql.Row{{doltCommit, 0, 0, "merge successful"}}, + Expected: []sql.UntypedSqlRow{{doltCommit, 0, 0, "merge successful"}}, }, { Query: "select * from t;", - Expected: []sql.Row{{1, 1, 0, nil}, {2, 2, 2, nil}, {3, 3, 0, nil}}, + Expected: []sql.UntypedSqlRow{{1, 1, 0, nil}, {2, 2, 2, nil}, {3, 3, 0, nil}}, }, { Query: "select pk, violation_type from dolt_constraint_violations_t", - Expected: []sql.Row{}, + Expected: []sql.UntypedSqlRow{}, }, }, }, @@ -2099,16 +2099,16 @@ var SchemaChangeTestsSchemaConflicts = []MergeScriptTest{ { SkipResultsCheck: true, Query: "call dolt_merge('right');", - Expected: []sql.Row{{"", 0, 0, "merge successful"}}, // non-symmetric result + Expected: []sql.UntypedSqlRow{{"", 0, 0, "merge successful"}}, // non-symmetric result }, { Skip: true, Query: "select * from t;", // fails with row(1,1,0,NULL) - Expected: []sql.Row{{1, 1, 1, nil}, {2, 2, 2, nil}, {3, 3, 0, nil}}, + Expected: []sql.UntypedSqlRow{{1, 1, 1, nil}, {2, 2, 2, nil}, {3, 3, 0, nil}}, }, { Query: "select pk, violation_type from dolt_constraint_violations_t", - Expected: []sql.Row{}, + Expected: []sql.UntypedSqlRow{}, }, }, }, @@ -2130,11 +2130,11 @@ var SchemaChangeTestsSchemaConflicts = []MergeScriptTest{ Assertions: []queries.ScriptTestAssertion{ { Query: "call dolt_merge('right');", - Expected: []sql.Row{{"", 0, 1, "conflicts found"}}, + Expected: []sql.UntypedSqlRow{{"", 0, 1, "conflicts found"}}, }, { Query: "select pk, col1 from t;", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {1, 9999}, {2, 9999}, {3, 30}, @@ -2143,7 +2143,7 @@ var SchemaChangeTestsSchemaConflicts = []MergeScriptTest{ }, { Query: "select pk, violation_type from dolt_constraint_violations_t", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {5, "not null"}, {6, "not null"}, }, @@ -2169,11 +2169,11 @@ var SchemaChangeTestsSchemaConflicts = []MergeScriptTest{ Assertions: []queries.ScriptTestAssertion{ { Query: "call dolt_merge('right');", - Expected: []sql.Row{{"", 0, 1, "conflicts found"}}, + Expected: []sql.UntypedSqlRow{{"", 0, 1, "conflicts found"}}, }, { Query: "select * from t;", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {1, 9999, 100}, {2, 9999, 100}, {3, 30, 200}, @@ -2182,7 +2182,7 @@ var SchemaChangeTestsSchemaConflicts = []MergeScriptTest{ }, { Query: "select pk, violation_type from dolt_constraint_violations_t", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {5, "not null"}, {6, "not null"}, }, @@ -2206,18 +2206,18 @@ var SchemaChangeTestsSchemaConflicts = []MergeScriptTest{ Assertions: []queries.ScriptTestAssertion{ { Query: "call dolt_merge('right');", - Expected: []sql.Row{{"", 0, 1, "conflicts found"}}, + Expected: []sql.UntypedSqlRow{{"", 0, 1, "conflicts found"}}, }, { Query: "select pk, col1 from t;", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {1, 0}, {2, 0}, }, }, { Query: "select violation_type, pk, violation_info from dolt_constraint_violations_t", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {"not null", 3, merge.NullViolationMeta{Columns: []string{"col1"}}}, }, }, @@ -2248,11 +2248,11 @@ var SchemaChangeTestsGeneratedColumns = []MergeScriptTest{ Assertions: []queries.ScriptTestAssertion{ { Query: "call dolt_merge('right');", - Expected: []sql.Row{{doltCommit, 0, 0, "merge successful"}}, + Expected: []sql.UntypedSqlRow{{doltCommit, 0, 0, "merge successful"}}, }, { Query: "select pk, col1, col2 from t;", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {1, 10, "10hello"}, {2, 20, "20hello"}, {3, 30, "30hello"}, {4, 40, "40hello"}, {5, 50, "50hello"}, {6, 60, "60hello"}}, @@ -2278,11 +2278,11 @@ var SchemaChangeTestsGeneratedColumns = []MergeScriptTest{ Assertions: []queries.ScriptTestAssertion{ { Query: "call dolt_merge('right');", - Expected: []sql.Row{{doltCommit, 0, 0, "merge successful"}}, + Expected: []sql.UntypedSqlRow{{doltCommit, 0, 0, "merge successful"}}, }, { Query: "select pk, col1, col2, col3 from t order by pk", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {1, 2, nil, nil}, {2, 3, 4, 5}, {3, 4, nil, nil}}, @@ -2309,11 +2309,11 @@ var SchemaChangeTestsGeneratedColumns = []MergeScriptTest{ Assertions: []queries.ScriptTestAssertion{ { Query: "call dolt_merge('right');", - Expected: []sql.Row{{doltCommit, 0, 0, "merge successful"}}, + Expected: []sql.UntypedSqlRow{{doltCommit, 0, 0, "merge successful"}}, }, { Query: "select pk, col1, col2, col3 from t;", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {1, 2, nil, nil}, {2, 3, 4, 5}, {3, 4, nil, nil}, @@ -2339,11 +2339,11 @@ var SchemaChangeTestsGeneratedColumns = []MergeScriptTest{ Assertions: []queries.ScriptTestAssertion{ { Query: "call dolt_merge('right');", - Expected: []sql.Row{{doltCommit, 0, 0, "merge successful"}}, + Expected: []sql.UntypedSqlRow{{doltCommit, 0, 0, "merge successful"}}, }, { Query: "select pk, col1 from t;", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {1, 2}, {2, 3}, {3, 4}, @@ -2369,11 +2369,11 @@ var SchemaChangeTestsGeneratedColumns = []MergeScriptTest{ Assertions: []queries.ScriptTestAssertion{ { Query: "call dolt_merge('right');", - Expected: []sql.Row{{doltCommit, 0, 0, "merge successful"}}, + Expected: []sql.UntypedSqlRow{{doltCommit, 0, 0, "merge successful"}}, }, { Query: "select pk, col1 from t;", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {1, 2}, {2, 3}, {3, 4}, @@ -2400,12 +2400,12 @@ var SchemaChangeTestsGeneratedColumns = []MergeScriptTest{ Assertions: []queries.ScriptTestAssertion{ { Query: "call dolt_merge('right');", - Expected: []sql.Row{{doltCommit, 0, 0, "merge successful"}}, + Expected: []sql.UntypedSqlRow{{doltCommit, 0, 0, "merge successful"}}, Skip: true, // this fails merging right into left }, { Query: "select pk, col1, col2 from t;", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {1, 101, "1hello"}, {2, 102, "2hello"}, {3, 103, "3hello"}, @@ -2436,12 +2436,12 @@ var SchemaChangeTestsGeneratedColumns = []MergeScriptTest{ Assertions: []queries.ScriptTestAssertion{ { Query: "call dolt_merge('right');", - Expected: []sql.Row{{doltCommit, 0, 0, "merge successful"}}, + Expected: []sql.UntypedSqlRow{{doltCommit, 0, 0, "merge successful"}}, Skip: true, // this fails merging right into left }, { Query: "select pk, col1, col2 from t;", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {1, 101, "1hello"}, {2, 102, "2hello"}, {3, 103, "3hello"}, @@ -2474,12 +2474,12 @@ var SchemaChangeTestsGeneratedColumns = []MergeScriptTest{ Assertions: []queries.ScriptTestAssertion{ { Query: "call dolt_merge('right');", - Expected: []sql.Row{{doltCommit, 0, 0, "merge successful"}}, + Expected: []sql.UntypedSqlRow{{doltCommit, 0, 0, "merge successful"}}, }, { Query: "show create table t;", Skip: true, // there should be an index on col3, but there isn't - Expected: []sql.Row{{"t", + Expected: []sql.UntypedSqlRow{{"t", "CREATE TABLE `t` (\n" + " `pk` int NOT NULL,\n" + " `col1` int NOT NULL,\n" + @@ -2490,7 +2490,7 @@ var SchemaChangeTestsGeneratedColumns = []MergeScriptTest{ }, { Query: "select * from t;", - Expected: []sql.Row{{1, -1000, 2}}, + Expected: []sql.UntypedSqlRow{{1, -1000, 2}}, }, }, }, @@ -2513,11 +2513,11 @@ var SchemaChangeTestsForJsonConflicts = []MergeScriptTest{ Assertions: []queries.ScriptTestAssertion{ { Query: "call dolt_merge('right');", - Expected: []sql.Row{{doltCommit, 0, 0, "merge successful"}}, + Expected: []sql.UntypedSqlRow{{doltCommit, 0, 0, "merge successful"}}, }, { Query: "select * from t;", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ { 1, `{"a": 1, "b": 2}`, }, @@ -2542,15 +2542,15 @@ var SchemaChangeTestsForJsonConflicts = []MergeScriptTest{ Assertions: []queries.ScriptTestAssertion{ { Query: "call dolt_merge('right');", - Expected: []sql.Row{{"", 0, 1, "conflicts found"}}, + Expected: []sql.UntypedSqlRow{{"", 0, 1, "conflicts found"}}, }, { Query: "select * from dolt_conflicts;", - Expected: []sql.Row{{"t", uint(1)}}, + Expected: []sql.UntypedSqlRow{{"t", uint(1)}}, }, { Query: "select base_j, our_j, their_j from dolt_conflicts_t;", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ { `{}`, `{"b": 2}`, `{"a": 1}`, }, diff --git a/go/libraries/doltcore/sqle/enginetest/dolt_queries_schema_override.go b/go/libraries/doltcore/sqle/enginetest/dolt_queries_schema_override.go index f42766f8eaf..25d753a50e6 100644 --- a/go/libraries/doltcore/sqle/enginetest/dolt_queries_schema_override.go +++ b/go/libraries/doltcore/sqle/enginetest/dolt_queries_schema_override.go @@ -44,18 +44,18 @@ var SchemaOverrideTests = []queries.ScriptTest{ { // use the tip of main for our response schemas Query: "SET @@dolt_override_schema=@commit3;", - Expected: []sql.Row{{}}, + Expected: []sql.UntypedSqlRow{{}}, }, { Query: "describe t;", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {"pk", "int", "NO", "PRI", nil, ""}, {"c2", "varchar(255)", "YES", "", nil, ""}, }, }, { Query: "select * from t;", - Expected: []sql.Row{{1, nil}, {2, "two"}}, + Expected: []sql.UntypedSqlRow{{1, nil}, {2, "two"}}, ExpectedColumns: sql.Schema{ { Name: "pk", @@ -70,11 +70,11 @@ var SchemaOverrideTests = []queries.ScriptTest{ { // use the first commit from main for our response schema (pk, c1) Query: "SET @@dolt_override_schema=@commit1;", - Expected: []sql.Row{{}}, + Expected: []sql.UntypedSqlRow{{}}, }, { Query: "select * from t;", - Expected: []sql.Row{{1, nil}, {2, nil}}, + Expected: []sql.UntypedSqlRow{{1, nil}, {2, nil}}, ExpectedColumns: sql.Schema{ { Name: "pk", @@ -89,7 +89,7 @@ var SchemaOverrideTests = []queries.ScriptTest{ { // Test retrieving a subset of the schema Query: "select pk from t;", - Expected: []sql.Row{{1}, {2}}, + Expected: []sql.UntypedSqlRow{{1}, {2}}, ExpectedColumns: sql.Schema{ { Name: "pk", @@ -100,7 +100,7 @@ var SchemaOverrideTests = []queries.ScriptTest{ { // Test retrieving the full schema, plus an extra literal column Query: "select pk, 42, c1 from t;", - Expected: []sql.Row{{1, 42, nil}, {2, 42, nil}}, + Expected: []sql.UntypedSqlRow{{1, 42, nil}, {2, 42, nil}}, ExpectedColumns: sql.Schema{ { Name: "pk", @@ -119,11 +119,11 @@ var SchemaOverrideTests = []queries.ScriptTest{ { // turn off the schema override Query: "SET @@dolt_override_schema=NULL;", - Expected: []sql.Row{{}}, + Expected: []sql.UntypedSqlRow{{}}, }, { Query: "select * from t;", - Expected: []sql.Row{{1, nil}, {2, "two"}}, + Expected: []sql.UntypedSqlRow{{1, nil}, {2, "two"}}, ExpectedColumns: sql.Schema{ { Name: "pk", @@ -159,11 +159,11 @@ var SchemaOverrideTests = []queries.ScriptTest{ { // use the tip of main for our response schema (pk, c1, c2, c3) Query: "SET @@dolt_override_schema=@commit3;", - Expected: []sql.Row{{}}, + Expected: []sql.UntypedSqlRow{{}}, }, { Query: "select * from t;", - Expected: []sql.Row{{1, "one", nil, nil}, {2, "two", "zwei", nil}, {3, "three", "drei", "tres"}}, + Expected: []sql.UntypedSqlRow{{1, "one", nil, nil}, {2, "two", "zwei", nil}, {3, "three", "drei", "tres"}}, ExpectedColumns: sql.Schema{ { Name: "pk", @@ -183,11 +183,11 @@ var SchemaOverrideTests = []queries.ScriptTest{ { // use the previous commit from main for our response schema (pk, c1, c2) Query: "SET @@dolt_override_schema=@commit2;", - Expected: []sql.Row{{}}, + Expected: []sql.UntypedSqlRow{{}}, }, { Query: "select * from t;", - Expected: []sql.Row{{1, "one", nil}, {2, "two", "zwei"}, {3, "three", "drei"}}, + Expected: []sql.UntypedSqlRow{{1, "one", nil}, {2, "two", "zwei"}, {3, "three", "drei"}}, ExpectedColumns: sql.Schema{ { Name: "pk", @@ -204,11 +204,11 @@ var SchemaOverrideTests = []queries.ScriptTest{ { // use the first commit from main for our response schemas (pk, c1) Query: "SET @@dolt_override_schema=@commit1;", - Expected: []sql.Row{{}}, + Expected: []sql.UntypedSqlRow{{}}, }, { Query: "select * from t;", - Expected: []sql.Row{{1, "one"}, {2, "two"}, {3, "three"}}, + Expected: []sql.UntypedSqlRow{{1, "one"}, {2, "two"}, {3, "three"}}, ExpectedColumns: sql.Schema{ { Name: "pk", @@ -241,11 +241,11 @@ var SchemaOverrideTests = []queries.ScriptTest{ { // use @commit2 response schema (pk, c1, c2, c3, c4, c6, c7) Query: "SET @@dolt_override_schema=@commit2;", - Expected: []sql.Row{{}}, + Expected: []sql.UntypedSqlRow{{}}, }, { Query: "select * from t;", - Expected: []sql.Row{{1, "one", nil, 3.0, "four", "six", uint32(7)}}, + Expected: []sql.UntypedSqlRow{{1, "one", nil, 3.0, "four", "six", uint32(7)}}, ExpectedColumns: sql.Schema{ { Name: "pk", @@ -274,11 +274,11 @@ var SchemaOverrideTests = []queries.ScriptTest{ { // use @commit2 response schema (pk, c1, c2, c3, c4, c5, c6, c7) Query: "SET @@dolt_override_schema=@commit1;", - Expected: []sql.Row{{}}, + Expected: []sql.UntypedSqlRow{{}}, }, { Query: "select * from t;", - Expected: []sql.Row{{1, "one", nil, 3.0, "four", nil, "six", uint32(7)}}, + Expected: []sql.UntypedSqlRow{{1, "one", nil, 3.0, "four", nil, "six", uint32(7)}}, ExpectedColumns: sql.Schema{ { Name: "pk", @@ -326,11 +326,11 @@ var SchemaOverrideTests = []queries.ScriptTest{ { // use the tip of main for our response schema (pk, c2) Query: "SET @@dolt_override_schema=@commit2;", - Expected: []sql.Row{{}}, + Expected: []sql.UntypedSqlRow{{}}, }, { Query: "select * from t;", - Expected: []sql.Row{{1, "one"}, {2, "two"}}, + Expected: []sql.UntypedSqlRow{{1, "one"}, {2, "two"}}, ExpectedColumns: sql.Schema{ { Name: "pk", @@ -343,11 +343,11 @@ var SchemaOverrideTests = []queries.ScriptTest{ }, { Query: "SET @@dolt_override_schema=@commit1;", - Expected: []sql.Row{{}}, + Expected: []sql.UntypedSqlRow{{}}, }, { Query: "select * from t;", - Expected: []sql.Row{{1, "one"}, {2, "two"}}, + Expected: []sql.UntypedSqlRow{{1, "one"}, {2, "two"}}, ExpectedColumns: sql.Schema{ { Name: "pk", @@ -383,7 +383,7 @@ var SchemaOverrideTests = []queries.ScriptTest{ { // Set an invalid commit that can't be resolved Query: "SET @@dolt_override_schema=doesNotExist;", - Expected: []sql.Row{{}}, + Expected: []sql.UntypedSqlRow{{}}, }, { Query: "select * from t;", @@ -397,7 +397,7 @@ var SchemaOverrideTests = []queries.ScriptTest{ { // Set an invalid ancestor spec Query: "SET @@dolt_override_schema='HEA~D~^~~~';", - Expected: []sql.Row{{}}, + Expected: []sql.UntypedSqlRow{{}}, }, { Query: "select * from t;", @@ -426,11 +426,11 @@ var SchemaOverrideTests = []queries.ScriptTest{ { // use the first commit for our response schema (pk, c1) Query: "SET @@dolt_override_schema=@commit1;", - Expected: []sql.Row{{}}, + Expected: []sql.UntypedSqlRow{{}}, }, { Query: "select * from t;", - Expected: []sql.Row{{1, "one"}, {2, "two"}}, + Expected: []sql.UntypedSqlRow{{1, "one"}, {2, "two"}}, ExpectedColumns: sql.Schema{ { Name: "pk", @@ -461,11 +461,11 @@ var SchemaOverrideTests = []queries.ScriptTest{ { // use the first commit for our response schema (pk, c1) Query: "SET @@dolt_override_schema=@commit1;", - Expected: []sql.Row{{}}, + Expected: []sql.UntypedSqlRow{{}}, }, { Query: "select * from t;", - Expected: []sql.Row{{1, "one", nil}, {2, "two", nil}}, + Expected: []sql.UntypedSqlRow{{1, "one", nil}, {2, "two", nil}}, ExpectedColumns: sql.Schema{ { Name: "pk", @@ -500,11 +500,11 @@ var SchemaOverrideTests = []queries.ScriptTest{ { // use the tip of main for our response schemas Query: "SET @@dolt_override_schema=@commit2;", - Expected: []sql.Row{{}}, + Expected: []sql.UntypedSqlRow{{}}, }, { Query: "select * from t;", - Expected: []sql.Row{{1, "one"}, {2, "two"}}, + Expected: []sql.UntypedSqlRow{{1, "one"}, {2, "two"}}, ExpectedColumns: sql.Schema{ { Name: "pk", @@ -517,11 +517,11 @@ var SchemaOverrideTests = []queries.ScriptTest{ }, { Query: "SET @@dolt_override_schema=@commit1;", - Expected: []sql.Row{{}}, + Expected: []sql.UntypedSqlRow{{}}, }, { Query: "select * from t;", - Expected: []sql.Row{{1, "one"}, {2, "two"}}, + Expected: []sql.UntypedSqlRow{{1, "one"}, {2, "two"}}, ExpectedColumns: sql.Schema{ { Name: "pk", @@ -551,11 +551,11 @@ var SchemaOverrideTests = []queries.ScriptTest{ { // use the tip of main for our response schemas (int, varchar(100)) Query: "SET @@dolt_override_schema=@commit2;", - Expected: []sql.Row{{}}, + Expected: []sql.UntypedSqlRow{{}}, }, { Query: "select * from t;", - Expected: []sql.Row{{1, "one"}, {2, "twotwotwotwotwotwo"}}, + Expected: []sql.UntypedSqlRow{{1, "one"}, {2, "twotwotwotwotwotwo"}}, ExpectedColumns: sql.Schema{ { Name: "pk", @@ -569,11 +569,11 @@ var SchemaOverrideTests = []queries.ScriptTest{ { // go back to the first commit, where the schema had a more narrow type (int, varchar(5)) Query: "SET @@dolt_override_schema=@commit1;", - Expected: []sql.Row{{}}, + Expected: []sql.UntypedSqlRow{{}}, }, { Query: "select * from t;", - Expected: []sql.Row{{1, "one"}, {2, "twotw"}}, + Expected: []sql.UntypedSqlRow{{1, "one"}, {2, "twotw"}}, ExpectedColumns: sql.Schema{ { Name: "pk", @@ -607,11 +607,11 @@ var SchemaOverrideTests = []queries.ScriptTest{ { // use the tip of main for our response schemas (int, int) Query: "SET @@dolt_override_schema=@commit2;", - Expected: []sql.Row{{}}, + Expected: []sql.UntypedSqlRow{{}}, }, { Query: "select * from t;", - Expected: []sql.Row{{1, nil}, {2, 2}}, + Expected: []sql.UntypedSqlRow{{1, nil}, {2, 2}}, ExpectedColumns: sql.Schema{ { Name: "pk", @@ -625,7 +625,7 @@ var SchemaOverrideTests = []queries.ScriptTest{ { // go back to the first commit, where the schema have an incompatible type (int, point) Query: "SET @@dolt_override_schema=@commit1;", - Expected: []sql.Row{{}}, + Expected: []sql.UntypedSqlRow{{}}, }, { Query: "select * from t;", @@ -647,11 +647,11 @@ var SchemaOverrideTests = []queries.ScriptTest{ Assertions: []queries.ScriptTestAssertion{ { Query: "SELECT * from addedTable;", - Expected: []sql.Row{{1, "one"}}, + Expected: []sql.UntypedSqlRow{{1, "one"}}, }, { Query: "SET @@dolt_override_schema=@commit1;", - Expected: []sql.Row{{}}, + Expected: []sql.UntypedSqlRow{{}}, }, { Query: "SELECT * from addedTable;", @@ -678,11 +678,11 @@ var SchemaOverrideTests = []queries.ScriptTest{ }, { Query: "SET @@dolt_override_schema=@commit1;", - Expected: []sql.Row{{}}, + Expected: []sql.UntypedSqlRow{{}}, }, { Query: "SELECT * from deletedTable;", - Expected: []sql.Row{}, + Expected: []sql.UntypedSqlRow{}, }, }, }, @@ -705,11 +705,11 @@ var SchemaOverrideTests = []queries.ScriptTest{ }, { Query: "SET @@dolt_override_schema=@commit1;", - Expected: []sql.Row{{}}, + Expected: []sql.UntypedSqlRow{{}}, }, { Query: "SELECT * from deletedTable AS OF @commit2;", - Expected: []sql.Row{}, + Expected: []sql.UntypedSqlRow{}, }, }, }, @@ -732,35 +732,35 @@ var SchemaOverrideTests = []queries.ScriptTest{ { // Going back to @commit1 with AS OF should use the available index Query: "SELECT c1 from t as of @commit1 where c1 > 'o';", - Expected: []sql.Row{{"one"}}, + Expected: []sql.UntypedSqlRow{{"one"}}, ExpectedIndexes: []string{"c1_idx"}, }, { // The tip of HEAD does not have an index Query: "SELECT c1 from t where c1 > 'o';", - Expected: []sql.Row{{"two"}}, + Expected: []sql.UntypedSqlRow{{"two"}}, ExpectedIndexes: []string{}, }, { // Set the overridden schema to the point where an index existed Query: "SET @@dolt_override_schema=@commit1;", - Expected: []sql.Row{{}}, + Expected: []sql.UntypedSqlRow{{}}, }, { // Using the overridden index, we should still get the latest data, but without using the index Query: "SELECT c1 from t where c1 > 'o';", - Expected: []sql.Row{{"two"}}, + Expected: []sql.UntypedSqlRow{{"two"}}, ExpectedIndexes: []string{}, }, { // Set the overridden schema to the point where an index existed Query: "SET @@dolt_override_schema=@commit2;", - Expected: []sql.Row{{}}, + Expected: []sql.UntypedSqlRow{{}}, }, { // Going back to @commit1 for data, but using @commit2 for schema Query: "SELECT c1 from t as of @commit1 where c1 > 'o';", - Expected: []sql.Row{{"one"}}, + Expected: []sql.UntypedSqlRow{{"one"}}, ExpectedIndexes: []string{}, }, }, @@ -788,11 +788,11 @@ var SchemaOverrideTests = []queries.ScriptTest{ { // use the tip of main for our response schemas Query: "SET @@dolt_override_schema=@commit3;", - Expected: []sql.Row{{}}, + Expected: []sql.UntypedSqlRow{{}}, }, { Query: "select * from t as of @commit1;", - Expected: []sql.Row{{1, nil}}, + Expected: []sql.UntypedSqlRow{{1, nil}}, ExpectedColumns: sql.Schema{ { Name: "pk", @@ -807,11 +807,11 @@ var SchemaOverrideTests = []queries.ScriptTest{ { // use the previous commit from main for our response schemas Query: "SET @@dolt_override_schema=@commit1;", - Expected: []sql.Row{{}}, + Expected: []sql.UntypedSqlRow{{}}, }, { Query: "select * from t as of @commit2;", - Expected: []sql.Row{{1, nil}}, + Expected: []sql.UntypedSqlRow{{1, nil}}, ExpectedColumns: sql.Schema{ { Name: "pk", @@ -825,7 +825,7 @@ var SchemaOverrideTests = []queries.ScriptTest{ }, { Query: "select * from t as of @commit3;", - Expected: []sql.Row{{1, nil}, {2, nil}}, + Expected: []sql.UntypedSqlRow{{1, nil}, {2, nil}}, ExpectedColumns: sql.Schema{ { Name: "pk", @@ -865,11 +865,11 @@ var SchemaOverrideTests = []queries.ScriptTest{ { // use the most recent commit for our response schemas (pk, c2) Query: "SET @@dolt_override_schema=@commit3;", - Expected: []sql.Row{{}}, + Expected: []sql.UntypedSqlRow{{}}, }, { Query: "select * from `mydb/branch3`.t as of @commit1;", - Expected: []sql.Row{{1, nil}}, + Expected: []sql.UntypedSqlRow{{1, nil}}, ExpectedColumns: sql.Schema{ { Name: "pk", @@ -884,11 +884,11 @@ var SchemaOverrideTests = []queries.ScriptTest{ { // use the first commit from main for our response schemas (pk, c1) Query: "SET @@dolt_override_schema=@commit1;", - Expected: []sql.Row{{}}, + Expected: []sql.UntypedSqlRow{{}}, }, { Query: "select * from `mydb/branch3`.t as of @commit2;", - Expected: []sql.Row{{1, nil}}, + Expected: []sql.UntypedSqlRow{{1, nil}}, ExpectedColumns: sql.Schema{ { Name: "pk", @@ -902,7 +902,7 @@ var SchemaOverrideTests = []queries.ScriptTest{ }, { Query: "select * from `mydb/branch2`.t;", - Expected: []sql.Row{{1, nil}}, + Expected: []sql.UntypedSqlRow{{1, nil}}, ExpectedColumns: sql.Schema{ { Name: "pk", @@ -940,11 +940,11 @@ var SchemaOverrideTests = []queries.ScriptTest{ { // use the most recent commit for our response schemas (pk, c2) Query: "SET @@dolt_override_schema=@commit3;", - Expected: []sql.Row{{}}, + Expected: []sql.UntypedSqlRow{{}}, }, { Query: "select * from `mydb/commit3`.t as of @commit1;", - Expected: []sql.Row{{1, nil}}, + Expected: []sql.UntypedSqlRow{{1, nil}}, ExpectedColumns: sql.Schema{ { Name: "pk", @@ -959,11 +959,11 @@ var SchemaOverrideTests = []queries.ScriptTest{ { // use the first commit from main for our response schemas (pk, c1) Query: "SET @@dolt_override_schema=@commit1;", - Expected: []sql.Row{{}}, + Expected: []sql.UntypedSqlRow{{}}, }, { Query: "select * from `mydb/commit3`.t as of @commit2;", - Expected: []sql.Row{{1, nil}}, + Expected: []sql.UntypedSqlRow{{1, nil}}, ExpectedColumns: sql.Schema{ { Name: "pk", @@ -977,7 +977,7 @@ var SchemaOverrideTests = []queries.ScriptTest{ }, { Query: "select * from `mydb/commit2`.t;", - Expected: []sql.Row{{1, nil}}, + Expected: []sql.UntypedSqlRow{{1, nil}}, ExpectedColumns: sql.Schema{ { Name: "pk", @@ -1012,11 +1012,11 @@ var SchemaOverrideTests = []queries.ScriptTest{ { // use the most recent commit for our response schemas (pk, c2) Query: "SET @@dolt_override_schema=@commit3;", - Expected: []sql.Row{{}}, + Expected: []sql.UntypedSqlRow{{}}, }, { Query: "select * from `mydb/main`.t as of @commit1;", - Expected: []sql.Row{{1, nil}}, + Expected: []sql.UntypedSqlRow{{1, nil}}, ExpectedColumns: sql.Schema{ { Name: "pk", @@ -1031,11 +1031,11 @@ var SchemaOverrideTests = []queries.ScriptTest{ { // use the first commit from main for our response schemas (pk, c1) Query: "SET @@dolt_override_schema=@commit1;", - Expected: []sql.Row{{}}, + Expected: []sql.UntypedSqlRow{{}}, }, { Query: "select * from `mydb/main`.t as of @commit2;", - Expected: []sql.Row{{1, nil}}, + Expected: []sql.UntypedSqlRow{{1, nil}}, ExpectedColumns: sql.Schema{ { Name: "pk", @@ -1049,7 +1049,7 @@ var SchemaOverrideTests = []queries.ScriptTest{ }, { Query: "select * from `mydb/main~`.t;", - Expected: []sql.Row{{1, nil}}, + Expected: []sql.UntypedSqlRow{{1, nil}}, ExpectedColumns: sql.Schema{ { Name: "pk", @@ -1085,11 +1085,11 @@ var SchemaOverrideTests = []queries.ScriptTest{ { // use the tip of main for our response schema (pk, c2) Query: "SET @@dolt_override_schema=@commit1;", - Expected: []sql.Row{{}}, + Expected: []sql.UntypedSqlRow{{}}, }, { Query: "SELECT * from t1 JOIN t2 on t1.pk = t2.c1;", - Expected: []sql.Row{{1, "one", 100, 1, "blue"}}, + Expected: []sql.UntypedSqlRow{{1, "one", 100, 1, "blue"}}, ExpectedColumns: sql.Schema{ { Name: "pk", @@ -1130,11 +1130,11 @@ var SchemaOverrideTests = []queries.ScriptTest{ { // Before @@dolt_override_schema is applied, we can executed DDL and update/insert statements Query: "create table t2 (pk int primary key, c1 JSON);", - Expected: []sql.Row{{gmstypes.NewOkResult(0)}}, + Expected: []sql.UntypedSqlRow{{gmstypes.NewOkResult(0)}}, }, { Query: "SET @@dolt_override_schema=@commit1;", - Expected: []sql.Row{{}}, + Expected: []sql.UntypedSqlRow{{}}, }, { // After @@dolt_override_schema is applied, DDL statements error out @@ -1149,12 +1149,12 @@ var SchemaOverrideTests = []queries.ScriptTest{ { // Turn off the schema override Query: "SET @@dolt_override_schema=NULL;", - Expected: []sql.Row{{}}, + Expected: []sql.UntypedSqlRow{{}}, }, { // Insert statements work again after turning off the schema override Query: "insert into t1 values (3, NULL);", - Expected: []sql.Row{{gmstypes.NewOkResult(1)}}, + Expected: []sql.UntypedSqlRow{{gmstypes.NewOkResult(1)}}, }, }, }, @@ -1181,12 +1181,12 @@ var SchemaOverrideTests = []queries.ScriptTest{ { // use the first commit for our schema override (pk, c1) Query: "SET @@dolt_override_schema=@commit1;", - Expected: []sql.Row{{}}, + Expected: []sql.UntypedSqlRow{{}}, }, { // sanity check that the schema override is working, before testing the system tables Query: "select * from t;", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {1, nil}, {2, nil}, }, @@ -1203,7 +1203,7 @@ var SchemaOverrideTests = []queries.ScriptTest{ }, { Query: "select pk, commit, committer, message from dolt_blame_t;", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {1, doltCommit, "root", "dropping column c1 on main"}, {2, doltCommit, "root", "adding column c2 on main"}, }, @@ -1228,7 +1228,7 @@ var SchemaOverrideTests = []queries.ScriptTest{ }, { Query: "select from_pk, from_c2, to_pk, to_c2, from_commit, to_commit, diff_type from dolt_diff_t;", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {nil, nil, 2, "two", doltCommit, doltCommit, "added"}, {1, nil, 1, nil, doltCommit, doltCommit, "modified"}, {nil, nil, 1, nil, doltCommit, doltCommit, "added"}, @@ -1266,7 +1266,7 @@ var SchemaOverrideTests = []queries.ScriptTest{ }, { Query: "select to_pk, to_c2, to_commit, from_pk, from_c2, from_commit, diff_type from dolt_commit_diff_t where from_commit=@commit1 and to_commit=@commit3;", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {1, nil, doltCommit, 1, nil, doltCommit, "modified"}, {2, "two", doltCommit, nil, nil, doltCommit, "added"}, }, @@ -1303,7 +1303,7 @@ var SchemaOverrideTests = []queries.ScriptTest{ }, { Query: "select pk, c2, commit_hash, committer from dolt_history_t;", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {1, nil, doltCommit, "root"}, {2, "two", doltCommit, "root"}, {1, nil, doltCommit, "root"}, @@ -1332,7 +1332,7 @@ var SchemaOverrideTests = []queries.ScriptTest{ // sanity check that the schema override is still working, after testing the system tables // (system tables don't honor schema overrides, so we make sure they don't disable them either) Query: "select * from t;", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {1, nil}, {2, nil}, }, diff --git a/go/libraries/doltcore/sqle/enginetest/dolt_queries_verify_constraints.go b/go/libraries/doltcore/sqle/enginetest/dolt_queries_verify_constraints.go index 288a38a04f6..ade544878f8 100644 --- a/go/libraries/doltcore/sqle/enginetest/dolt_queries_verify_constraints.go +++ b/go/libraries/doltcore/sqle/enginetest/dolt_queries_verify_constraints.go @@ -104,19 +104,19 @@ var DoltVerifyConstraintsTestScripts = []queries.ScriptTest{ Assertions: []queries.ScriptTestAssertion{ { Query: "CALL DOLT_VERIFY_CONSTRAINTS('child1')", - Expected: []sql.Row{{0}}, + Expected: []sql.UntypedSqlRow{{0}}, }, { Query: "SELECT * from dolt_constraint_violations", - Expected: []sql.Row{}, + Expected: []sql.UntypedSqlRow{}, }, { Query: "CALL DOLT_VERIFY_CONSTRAINTS('--all', 'child1');", - Expected: []sql.Row{{0}}, + Expected: []sql.UntypedSqlRow{{0}}, }, { Query: "SELECT * from dolt_constraint_violations", - Expected: []sql.Row{}, + Expected: []sql.UntypedSqlRow{}, }, }, }, @@ -130,11 +130,11 @@ var DoltVerifyConstraintsTestScripts = []queries.ScriptTest{ }, { Query: "CALL DOLT_VERIFY_CONSTRAINTS();", - Expected: []sql.Row{{1}}, + Expected: []sql.UntypedSqlRow{{1}}, }, { Query: "SELECT * from dolt_constraint_violations;", - Expected: []sql.Row{{"child3", uint64(1)}, {"child4", uint64(1)}}, + Expected: []sql.UntypedSqlRow{{"child3", uint64(1)}, {"child4", uint64(1)}}, }, }, }, @@ -148,11 +148,11 @@ var DoltVerifyConstraintsTestScripts = []queries.ScriptTest{ }, { Query: "CALL DOLT_VERIFY_CONSTRAINTS('child3');", - Expected: []sql.Row{{1}}, + Expected: []sql.UntypedSqlRow{{1}}, }, { Query: "SELECT * from dolt_constraint_violations;", - Expected: []sql.Row{{"child3", uint64(1)}}, + Expected: []sql.UntypedSqlRow{{"child3", uint64(1)}}, }, }, }, @@ -166,11 +166,11 @@ var DoltVerifyConstraintsTestScripts = []queries.ScriptTest{ }, { Query: "CALL DOLT_VERIFY_CONSTRAINTS('child3', 'child4');", - Expected: []sql.Row{{1}}, + Expected: []sql.UntypedSqlRow{{1}}, }, { Query: "SELECT * from dolt_constraint_violations;", - Expected: []sql.Row{{"child3", uint64(1)}, {"child4", uint64(1)}}, + Expected: []sql.UntypedSqlRow{{"child3", uint64(1)}, {"child4", uint64(1)}}, }, }, }, @@ -184,11 +184,11 @@ var DoltVerifyConstraintsTestScripts = []queries.ScriptTest{ }, { Query: "CALL DOLT_VERIFY_CONSTRAINTS('--all');", - Expected: []sql.Row{{1}}, + Expected: []sql.UntypedSqlRow{{1}}, }, { Query: "SELECT * from dolt_constraint_violations;", - Expected: []sql.Row{{"child3", uint64(2)}, {"child4", uint64(2)}}, + Expected: []sql.UntypedSqlRow{{"child3", uint64(2)}, {"child4", uint64(2)}}, }, }, }, @@ -202,11 +202,11 @@ var DoltVerifyConstraintsTestScripts = []queries.ScriptTest{ }, { Query: "CALL DOLT_VERIFY_CONSTRAINTS('--all', 'child3');", - Expected: []sql.Row{{1}}, + Expected: []sql.UntypedSqlRow{{1}}, }, { Query: "SELECT * from dolt_constraint_violations;", - Expected: []sql.Row{{"child3", uint64(2)}}, + Expected: []sql.UntypedSqlRow{{"child3", uint64(2)}}, }, }, }, @@ -220,11 +220,11 @@ var DoltVerifyConstraintsTestScripts = []queries.ScriptTest{ }, { Query: "CALL DOLT_VERIFY_CONSTRAINTS('--all', 'child3', 'child4');", - Expected: []sql.Row{{1}}, + Expected: []sql.UntypedSqlRow{{1}}, }, { Query: "SELECT * from dolt_constraint_violations;", - Expected: []sql.Row{{"child3", uint64(2)}, {"child4", uint64(2)}}, + Expected: []sql.UntypedSqlRow{{"child3", uint64(2)}, {"child4", uint64(2)}}, }, }, }, @@ -234,11 +234,11 @@ var DoltVerifyConstraintsTestScripts = []queries.ScriptTest{ Assertions: []queries.ScriptTestAssertion{ { Query: "CALL DOLT_VERIFY_CONSTRAINTS('--output-only', 'child3', 'child4');", - Expected: []sql.Row{{1}}, + Expected: []sql.UntypedSqlRow{{1}}, }, { Query: "SELECT * from dolt_constraint_violations;", - Expected: []sql.Row{}, + Expected: []sql.UntypedSqlRow{}, }, }, }, @@ -248,11 +248,11 @@ var DoltVerifyConstraintsTestScripts = []queries.ScriptTest{ Assertions: []queries.ScriptTestAssertion{ { Query: "CALL DOLT_VERIFY_CONSTRAINTS('--all', '--output-only', 'child3', 'child4');", - Expected: []sql.Row{{1}}, + Expected: []sql.UntypedSqlRow{{1}}, }, { Query: "SELECT * from dolt_constraint_violations;", - Expected: []sql.Row{}, + Expected: []sql.UntypedSqlRow{}, }, }, }, @@ -269,11 +269,11 @@ var DoltVerifyConstraintsTestScripts = []queries.ScriptTest{ Assertions: []queries.ScriptTestAssertion{ { Query: "call DOLT_VERIFY_CONSTRAINTS('--all');", - Expected: []sql.Row{{0}}, + Expected: []sql.UntypedSqlRow{{0}}, }, { Query: "select * from dolt_constraint_violations;", - Expected: []sql.Row{}, + Expected: []sql.UntypedSqlRow{}, }, }, }, @@ -291,11 +291,11 @@ var DoltVerifyConstraintsTestScripts = []queries.ScriptTest{ Assertions: []queries.ScriptTestAssertion{ { Query: "call DOLT_VERIFY_CONSTRAINTS('--all');", - Expected: []sql.Row{{1}}, + Expected: []sql.UntypedSqlRow{{1}}, }, { Query: "select * from dolt_constraint_violations;", - Expected: []sql.Row{{"child", uint64(1)}}, + Expected: []sql.UntypedSqlRow{{"child", uint64(1)}}, }, }, }, @@ -311,7 +311,7 @@ var DoltVerifyConstraintsTestScripts = []queries.ScriptTest{ Assertions: []queries.ScriptTestAssertion{ { Query: "CALL DOLT_VERIFY_CONSTRAINTS('child')", - Expected: []sql.Row{{0}}, + Expected: []sql.UntypedSqlRow{{0}}, }, { Query: "set foreign_key_checks = 0;", @@ -319,7 +319,7 @@ var DoltVerifyConstraintsTestScripts = []queries.ScriptTest{ }, { Query: "insert into child values (3, 30, 30);", - Expected: []sql.Row{{types.OkResult{RowsAffected: 1}}}, + Expected: []sql.UntypedSqlRow{{types.OkResult{RowsAffected: 1}}}, }, { Query: "set foreign_key_checks = 1;", @@ -327,7 +327,7 @@ var DoltVerifyConstraintsTestScripts = []queries.ScriptTest{ }, { Query: "CALL DOLT_VERIFY_CONSTRAINTS('child')", - Expected: []sql.Row{{1}}, + Expected: []sql.UntypedSqlRow{{1}}, }, }, }, @@ -340,39 +340,39 @@ var DoltVerifyConstraintsTestScripts = []queries.ScriptTest{ { // merge with --squash so that our working set has the constraint violations Query: "call dolt_merge('main', '--squash');", - Expected: []sql.Row{{"", 0, 1, "conflicts found"}}, + Expected: []sql.UntypedSqlRow{{"", 0, 1, "conflicts found"}}, }, { Query: "select * from t;", - Expected: []sql.Row{{1, 1}, {2, 1}}, + Expected: []sql.UntypedSqlRow{{1, 1}, {2, 1}}, }, { Query: "select * from dolt_constraint_violations;", - Expected: []sql.Row{{"t", uint64(2)}}, + Expected: []sql.UntypedSqlRow{{"t", uint64(2)}}, }, { Query: "select violation_type, pk, col1, cast(violation_info as char) as violation_info from dolt_constraint_violations_t;", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {"unique index", 1, 1, `{"Name": "col1", "Columns": ["col1"]}`}, {"unique index", 2, 1, `{"Name": "col1", "Columns": ["col1"]}`}, }, }, { Query: "delete from dolt_constraint_violations_t;", - Expected: []sql.Row{{types.NewOkResult(2)}}, + Expected: []sql.UntypedSqlRow{{types.NewOkResult(2)}}, }, { // verify constraints in working set Query: "call dolt_verify_constraints();", - Expected: []sql.Row{{1}}, + Expected: []sql.UntypedSqlRow{{1}}, }, { Query: "select * from dolt_constraint_violations;", - Expected: []sql.Row{{"t", uint64(2)}}, + Expected: []sql.UntypedSqlRow{{"t", uint64(2)}}, }, { Query: "select violation_type, pk, col1, cast(violation_info as char) as violation_info from dolt_constraint_violations_t;", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {"unique index", 1, 1, `{"Name": "col1", "Columns": ["col1"]}`}, {"unique index", 2, 1, `{"Name": "col1", "Columns": ["col1"]}`}, }, @@ -385,48 +385,48 @@ var DoltVerifyConstraintsTestScripts = []queries.ScriptTest{ Assertions: []queries.ScriptTestAssertion{ { Query: "call dolt_merge('main');", - Expected: []sql.Row{{"", 0, 1, "conflicts found"}}, + Expected: []sql.UntypedSqlRow{{"", 0, 1, "conflicts found"}}, }, { Query: "call dolt_commit('-am', 'commiting with conflicts', '--force');", - Expected: []sql.Row{{doltCommit}}, + Expected: []sql.UntypedSqlRow{{doltCommit}}, }, { Query: "select * from t;", - Expected: []sql.Row{{1, 1}, {2, 1}}, + Expected: []sql.UntypedSqlRow{{1, 1}, {2, 1}}, }, { Query: "select * from dolt_constraint_violations;", - Expected: []sql.Row{{"t", uint64(2)}}, + Expected: []sql.UntypedSqlRow{{"t", uint64(2)}}, }, { Query: "select violation_type, pk, col1, cast(violation_info as char) as violation_info from dolt_constraint_violations_t;", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {"unique index", 1, 1, `{"Name": "col1", "Columns": ["col1"]}`}, {"unique index", 2, 1, `{"Name": "col1", "Columns": ["col1"]}`}, }, }, { Query: "delete from dolt_constraint_violations_t;", - Expected: []sql.Row{{types.NewOkResult(2)}}, + Expected: []sql.UntypedSqlRow{{types.NewOkResult(2)}}, }, { // no violations in the working set Query: "call dolt_verify_constraints();", - Expected: []sql.Row{{0}}, + Expected: []sql.UntypedSqlRow{{0}}, }, { // one unique violation in all the data Query: "call dolt_verify_constraints('--all');", - Expected: []sql.Row{{1}}, + Expected: []sql.UntypedSqlRow{{1}}, }, { Query: "select * from dolt_constraint_violations;", - Expected: []sql.Row{{"t", uint64(2)}}, + Expected: []sql.UntypedSqlRow{{"t", uint64(2)}}, }, { Query: "select violation_type, pk, col1, cast(violation_info as char) as violation_info from dolt_constraint_violations_t;", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {"unique index", 1, 1, `{"Name": "col1", "Columns": ["col1"]}`}, {"unique index", 2, 1, `{"Name": "col1", "Columns": ["col1"]}`}, }, @@ -440,39 +440,39 @@ var DoltVerifyConstraintsTestScripts = []queries.ScriptTest{ { // merge with --squash so that our working set has the constraint violations Query: "call dolt_merge('main', '--squash');", - Expected: []sql.Row{{"", 0, 1, "conflicts found"}}, + Expected: []sql.UntypedSqlRow{{"", 0, 1, "conflicts found"}}, }, { Query: "select * from t;", - Expected: []sql.Row{{1, 1}, {2, 1}}, + Expected: []sql.UntypedSqlRow{{1, 1}, {2, 1}}, }, { Query: "select * from dolt_constraint_violations;", - Expected: []sql.Row{{"t", uint64(2)}}, + Expected: []sql.UntypedSqlRow{{"t", uint64(2)}}, }, { Query: "select violation_type, pk, col1, cast(violation_info as char) as violation_info from dolt_constraint_violations_t;", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {"unique index", 1, 1, `{"Name": "col1", "Columns": ["col1"]}`}, {"unique index", 2, 1, `{"Name": "col1", "Columns": ["col1"]}`}, }, }, { Query: "delete from dolt_constraint_violations_t;", - Expected: []sql.Row{{types.NewOkResult(2)}}, + Expected: []sql.UntypedSqlRow{{types.NewOkResult(2)}}, }, { // verify constraints in working set Query: "call dolt_verify_constraints('t');", - Expected: []sql.Row{{1}}, + Expected: []sql.UntypedSqlRow{{1}}, }, { Query: "select * from dolt_constraint_violations;", - Expected: []sql.Row{{"t", uint64(2)}}, + Expected: []sql.UntypedSqlRow{{"t", uint64(2)}}, }, { Query: "select violation_type, pk, col1, cast(violation_info as char) as violation_info from dolt_constraint_violations_t;", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {"unique index", 1, 1, `{"Name": "col1", "Columns": ["col1"]}`}, {"unique index", 2, 1, `{"Name": "col1", "Columns": ["col1"]}`}, }, @@ -486,36 +486,36 @@ var DoltVerifyConstraintsTestScripts = []queries.ScriptTest{ { // merge with --squash so that our working set has the constraint violations Query: "call dolt_merge('main', '--squash');", - Expected: []sql.Row{{"", 0, 1, "conflicts found"}}, + Expected: []sql.UntypedSqlRow{{"", 0, 1, "conflicts found"}}, }, { Query: "select * from t;", - Expected: []sql.Row{{1, 1}, {2, 1}}, + Expected: []sql.UntypedSqlRow{{1, 1}, {2, 1}}, }, { Query: "select * from dolt_constraint_violations;", - Expected: []sql.Row{{"t", uint64(2)}}, + Expected: []sql.UntypedSqlRow{{"t", uint64(2)}}, }, { Query: "select violation_type, pk, col1, cast(violation_info as char) as violation_info from dolt_constraint_violations_t;", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {"unique index", 1, 1, `{"Name": "col1", "Columns": ["col1"]}`}, {"unique index", 2, 1, `{"Name": "col1", "Columns": ["col1"]}`}, }, }, { Query: "delete from dolt_constraint_violations_t;", - Expected: []sql.Row{{types.NewOkResult(2)}}, + Expected: []sql.UntypedSqlRow{{types.NewOkResult(2)}}, }, { // verify constraints in working set Query: "call dolt_verify_constraints('otherTable');", - Expected: []sql.Row{{0}}, + Expected: []sql.UntypedSqlRow{{0}}, }, { // Nothing in dolt_constraint_violations because we only verified otherTable Query: "select * from dolt_constraint_violations;", - Expected: []sql.Row{}, + Expected: []sql.UntypedSqlRow{}, }, }, }, @@ -525,45 +525,45 @@ var DoltVerifyConstraintsTestScripts = []queries.ScriptTest{ Assertions: []queries.ScriptTestAssertion{ { Query: "call dolt_merge('main');", - Expected: []sql.Row{{"", 0, 1, "conflicts found"}}, + Expected: []sql.UntypedSqlRow{{"", 0, 1, "conflicts found"}}, }, { Query: "call dolt_commit('-am', 'commiting with conflicts', '--force');", - Expected: []sql.Row{{doltCommit}}, + Expected: []sql.UntypedSqlRow{{doltCommit}}, }, { Query: "select * from t;", - Expected: []sql.Row{{1, 1}, {2, 1}}, + Expected: []sql.UntypedSqlRow{{1, 1}, {2, 1}}, }, { Query: "select * from dolt_constraint_violations;", - Expected: []sql.Row{{"t", uint64(2)}}, + Expected: []sql.UntypedSqlRow{{"t", uint64(2)}}, }, { Query: "select violation_type, pk, col1, cast(violation_info as char) as violation_info from dolt_constraint_violations_t;", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {"unique index", 1, 1, `{"Name": "col1", "Columns": ["col1"]}`}, {"unique index", 2, 1, `{"Name": "col1", "Columns": ["col1"]}`}, }, }, { Query: "delete from dolt_constraint_violations_t;", - Expected: []sql.Row{{types.NewOkResult(2)}}, + Expected: []sql.UntypedSqlRow{{types.NewOkResult(2)}}, }, { // no violations in the working set Query: "call dolt_verify_constraints();", - Expected: []sql.Row{{0}}, + Expected: []sql.UntypedSqlRow{{0}}, }, { // one unique violation in all the data Query: "call dolt_verify_constraints('--all', '--output-only');", - Expected: []sql.Row{{1}}, + Expected: []sql.UntypedSqlRow{{1}}, }, { // no output recorded because of --output-only Query: "select * from dolt_constraint_violations;", - Expected: []sql.Row{}, + Expected: []sql.UntypedSqlRow{}, }, }, }, @@ -576,38 +576,38 @@ var DoltVerifyConstraintsTestScripts = []queries.ScriptTest{ { // merge with --squash so that our working set has the constraint violations Query: "call dolt_merge('main', '--squash');", - Expected: []sql.Row{{"", 0, 1, "conflicts found"}}, + Expected: []sql.UntypedSqlRow{{"", 0, 1, "conflicts found"}}, }, { Query: "select * from t;", - Expected: []sql.Row{{1, 42, 42}}, + Expected: []sql.UntypedSqlRow{{1, 42, 42}}, }, { Query: "select * from dolt_constraint_violations;", - Expected: []sql.Row{{"t", uint64(1)}}, + Expected: []sql.UntypedSqlRow{{"t", uint64(1)}}, }, { Query: "select violation_type, pk, col1, cast(violation_info as char) as violation_info from dolt_constraint_violations_t;", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {"check constraint", 1, 42, `{"Name": "t_chk_5eebhnk4", "Expression": "(NOT((col1 = col2)))"}`}, }, }, { Query: "delete from dolt_constraint_violations_t;", - Expected: []sql.Row{{types.NewOkResult(1)}}, + Expected: []sql.UntypedSqlRow{{types.NewOkResult(1)}}, }, { // verify constraints in working set Query: "call dolt_verify_constraints();", - Expected: []sql.Row{{1}}, + Expected: []sql.UntypedSqlRow{{1}}, }, { Query: "select * from dolt_constraint_violations;", - Expected: []sql.Row{{"t", uint64(1)}}, + Expected: []sql.UntypedSqlRow{{"t", uint64(1)}}, }, { Query: "select violation_type, pk, col1, cast(violation_info as char) as violation_info from dolt_constraint_violations_t;", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {"check constraint", 1, 42, `{"Name": "t_chk_5eebhnk4", "Expression": "(NOT((col1 = col2)))"}`}, }, }, @@ -619,47 +619,47 @@ var DoltVerifyConstraintsTestScripts = []queries.ScriptTest{ Assertions: []queries.ScriptTestAssertion{ { Query: "call dolt_merge('main');", - Expected: []sql.Row{{"", 0, 1, "conflicts found"}}, + Expected: []sql.UntypedSqlRow{{"", 0, 1, "conflicts found"}}, }, { Query: "call dolt_commit('-am', 'commiting with conflicts', '--force');", - Expected: []sql.Row{{doltCommit}}, + Expected: []sql.UntypedSqlRow{{doltCommit}}, }, { Query: "select * from t;", - Expected: []sql.Row{{1, 42, 42}}, + Expected: []sql.UntypedSqlRow{{1, 42, 42}}, }, { Query: "select * from dolt_constraint_violations;", - Expected: []sql.Row{{"t", uint64(1)}}, + Expected: []sql.UntypedSqlRow{{"t", uint64(1)}}, }, { Query: "select violation_type, pk, col1, cast(violation_info as char) as violation_info from dolt_constraint_violations_t;", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {"check constraint", 1, 42, `{"Name": "t_chk_5eebhnk4", "Expression": "(NOT((col1 = col2)))"}`}, }, }, { Query: "delete from dolt_constraint_violations_t;", - Expected: []sql.Row{{types.NewOkResult(1)}}, + Expected: []sql.UntypedSqlRow{{types.NewOkResult(1)}}, }, { // no violations in the working set Query: "call dolt_verify_constraints();", - Expected: []sql.Row{{0}}, + Expected: []sql.UntypedSqlRow{{0}}, }, { // one unique violation in all the data Query: "call dolt_verify_constraints('--all');", - Expected: []sql.Row{{1}}, + Expected: []sql.UntypedSqlRow{{1}}, }, { Query: "select * from dolt_constraint_violations;", - Expected: []sql.Row{{"t", uint64(1)}}, + Expected: []sql.UntypedSqlRow{{"t", uint64(1)}}, }, { Query: "select violation_type, pk, col1, cast(violation_info as char) as violation_info from dolt_constraint_violations_t;", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {"check constraint", 1, 42, `{"Name": "t_chk_5eebhnk4", "Expression": "(NOT((col1 = col2)))"}`}, }, }, @@ -672,38 +672,38 @@ var DoltVerifyConstraintsTestScripts = []queries.ScriptTest{ { // merge with --squash so that our working set has the constraint violations Query: "call dolt_merge('main', '--squash');", - Expected: []sql.Row{{"", 0, 1, "conflicts found"}}, + Expected: []sql.UntypedSqlRow{{"", 0, 1, "conflicts found"}}, }, { Query: "select * from t;", - Expected: []sql.Row{{1, 42, 42}}, + Expected: []sql.UntypedSqlRow{{1, 42, 42}}, }, { Query: "select * from dolt_constraint_violations;", - Expected: []sql.Row{{"t", uint64(1)}}, + Expected: []sql.UntypedSqlRow{{"t", uint64(1)}}, }, { Query: "select violation_type, pk, col1, cast(violation_info as char) as violation_info from dolt_constraint_violations_t;", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {"check constraint", 1, 42, `{"Name": "t_chk_5eebhnk4", "Expression": "(NOT((col1 = col2)))"}`}, }, }, { Query: "delete from dolt_constraint_violations_t;", - Expected: []sql.Row{{types.NewOkResult(1)}}, + Expected: []sql.UntypedSqlRow{{types.NewOkResult(1)}}, }, { // verify constraints in working set Query: "call dolt_verify_constraints('t');", - Expected: []sql.Row{{1}}, + Expected: []sql.UntypedSqlRow{{1}}, }, { Query: "select * from dolt_constraint_violations;", - Expected: []sql.Row{{"t", uint64(1)}}, + Expected: []sql.UntypedSqlRow{{"t", uint64(1)}}, }, { Query: "select violation_type, pk, col1, cast(violation_info as char) as violation_info from dolt_constraint_violations_t;", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {"check constraint", 1, 42, `{"Name": "t_chk_5eebhnk4", "Expression": "(NOT((col1 = col2)))"}`}, }, }, @@ -716,35 +716,35 @@ var DoltVerifyConstraintsTestScripts = []queries.ScriptTest{ { // merge with --squash so that our working set has the constraint violations Query: "call dolt_merge('main', '--squash');", - Expected: []sql.Row{{"", 0, 1, "conflicts found"}}, + Expected: []sql.UntypedSqlRow{{"", 0, 1, "conflicts found"}}, }, { Query: "select * from t;", - Expected: []sql.Row{{1, 42, 42}}, + Expected: []sql.UntypedSqlRow{{1, 42, 42}}, }, { Query: "select * from dolt_constraint_violations;", - Expected: []sql.Row{{"t", uint64(1)}}, + Expected: []sql.UntypedSqlRow{{"t", uint64(1)}}, }, { Query: "select violation_type, pk, col1, cast(violation_info as char) as violation_info from dolt_constraint_violations_t;", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {"check constraint", 1, 42, `{"Name": "t_chk_5eebhnk4", "Expression": "(NOT((col1 = col2)))"}`}, }, }, { Query: "delete from dolt_constraint_violations_t;", - Expected: []sql.Row{{types.NewOkResult(1)}}, + Expected: []sql.UntypedSqlRow{{types.NewOkResult(1)}}, }, { // verify constraints in working set Query: "call dolt_verify_constraints('otherTable');", - Expected: []sql.Row{{0}}, + Expected: []sql.UntypedSqlRow{{0}}, }, { // Nothing in dolt_constraint_violations because we only verify otherTable Query: "select * from dolt_constraint_violations;", - Expected: []sql.Row{}, + Expected: []sql.UntypedSqlRow{}, }, }, }, @@ -754,44 +754,44 @@ var DoltVerifyConstraintsTestScripts = []queries.ScriptTest{ Assertions: []queries.ScriptTestAssertion{ { Query: "call dolt_merge('main');", - Expected: []sql.Row{{"", 0, 1, "conflicts found"}}, + Expected: []sql.UntypedSqlRow{{"", 0, 1, "conflicts found"}}, }, { Query: "call dolt_commit('-am', 'commiting with conflicts', '--force');", - Expected: []sql.Row{{doltCommit}}, + Expected: []sql.UntypedSqlRow{{doltCommit}}, }, { Query: "select * from t;", - Expected: []sql.Row{{1, 42, 42}}, + Expected: []sql.UntypedSqlRow{{1, 42, 42}}, }, { Query: "select * from dolt_constraint_violations;", - Expected: []sql.Row{{"t", uint64(1)}}, + Expected: []sql.UntypedSqlRow{{"t", uint64(1)}}, }, { Query: "select violation_type, pk, col1, cast(violation_info as char) as violation_info from dolt_constraint_violations_t;", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {"check constraint", 1, 42, `{"Name": "t_chk_5eebhnk4", "Expression": "(NOT((col1 = col2)))"}`}, }, }, { Query: "delete from dolt_constraint_violations_t;", - Expected: []sql.Row{{types.NewOkResult(1)}}, + Expected: []sql.UntypedSqlRow{{types.NewOkResult(1)}}, }, { // no violations in the working set Query: "call dolt_verify_constraints();", - Expected: []sql.Row{{0}}, + Expected: []sql.UntypedSqlRow{{0}}, }, { // one unique violation in all the data Query: "call dolt_verify_constraints('--all', '--output-only');", - Expected: []sql.Row{{1}}, + Expected: []sql.UntypedSqlRow{{1}}, }, { // no output recorded because of --output-only Query: "select * from dolt_constraint_violations;", - Expected: []sql.Row{}, + Expected: []sql.UntypedSqlRow{}, }, }, }, diff --git a/go/libraries/doltcore/sqle/enginetest/dolt_queries_workspace.go b/go/libraries/doltcore/sqle/enginetest/dolt_queries_workspace.go index 9cdb9b4bd15..8438f7b9675 100644 --- a/go/libraries/doltcore/sqle/enginetest/dolt_queries_workspace.go +++ b/go/libraries/doltcore/sqle/enginetest/dolt_queries_workspace.go @@ -36,14 +36,14 @@ var DoltWorkspaceScriptTests = []queries.ScriptTest{ Assertions: []queries.ScriptTestAssertion{ { Query: "select * from dolt_workspace_tbl", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {0, true, "modified", 42, 51, 42, 42}, }, }, { // Test case-insensitive table name Query: "select * from dolt_workspace_TBL", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {0, true, "modified", 42, 51, 42, 42}, }, }, @@ -52,7 +52,7 @@ var DoltWorkspaceScriptTests = []queries.ScriptTest{ }, { Query: "select * from dolt_workspace_tbl", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {0, true, "modified", 42, 51, 42, 42}, {1, false, "modified", 42, 108, 42, 51}, }, @@ -62,7 +62,7 @@ var DoltWorkspaceScriptTests = []queries.ScriptTest{ }, { Query: "select * from dolt_workspace_tbl", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {0, true, "modified", 42, 108, 42, 42}, }, }, @@ -83,7 +83,7 @@ var DoltWorkspaceScriptTests = []queries.ScriptTest{ Assertions: []queries.ScriptTestAssertion{ { Query: "select * from dolt_workspace_tbl", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {0, false, "modified", 42, 51, 42, 42}, }, }, @@ -103,7 +103,7 @@ var DoltWorkspaceScriptTests = []queries.ScriptTest{ Assertions: []queries.ScriptTestAssertion{ { Query: "select * from dolt_workspace_tbl", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {0, false, "added", 44, 44, nil, nil}, }, }, @@ -112,7 +112,7 @@ var DoltWorkspaceScriptTests = []queries.ScriptTest{ }, { Query: "select * from dolt_workspace_tbl", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {0, true, "added", 44, 44, nil, nil}, }, }, @@ -121,7 +121,7 @@ var DoltWorkspaceScriptTests = []queries.ScriptTest{ }, { Query: "select * from dolt_workspace_tbl", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {0, true, "added", 44, 44, nil, nil}, {1, false, "modified", 44, 108, 44, 44}, }, @@ -142,7 +142,7 @@ var DoltWorkspaceScriptTests = []queries.ScriptTest{ Assertions: []queries.ScriptTestAssertion{ { Query: "select * from dolt_workspace_tbl", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {0, false, "removed", nil, nil, 42, 42}, }, }, @@ -151,7 +151,7 @@ var DoltWorkspaceScriptTests = []queries.ScriptTest{ }, { Query: "select * from dolt_workspace_tbl", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {0, true, "removed", nil, nil, 42, 42}, }, }, @@ -170,11 +170,11 @@ var DoltWorkspaceScriptTests = []queries.ScriptTest{ Assertions: []queries.ScriptTestAssertion{ { Query: "select * from dolt_workspace_tbl", - Expected: []sql.Row{}, + Expected: []sql.UntypedSqlRow{}, }, { Query: "select * from dolt_workspace_unknowntable", - Expected: []sql.Row{}, + Expected: []sql.UntypedSqlRow{}, }, }, }, @@ -189,7 +189,7 @@ var DoltWorkspaceScriptTests = []queries.ScriptTest{ Assertions: []queries.ScriptTestAssertion{ { Query: "select * from dolt_workspace_tbl", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {0, false, "added", 42, 42, nil, nil}, {1, false, "added", 43, 43, nil, nil}, }, @@ -199,7 +199,7 @@ var DoltWorkspaceScriptTests = []queries.ScriptTest{ }, { Query: "select * from dolt_workspace_tbl", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {0, true, "added", 42, 42, nil, nil}, {1, true, "added", 43, 43, nil, nil}, }, @@ -220,7 +220,7 @@ var DoltWorkspaceScriptTests = []queries.ScriptTest{ Assertions: []queries.ScriptTestAssertion{ { Query: "select * from dolt_workspace_tbl", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {0, false, "removed", nil, nil, 42, 42}, {1, false, "removed", nil, nil, 43, 43}, }, @@ -230,7 +230,7 @@ var DoltWorkspaceScriptTests = []queries.ScriptTest{ }, { Query: "select * from dolt_workspace_tbl", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {0, true, "removed", nil, nil, 42, 42}, {1, true, "removed", nil, nil, 43, 43}, }, @@ -248,7 +248,7 @@ var DoltWorkspaceScriptTests = []queries.ScriptTest{ Assertions: []queries.ScriptTestAssertion{ { Query: "select * from dolt_workspace_tbl", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {0, false, "added", 42, 42, nil, nil}, {1, false, "added", 42, 42, nil, nil}, }, @@ -259,7 +259,7 @@ var DoltWorkspaceScriptTests = []queries.ScriptTest{ }, { Query: "select * from dolt_workspace_tbl", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {0, true, "added", 42, 42, nil, nil}, {1, true, "added", 42, 42, nil, nil}, }, @@ -269,7 +269,7 @@ var DoltWorkspaceScriptTests = []queries.ScriptTest{ }, { Query: "select * from dolt_workspace_tbl", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {0, true, "added", 42, 42, nil, nil}, {1, true, "added", 42, 42, nil, nil}, {2, false, "added", 42, 42, nil, nil}, @@ -292,7 +292,7 @@ var DoltWorkspaceScriptTests = []queries.ScriptTest{ Assertions: []queries.ScriptTestAssertion{ { Query: "select * from dolt_workspace_tbl", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {0, false, "modified", 42, 51, 42, 42}, }, }, @@ -302,7 +302,7 @@ var DoltWorkspaceScriptTests = []queries.ScriptTest{ }, { Query: "select * from dolt_workspace_tbl", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {0, false, "modified", 42, 51, nil, 42, 42}, }, }, @@ -311,7 +311,7 @@ var DoltWorkspaceScriptTests = []queries.ScriptTest{ }, { Query: "select * from dolt_workspace_tbl", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {0, true, "modified", 42, 51, nil, 42, 42}, }, }, @@ -322,7 +322,7 @@ var DoltWorkspaceScriptTests = []queries.ScriptTest{ }, { Query: "select * from dolt_workspace_tbl", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {0, true, "modified", 42, 51, nil, 42, 42}, }, }, @@ -331,7 +331,7 @@ var DoltWorkspaceScriptTests = []queries.ScriptTest{ }, { Query: "select * from dolt_workspace_tbl", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {0, true, "modified", 42, 51, nil, 42, 42}, {1, false, "modified", 42, 59, nil, nil, 42, 42}, // }, @@ -366,7 +366,7 @@ var DoltWorkspaceScriptTests = []queries.ScriptTest{ Assertions: []queries.ScriptTestAssertion{ { Query: "select * from dolt_workspace_tbl", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {0, false, "modified", 41, 23, 43, 41, 42, 43}, {1, false, "modified", 50, 23, 52, 50, 51, 52}, }, @@ -376,7 +376,7 @@ var DoltWorkspaceScriptTests = []queries.ScriptTest{ }, { Query: "select * from dolt_workspace_tbl", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {0, true, "modified", 41, 23, 43, 41, 42, 43}, {1, false, "modified", 50, 23, 52, 50, 51, 52}, }, @@ -386,7 +386,7 @@ var DoltWorkspaceScriptTests = []queries.ScriptTest{ }, { Query: "select * from dolt_workspace_tbl", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {0, true, "modified", 41, 23, 43, 41, 42, 43}, {1, true, "modified", 50, 23, 52, 50, 51, 52}, }, @@ -396,7 +396,7 @@ var DoltWorkspaceScriptTests = []queries.ScriptTest{ }, { Query: "select * from dolt_workspace_tbl", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {0, true, "modified", 41, 23, 43, 41, 42, 43}, {1, true, "modified", 50, 23, 52, 50, 51, 52}, {2, false, "modified", 41, 23, 81, 41, 23, 43}, @@ -405,13 +405,13 @@ var DoltWorkspaceScriptTests = []queries.ScriptTest{ }, { Query: "select sum(y) from tbl AS OF STAGED", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {float64(95)}, }, }, { Query: "select sum(y) from tbl AS OF WORKING", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {float64(162)}, }, }, @@ -421,7 +421,7 @@ var DoltWorkspaceScriptTests = []queries.ScriptTest{ }, { Query: "select * from dolt_workspace_tbl", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {0, true, "modified", 41, 23, 81, 41, 42, 43}, {1, true, "modified", 50, 23, 81, 50, 51, 52}, }, @@ -439,7 +439,7 @@ var DoltWorkspaceScriptTests = []queries.ScriptTest{ Assertions: []queries.ScriptTestAssertion{ { Query: "select * from dolt_workspace_tbl", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {0, false, "added", 41, 42, 43, nil, nil, nil}, {1, false, "added", 50, 51, 52, nil, nil, nil}, }, @@ -449,7 +449,7 @@ var DoltWorkspaceScriptTests = []queries.ScriptTest{ }, { Query: "select * from dolt_workspace_tbl", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {0, true, "added", 41, 42, 43, nil, nil, nil}, {1, false, "added", 50, 51, 52, nil, nil, nil}, }, @@ -459,7 +459,7 @@ var DoltWorkspaceScriptTests = []queries.ScriptTest{ }, { Query: "select * from dolt_workspace_tbl", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {0, true, "added", 41, 42, 43, nil, nil, nil}, {1, true, "added", 50, 51, 52, nil, nil, nil}, }, @@ -469,7 +469,7 @@ var DoltWorkspaceScriptTests = []queries.ScriptTest{ }, { Query: "select * from dolt_workspace_tbl", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {0, true, "added", 41, 42, 43, nil, nil, nil}, {1, true, "added", 50, 51, 52, nil, nil, nil}, {2, false, "modified", 41, 81, 43, 41, 42, 43}, @@ -482,7 +482,7 @@ var DoltWorkspaceScriptTests = []queries.ScriptTest{ }, { Query: "select * from dolt_workspace_tbl", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {0, true, "added", 41, 81, 43, nil, nil, nil}, {1, true, "added", 50, 81, 52, nil, nil, nil}, }, @@ -501,7 +501,7 @@ var DoltWorkspaceScriptTests = []queries.ScriptTest{ Assertions: []queries.ScriptTestAssertion{ { Query: "select * from dolt_workspace_tbl", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {0, false, "removed", nil, 41}, {1, false, "removed", nil, 50}, }, @@ -511,7 +511,7 @@ var DoltWorkspaceScriptTests = []queries.ScriptTest{ }, { Query: "select * from dolt_workspace_tbl", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {0, true, "removed", nil, 41}, {1, false, "removed", nil, 50}, }, @@ -521,7 +521,7 @@ var DoltWorkspaceScriptTests = []queries.ScriptTest{ }, { Query: "select * from dolt_workspace_tbl", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {0, true, "removed", nil, 41}, {1, true, "removed", nil, 50}, }, @@ -531,7 +531,7 @@ var DoltWorkspaceScriptTests = []queries.ScriptTest{ }, { Query: "select * from dolt_workspace_tbl", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {0, true, "removed", nil, 41}, {1, true, "removed", nil, 50}, {2, false, "added", 41, nil}, @@ -543,7 +543,7 @@ var DoltWorkspaceScriptTests = []queries.ScriptTest{ }, { Query: "select * from dolt_workspace_tbl", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {0, true, "removed", nil, 50}, }, }, @@ -562,7 +562,7 @@ var DoltWorkspaceScriptTests = []queries.ScriptTest{ Assertions: []queries.ScriptTestAssertion{ { Query: "select id, staged, diff_type, to_pk from dolt_workspace_tbl", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {0, true, "modified", 23}, {1, true, "modified", 42}, }, @@ -572,7 +572,7 @@ var DoltWorkspaceScriptTests = []queries.ScriptTest{ }, { Query: "select id, staged, diff_type, to_pk from dolt_workspace_tbl", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {0, true, "modified", 42}, {1, false, "modified", 23}, }, @@ -582,7 +582,7 @@ var DoltWorkspaceScriptTests = []queries.ScriptTest{ }, { Query: "select id, staged, diff_type, to_pk from dolt_workspace_tbl", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {0, false, "modified", 23}, {1, false, "modified", 42}, }, @@ -601,7 +601,7 @@ var DoltWorkspaceScriptTests = []queries.ScriptTest{ Assertions: []queries.ScriptTestAssertion{ { Query: "select id, staged, diff_type, to_pk from dolt_workspace_tbl", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {0, true, "added", 23}, {1, true, "added", 42}, }, @@ -611,7 +611,7 @@ var DoltWorkspaceScriptTests = []queries.ScriptTest{ }, { Query: "select id, staged, diff_type, to_pk from dolt_workspace_tbl", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {0, true, "added", 42}, {1, false, "added", 23}, }, @@ -621,7 +621,7 @@ var DoltWorkspaceScriptTests = []queries.ScriptTest{ }, { Query: "select id, staged, diff_type, to_pk from dolt_workspace_tbl", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {0, false, "added", 23}, {1, false, "added", 42}, }, @@ -641,7 +641,7 @@ var DoltWorkspaceScriptTests = []queries.ScriptTest{ Assertions: []queries.ScriptTestAssertion{ { Query: "select id, staged, diff_type, from_pk, to_pk from dolt_workspace_tbl", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {0, true, "removed", 23, nil}, {1, true, "removed", 42, nil}, }, @@ -651,7 +651,7 @@ var DoltWorkspaceScriptTests = []queries.ScriptTest{ }, { Query: "select id, staged, diff_type, from_pk, to_pk from dolt_workspace_tbl", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {0, true, "removed", 42, nil}, {1, false, "removed", 23, nil}, }, @@ -661,7 +661,7 @@ var DoltWorkspaceScriptTests = []queries.ScriptTest{ }, { Query: "select id, staged, diff_type, from_pk, to_pk from dolt_workspace_tbl", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {0, false, "removed", 23, nil}, {1, false, "removed", 42, nil}, }, @@ -682,7 +682,7 @@ var DoltWorkspaceScriptTests = []queries.ScriptTest{ Assertions: []queries.ScriptTestAssertion{ { Query: "select id, staged, diff_type, from_pk, to_pk from dolt_workspace_tbl", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {0, true, "removed", 23, nil}, {1, true, "modified", 42, 42}, }, @@ -692,7 +692,7 @@ var DoltWorkspaceScriptTests = []queries.ScriptTest{ }, { Query: "select id, staged, diff_type, from_pk, to_pk from dolt_workspace_tbl", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {0, true, "removed", 23, nil}, {1, true, "modified", 42, 42}, {2, false, "modified", 42, 42}, @@ -703,7 +703,7 @@ var DoltWorkspaceScriptTests = []queries.ScriptTest{ }, { Query: "select id, staged, diff_type, from_pk, to_pk from dolt_workspace_tbl", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {0, true, "removed", 23, nil}, {1, true, "modified", 42, 42}, {2, false, "added", nil, 23}, @@ -715,7 +715,7 @@ var DoltWorkspaceScriptTests = []queries.ScriptTest{ }, { Query: "select id, staged, diff_type, from_pk, to_pk from dolt_workspace_tbl", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {0, true, "modified", 23, 23}, {1, true, "modified", 42, 42}, {2, false, "modified", 42, 42}, @@ -736,7 +736,7 @@ var DoltWorkspaceScriptTests = []queries.ScriptTest{ Assertions: []queries.ScriptTestAssertion{ { Query: "select * from dolt_workspace_tbl", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {0, true, "modified", 42, "staged", 42, "inserted"}, {1, false, "modified", 42, "working", 42, "staged"}, }, @@ -747,7 +747,7 @@ var DoltWorkspaceScriptTests = []queries.ScriptTest{ { // Removing the staged row should not affect the working row's final value, but it will change the from_ value. Query: "select * from dolt_workspace_tbl", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {0, false, "modified", 42, "working", 42, "inserted"}, }, }, @@ -769,14 +769,14 @@ var DoltWorkspaceScriptTests = []queries.ScriptTest{ Assertions: []queries.ScriptTestAssertion{ { Query: "select * from dolt_workspace_tbl", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {0, true, "added", 51, nil}, {1, true, "removed", nil, 42}, }, }, { Query: "select val, count(*) as num from tbl AS OF STAGED group by val order by val", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {42, 2}, {51, 3}, }, @@ -786,7 +786,7 @@ var DoltWorkspaceScriptTests = []queries.ScriptTest{ }, { Query: "select * from dolt_workspace_tbl", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {0, true, "removed", nil, 42}, {1, false, "added", 51, nil}, }, @@ -796,20 +796,20 @@ var DoltWorkspaceScriptTests = []queries.ScriptTest{ }, { Query: "select val, count(*) as num from tbl AS OF STAGED group by val order by val", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {42, 2}, {51, 2}, }, }, { Query: "select val, count(*) as num from tbl AS OF WORKING group by val order by val", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {23, 5}, }, }, { Query: "select * from dolt_workspace_tbl", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {0, true, "removed", nil, 42}, {1, false, "added", 23, nil}, {2, false, "added", 23, nil}, @@ -827,7 +827,7 @@ var DoltWorkspaceScriptTests = []queries.ScriptTest{ }, { Query: "select * from dolt_workspace_tbl", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {0, true, "added", 23, nil}, {1, true, "added", 23, nil}, {2, true, "removed", nil, 51}, @@ -842,7 +842,7 @@ var DoltWorkspaceScriptTests = []queries.ScriptTest{ }, { Query: "select val, count(*) as num from tbl AS OF STAGED group by val order by val", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {23, 2}, {42, 1}, {51, 1}, @@ -850,7 +850,7 @@ var DoltWorkspaceScriptTests = []queries.ScriptTest{ }, { Query: "select val, count(*) as num from tbl AS OF WORKING group by val order by val", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {23, 5}, }, }, @@ -869,7 +869,7 @@ var DoltWorkspaceScriptTests = []queries.ScriptTest{ Assertions: []queries.ScriptTestAssertion{ { Query: "select * from dolt_workspace_tbl", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {0, true, "added", 42, 42, nil, nil}, {1, true, "added", 43, 43, nil, nil}, }, @@ -886,7 +886,7 @@ var DoltWorkspaceScriptTests = []queries.ScriptTest{ }, { Query: "select * from dolt_workspace_tbl", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {0, true, "added", 43, 43, nil, nil}, }, }, @@ -908,13 +908,13 @@ var DoltWorkspaceScriptTests = []queries.ScriptTest{ }, { Query: "select * from dolt_workspace_tbl", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {0, false, "removed", nil, nil, 43, 43}, }, }, { Query: "select * from tbl", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {42, 42}, }, }, @@ -934,13 +934,13 @@ var DoltWorkspaceScriptTests = []queries.ScriptTest{ }, { Query: "select * from dolt_workspace_tbl", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {0, false, "added", 43, 43, nil, nil}, }, }, { Query: "select * from tbl", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {43, 43}, }, }, @@ -958,7 +958,7 @@ var DoltWorkspaceScriptTests = []queries.ScriptTest{ Assertions: []queries.ScriptTestAssertion{ { Query: "select * from dolt_workspace_tbl", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {0, false, "modified", 42, 84, 42, 42}, {1, false, "modified", 43, 86, 43, 43}, }, @@ -968,13 +968,13 @@ var DoltWorkspaceScriptTests = []queries.ScriptTest{ }, { Query: "select * from dolt_workspace_tbl", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {0, false, "modified", 43, 86, 43, 43}, }, }, { Query: "select * from tbl", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {42, 42}, // 42 is unchanged. {43, 86}, }, diff --git a/go/libraries/doltcore/sqle/enginetest/dolt_server_test.go b/go/libraries/doltcore/sqle/enginetest/dolt_server_test.go index d3b9d216661..73805707ace 100644 --- a/go/libraries/doltcore/sqle/enginetest/dolt_server_test.go +++ b/go/libraries/doltcore/sqle/enginetest/dolt_server_test.go @@ -59,7 +59,7 @@ func TestDoltServerRunningUnixSocket(t *testing.T) { localConn, localSess := newConnection(t, serverConfig) rows, err := localSess.Query("select 1") require.NoError(t, err) - assertResultsEqual(t, []sql.Row{{1}}, rows) + assertResultsEqual(t, []sql.UntypedSqlRow{{1}}, rows) t.Run("connecting to local server with tcp connections", func(t *testing.T) { // connect with port defined @@ -67,21 +67,21 @@ func TestDoltServerRunningUnixSocket(t *testing.T) { conn1, sess1 := newConnection(t, serverConfigWithPortOnly) rows1, err := sess1.Query("select 1") require.NoError(t, err) - assertResultsEqual(t, []sql.Row{{1}}, rows1) + assertResultsEqual(t, []sql.UntypedSqlRow{{1}}, rows1) // connect with host defined serverConfigWithPortandHost := sqlserver.DefaultCommandLineServerConfig().WithHost("127.0.0.1") conn2, sess2 := newConnection(t, serverConfigWithPortandHost) rows2, err := sess2.Query("select 1") require.NoError(t, err) - assertResultsEqual(t, []sql.Row{{1}}, rows2) + assertResultsEqual(t, []sql.UntypedSqlRow{{1}}, rows2) // connect with port and host defined serverConfigWithPortandHost1 := sqlserver.DefaultCommandLineServerConfig().WithPort(3306).WithHost("0.0.0.0") conn3, sess3 := newConnection(t, serverConfigWithPortandHost1) rows3, err := sess3.Query("select 1") require.NoError(t, err) - assertResultsEqual(t, []sql.Row{{1}}, rows3) + assertResultsEqual(t, []sql.UntypedSqlRow{{1}}, rows3) // close connections require.NoError(t, conn3.Close()) @@ -115,7 +115,7 @@ func TestDoltServerRunningUnixSocket(t *testing.T) { conn1, sess1 := newConnection(t, tcpServerConfig) rows1, err := sess1.Query("select 1") require.NoError(t, err) - assertResultsEqual(t, []sql.Row{{1}}, rows1) + assertResultsEqual(t, []sql.UntypedSqlRow{{1}}, rows1) require.NoError(t, conn1.Close()) }) diff --git a/go/libraries/doltcore/sqle/enginetest/dolt_server_tests.go b/go/libraries/doltcore/sqle/enginetest/dolt_server_tests.go index fffa257cdf2..9c24ee753e7 100755 --- a/go/libraries/doltcore/sqle/enginetest/dolt_server_tests.go +++ b/go/libraries/doltcore/sqle/enginetest/dolt_server_tests.go @@ -48,11 +48,11 @@ var DoltBranchMultiSessionScriptTests = []queries.ScriptTest{ Assertions: []queries.ScriptTestAssertion{ { Query: "/* client a */ CALL DOLT_CHECKOUT('branch1');", - Expected: []sql.Row{{0, "Switched to branch 'branch1'"}}, + Expected: []sql.UntypedSqlRow{{0, "Switched to branch 'branch1'"}}, }, { Query: "/* client a */ select active_branch();", - Expected: []sql.Row{{"branch1"}}, + Expected: []sql.UntypedSqlRow{{"branch1"}}, }, { Query: "/* client b */ CALL DOLT_BRANCH('-d', 'branch1');", @@ -60,11 +60,11 @@ var DoltBranchMultiSessionScriptTests = []queries.ScriptTest{ }, { Query: "/* client a */ CALL DOLT_CHECKOUT('branch2');", - Expected: []sql.Row{{0, "Switched to branch 'branch2'"}}, + Expected: []sql.UntypedSqlRow{{0, "Switched to branch 'branch2'"}}, }, { Query: "/* client b */ CALL DOLT_BRANCH('-d', 'branch1');", - Expected: []sql.Row{{0}}, + Expected: []sql.UntypedSqlRow{{0}}, }, { Query: "/* client b */ CALL DOLT_BRANCH('-d', 'branch2');", @@ -72,11 +72,11 @@ var DoltBranchMultiSessionScriptTests = []queries.ScriptTest{ }, { Query: "/* client b */ CALL DOLT_BRANCH('-df', 'branch2');", - Expected: []sql.Row{{0}}, + Expected: []sql.UntypedSqlRow{{0}}, }, { Query: "/* client b */ CALL DOLT_BRANCH('-d', 'branch3');", - Expected: []sql.Row{{0}}, + Expected: []sql.UntypedSqlRow{{0}}, }, }, }, @@ -89,11 +89,11 @@ var DoltBranchMultiSessionScriptTests = []queries.ScriptTest{ Assertions: []queries.ScriptTestAssertion{ { Query: "/* client a */ CALL DOLT_CHECKOUT('branch1');", - Expected: []sql.Row{{0, "Switched to branch 'branch1'"}}, + Expected: []sql.UntypedSqlRow{{0, "Switched to branch 'branch1'"}}, }, { Query: "/* client a */ select active_branch();", - Expected: []sql.Row{{"branch1"}}, + Expected: []sql.UntypedSqlRow{{"branch1"}}, }, { Query: "/* client b */ CALL DOLT_BRANCH('-m', 'branch1', 'movedBranch1');", @@ -101,11 +101,11 @@ var DoltBranchMultiSessionScriptTests = []queries.ScriptTest{ }, { Query: "/* client b */ CALL DOLT_BRANCH('-mf', 'branch1', 'movedBranch1');", - Expected: []sql.Row{{0}}, + Expected: []sql.UntypedSqlRow{{0}}, }, { Query: "/* client b */ CALL DOLT_BRANCH('-m', 'branch2', 'movedBranch2');", - Expected: []sql.Row{{0}}, + Expected: []sql.UntypedSqlRow{{0}}, }, }, }, @@ -118,23 +118,23 @@ var DoltBranchMultiSessionScriptTests = []queries.ScriptTest{ Assertions: []queries.ScriptTestAssertion{ { Query: "/* client a */ use dolt/branch1;", - Expected: []sql.Row{}, + Expected: []sql.UntypedSqlRow{}, }, { Query: "/* client a */ SELECT DATABASE(), ACTIVE_BRANCH();", - Expected: []sql.Row{{"dolt/branch1", "branch1"}}, + Expected: []sql.UntypedSqlRow{{"dolt/branch1", "branch1"}}, }, { Query: "/* client b */ use dolt/branch2;", - Expected: []sql.Row{}, + Expected: []sql.UntypedSqlRow{}, }, { Query: "/* client b */ SELECT DATABASE(), ACTIVE_BRANCH();", - Expected: []sql.Row{{"dolt/branch2", "branch2"}}, + Expected: []sql.UntypedSqlRow{{"dolt/branch2", "branch2"}}, }, { Query: "/* client a */ SHOW DATABASES;", - Expected: []sql.Row{{"dolt"}, {"dolt/branch1"}, {"information_schema"}, {"mysql"}}, + Expected: []sql.UntypedSqlRow{{"dolt"}, {"dolt/branch1"}, {"information_schema"}, {"mysql"}}, }, { Query: "/* client a */ CALL DOLT_BRANCH('-d', 'branch2');", @@ -142,21 +142,21 @@ var DoltBranchMultiSessionScriptTests = []queries.ScriptTest{ }, { Query: "/* client a */ CALL DOLT_BRANCH('-df', 'branch2');", - Expected: []sql.Row{{0}}, + Expected: []sql.UntypedSqlRow{{0}}, }, { Query: "/* client a */ SHOW DATABASES;", - Expected: []sql.Row{{"dolt"}, {"dolt/branch1"}, {"information_schema"}, {"mysql"}}, + Expected: []sql.UntypedSqlRow{{"dolt"}, {"dolt/branch1"}, {"information_schema"}, {"mysql"}}, }, { Query: "/* client a */ SELECT DATABASE(), ACTIVE_BRANCH();", - Expected: []sql.Row{{"dolt/branch1", "branch1"}}, + Expected: []sql.UntypedSqlRow{{"dolt/branch1", "branch1"}}, }, { // Call a stored procedure since this searches across all databases and will // fail if a branch-qualified database exists for a missing branch. Query: "/* client a */ CALL DOLT_BRANCH('branch3');", - Expected: []sql.Row{{0}}, + Expected: []sql.UntypedSqlRow{{0}}, }, }, }, @@ -169,23 +169,23 @@ var DoltBranchMultiSessionScriptTests = []queries.ScriptTest{ Assertions: []queries.ScriptTestAssertion{ { Query: "/* client a */ use dolt/branch1;", - Expected: []sql.Row{}, + Expected: []sql.UntypedSqlRow{}, }, { Query: "/* client a */ SELECT DATABASE(), ACTIVE_BRANCH();", - Expected: []sql.Row{{"dolt/branch1", "branch1"}}, + Expected: []sql.UntypedSqlRow{{"dolt/branch1", "branch1"}}, }, { Query: "/* client b */ use dolt/branch2;", - Expected: []sql.Row{}, + Expected: []sql.UntypedSqlRow{}, }, { Query: "/* client b */ SELECT DATABASE(), ACTIVE_BRANCH();", - Expected: []sql.Row{{"dolt/branch2", "branch2"}}, + Expected: []sql.UntypedSqlRow{{"dolt/branch2", "branch2"}}, }, { Query: "/* client a */ SHOW DATABASES;", - Expected: []sql.Row{{"dolt"}, {"dolt/branch1"}, {"information_schema"}, {"mysql"}}, + Expected: []sql.UntypedSqlRow{{"dolt"}, {"dolt/branch1"}, {"information_schema"}, {"mysql"}}, }, { Query: "/* client a */ CALL DOLT_BRANCH('-m', 'branch2', 'newName');", @@ -193,17 +193,17 @@ var DoltBranchMultiSessionScriptTests = []queries.ScriptTest{ }, { Query: "/* client a */ CALL DOLT_BRANCH('-mf', 'branch2', 'newName');", - Expected: []sql.Row{{0}}, + Expected: []sql.UntypedSqlRow{{0}}, }, { Query: "/* client a */ SHOW DATABASES;", - Expected: []sql.Row{{"dolt"}, {"dolt/branch1"}, {"information_schema"}, {"mysql"}}, + Expected: []sql.UntypedSqlRow{{"dolt"}, {"dolt/branch1"}, {"information_schema"}, {"mysql"}}, }, { // Call a stored procedure since this searches across all databases and will // fail if a branch-qualified database exists for a missing branch. Query: "/* client a */ CALL DOLT_BRANCH('branch3');", - Expected: []sql.Row{{0}}, + Expected: []sql.UntypedSqlRow{{0}}, }, }, }, @@ -212,31 +212,31 @@ var DoltBranchMultiSessionScriptTests = []queries.ScriptTest{ Assertions: []queries.ScriptTestAssertion{ { Query: "/* client a */ SET @@autocommit=1;", - Expected: []sql.Row{}, + Expected: []sql.UntypedSqlRow{}, }, { Query: "/* client a */ CALL DOLT_CHECKOUT('-b', 'branch1');", - Expected: []sql.Row{{0, "Switched to branch 'branch1'"}}, + Expected: []sql.UntypedSqlRow{{0, "Switched to branch 'branch1'"}}, }, { Query: "/* client a */ select active_branch();", - Expected: []sql.Row{{"branch1"}}, + Expected: []sql.UntypedSqlRow{{"branch1"}}, }, { Query: "/* client b */ select active_branch();", - Expected: []sql.Row{{"main"}}, + Expected: []sql.UntypedSqlRow{{"main"}}, }, { Query: "/* client b */ select name from dolt_branches order by name;", - Expected: []sql.Row{{"branch1"}, {"main"}}, + Expected: []sql.UntypedSqlRow{{"branch1"}, {"main"}}, }, { Query: "/* client b */ CALL DOLT_BRANCH('-D', 'branch1');", - Expected: []sql.Row{{0}}, + Expected: []sql.UntypedSqlRow{{0}}, }, { Query: "/* client b */ select name from dolt_branches;", - Expected: []sql.Row{{"main"}}, + Expected: []sql.UntypedSqlRow{{"main"}}, }, { Query: "/* client a */ select name from dolt_branches;", @@ -248,11 +248,11 @@ var DoltBranchMultiSessionScriptTests = []queries.ScriptTest{ }, { Query: "/* client a */ USE dolt/main;", - Expected: []sql.Row{}, + Expected: []sql.UntypedSqlRow{}, }, { Query: "/* client a */ select active_branch();", - Expected: []sql.Row{{"main"}}, + Expected: []sql.UntypedSqlRow{{"main"}}, }, }, }, @@ -261,31 +261,31 @@ var DoltBranchMultiSessionScriptTests = []queries.ScriptTest{ Assertions: []queries.ScriptTestAssertion{ { Query: "/* client a */ SET @@autocommit=0;", - Expected: []sql.Row{}, + Expected: []sql.UntypedSqlRow{}, }, { Query: "/* client a */ CALL DOLT_CHECKOUT('-b', 'branch1');", - Expected: []sql.Row{{0, "Switched to branch 'branch1'"}}, + Expected: []sql.UntypedSqlRow{{0, "Switched to branch 'branch1'"}}, }, { Query: "/* client a */ select active_branch();", - Expected: []sql.Row{{"branch1"}}, + Expected: []sql.UntypedSqlRow{{"branch1"}}, }, { Query: "/* client b */ select active_branch();", - Expected: []sql.Row{{"main"}}, + Expected: []sql.UntypedSqlRow{{"main"}}, }, { Query: "/* client b */ select name from dolt_branches order by name;", - Expected: []sql.Row{{"branch1"}, {"main"}}, + Expected: []sql.UntypedSqlRow{{"branch1"}, {"main"}}, }, { Query: "/* client b */ CALL DOLT_BRANCH('-D', 'branch1');", - Expected: []sql.Row{{0}}, + Expected: []sql.UntypedSqlRow{{0}}, }, { Query: "/* client b */ select name from dolt_branches;", - Expected: []sql.Row{{"main"}}, + Expected: []sql.UntypedSqlRow{{"main"}}, }, { Query: "/* client a */ select name from dolt_branches;", @@ -298,11 +298,11 @@ var DoltBranchMultiSessionScriptTests = []queries.ScriptTest{ }, { Query: "/* client a */ USE dolt/main;", - Expected: []sql.Row{}, + Expected: []sql.UntypedSqlRow{}, }, { Query: "/* client a */ select active_branch();", - Expected: []sql.Row{{"main"}}, + Expected: []sql.UntypedSqlRow{{"main"}}, }, }, }, @@ -323,44 +323,44 @@ var DropDatabaseMultiSessionScriptTests = []queries.ScriptTest{ Assertions: []queries.ScriptTestAssertion{ { Query: "/* client a */ use db01;", - Expected: []sql.Row{}, + Expected: []sql.UntypedSqlRow{}, }, { Query: "/* client b */ use db01;", - Expected: []sql.Row{}, + Expected: []sql.UntypedSqlRow{}, }, { Query: "/* client a */ show tables;", - Expected: []sql.Row{{"t01"}}, + Expected: []sql.UntypedSqlRow{{"t01"}}, }, { Query: "/* client b */ show tables;", - Expected: []sql.Row{{"t01"}}, + Expected: []sql.UntypedSqlRow{{"t01"}}, }, { Query: "/* client a */ drop database db01;", - Expected: []sql.Row{}, + Expected: []sql.UntypedSqlRow{}, }, { // TODO: This test runner doesn't currently support asserting against null values Query: "/* client a */ select database() is NULL;", - Expected: []sql.Row{{1}}, + Expected: []sql.UntypedSqlRow{{1}}, }, { Query: "/* client a */ show databases like 'db01';", - Expected: []sql.Row{}, + Expected: []sql.UntypedSqlRow{}, }, { Query: "/* client a */ create database db01;", - Expected: []sql.Row{}, + Expected: []sql.UntypedSqlRow{}, }, { Query: "/* client b */ select database();", - Expected: []sql.Row{{"db01"}}, + Expected: []sql.UntypedSqlRow{{"db01"}}, }, { Query: "/* client b */ show tables;", - Expected: []sql.Row{}, + Expected: []sql.UntypedSqlRow{}, }, }, }, @@ -379,40 +379,40 @@ var DropDatabaseMultiSessionScriptTests = []queries.ScriptTest{ Assertions: []queries.ScriptTestAssertion{ { Query: "/* client a */ use db01;", - Expected: []sql.Row{}, + Expected: []sql.UntypedSqlRow{}, }, { Query: "/* client b */ use `db01/branch1`;", - Expected: []sql.Row{}, + Expected: []sql.UntypedSqlRow{}, }, { Query: "/* client a */ show tables;", - Expected: []sql.Row{{"t01"}}, + Expected: []sql.UntypedSqlRow{{"t01"}}, }, { Query: "/* client b */ show tables;", - Expected: []sql.Row{{"t01"}}, + Expected: []sql.UntypedSqlRow{{"t01"}}, }, { Query: "/* client a */ drop database db01;", - Expected: []sql.Row{}, + Expected: []sql.UntypedSqlRow{}, }, { // TODO: This test runner doesn't currently support asserting against null values Query: "/* client a */ select database() is NULL;", - Expected: []sql.Row{{1}}, + Expected: []sql.UntypedSqlRow{{1}}, }, { Query: "/* client a */ show databases like 'db01';", - Expected: []sql.Row{}, + Expected: []sql.UntypedSqlRow{}, }, { Query: "/* client a */ create database db01;", - Expected: []sql.Row{}, + Expected: []sql.UntypedSqlRow{}, }, { Query: "/* client b */ select database();", - Expected: []sql.Row{{"db01/branch1"}}, + Expected: []sql.UntypedSqlRow{{"db01/branch1"}}, }, { Query: "/* client b */ show tables;", @@ -435,13 +435,13 @@ var PersistVariableTests = []queries.ScriptTest{ Assertions: []queries.ScriptTestAssertion{ { Query: "select @@dolt_skip_replication_errors", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {1}, }, }, { Query: "select @@dolt_read_replica_force_pull", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {0}, }, }, @@ -459,13 +459,13 @@ var PersistVariableTests = []queries.ScriptTest{ Assertions: []queries.ScriptTestAssertion{ { Query: "select @@dolt_skip_replication_errors", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {0}, }, }, { Query: "select @@dolt_read_replica_force_pull", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {1}, }, }, @@ -587,7 +587,7 @@ func startServer(t *testing.T, withPort bool, host string, unixSocketPath string return dEnv, onEnv, config } -func assertResultsEqual(t *testing.T, expected []sql.Row, rows *gosql.Rows) { +func assertResultsEqual(t *testing.T, expected []sql.UntypedSqlRow, rows *gosql.Rows) { columnTypes, err := rows.ColumnTypes() assert.NoError(t, err) dest := makeDestinationSlice(t, columnTypes) @@ -599,10 +599,10 @@ func assertResultsEqual(t *testing.T, expected []sql.Row, rows *gosql.Rows) { } err := rows.Scan(dest...) assert.NoError(t, err) - assert.Equal(t, len(expectedRow), len(dest), + assert.Equal(t, expectedRow.Len(), len(dest), "Different number of columns returned than expected") - for j, expectedValue := range expectedRow { + for j, expectedValue := range expectedRow.Values() { switch strings.ToUpper(columnTypes[j].DatabaseTypeName()) { case "TEXT": actualValue, ok := dest[j].(*string) diff --git a/go/libraries/doltcore/sqle/enginetest/dolt_system_table_queries.go b/go/libraries/doltcore/sqle/enginetest/dolt_system_table_queries.go index fa29cf3eb7a..bb356bc2530 100644 --- a/go/libraries/doltcore/sqle/enginetest/dolt_system_table_queries.go +++ b/go/libraries/doltcore/sqle/enginetest/dolt_system_table_queries.go @@ -32,7 +32,7 @@ var BrokenSystemTableQueries = []queries.QueryTest{ U0.to_commit = 'abc' )) AS diff_type FROM myTable`, - Expected: []sql.Row{}, + Expected: []sql.UntypedSqlRow{}, }, { // extra filter clause breaks filter pushdown @@ -49,6 +49,6 @@ var BrokenSystemTableQueries = []queries.QueryTest{ dolt_commit_diff_mytable.to_i = myTable.i -- extra filter clause )) AS diff_type FROM myTable`, - Expected: []sql.Row{}, + Expected: []sql.UntypedSqlRow{}, }, } diff --git a/go/libraries/doltcore/sqle/enginetest/dolt_transaction_commit_test.go b/go/libraries/doltcore/sqle/enginetest/dolt_transaction_commit_test.go index f0e1f79527a..a27886b831f 100644 --- a/go/libraries/doltcore/sqle/enginetest/dolt_transaction_commit_test.go +++ b/go/libraries/doltcore/sqle/enginetest/dolt_transaction_commit_test.go @@ -46,120 +46,120 @@ func TestDoltTransactionCommitOneClient(t *testing.T) { Assertions: []queries.ScriptTestAssertion{ { Query: "/* client a */ SET @@autocommit=0;", - Expected: []sql.Row{{}}, + Expected: []sql.UntypedSqlRow{{}}, }, // start transaction implicitly commits the current transaction, so we have to do so before we turn on dolt commits { Query: "/* client a */ START TRANSACTION;", - Expected: []sql.Row{}, + Expected: []sql.UntypedSqlRow{}, }, { Query: "/* client b */ START TRANSACTION;", - Expected: []sql.Row{}, + Expected: []sql.UntypedSqlRow{}, }, { Query: "/* client a */ SET @@dolt_transaction_commit=1;", - Expected: []sql.Row{{}}, + Expected: []sql.UntypedSqlRow{{}}, }, { Query: "/* client a */ SET @initial_head=@@mydb_head;", - Expected: []sql.Row{{}}, + Expected: []sql.UntypedSqlRow{{}}, }, { Query: "/* client b */ SET @initial_head=@@mydb_head;", - Expected: []sql.Row{{}}, + Expected: []sql.UntypedSqlRow{{}}, }, { Query: "/* client a */ SELECT @@mydb_head like @initial_head;", - Expected: []sql.Row{{true}}, + Expected: []sql.UntypedSqlRow{{true}}, }, { Query: "/* client b */ SELECT @@mydb_head like @initial_head;", - Expected: []sql.Row{{true}}, + Expected: []sql.UntypedSqlRow{{true}}, }, { Query: "/* client a */ INSERT INTO x VALUES (2,2);", - Expected: []sql.Row{{types.NewOkResult(1)}}, + Expected: []sql.UntypedSqlRow{{types.NewOkResult(1)}}, }, { Query: "/* client b */ INSERT INTO x VALUES (3,3);", - Expected: []sql.Row{{types.NewOkResult(1)}}, + Expected: []sql.UntypedSqlRow{{types.NewOkResult(1)}}, }, { Query: "/* client a */ SELECT * FROM x ORDER BY y;", - Expected: []sql.Row{{1, 1}, {2, 2}}, + Expected: []sql.UntypedSqlRow{{1, 1}, {2, 2}}, }, { Query: "/* client b */ SELECT * FROM x ORDER BY y;", - Expected: []sql.Row{{1, 1}, {3, 3}}, + Expected: []sql.UntypedSqlRow{{1, 1}, {3, 3}}, }, { Query: "/* client a */ SELECT @@mydb_head like @initial_head;", - Expected: []sql.Row{{true}}, + Expected: []sql.UntypedSqlRow{{true}}, }, { Query: "/* client b */ SELECT @@mydb_head like @initial_head;", - Expected: []sql.Row{{true}}, + Expected: []sql.UntypedSqlRow{{true}}, }, { Query: "/* client b */ COMMIT;", - Expected: []sql.Row{}, + Expected: []sql.UntypedSqlRow{}, }, { Query: "/* client a */ SELECT @@mydb_head like @initial_head;", - Expected: []sql.Row{{true}}, + Expected: []sql.UntypedSqlRow{{true}}, }, { Query: "/* client b */ SELECT @@mydb_head like @initial_head;", - Expected: []sql.Row{{true}}, + Expected: []sql.UntypedSqlRow{{true}}, }, { Query: "/* client a */ COMMIT;", - Expected: []sql.Row{}, + Expected: []sql.UntypedSqlRow{}, }, { Query: "/* client a */ SELECT @@mydb_head like @initial_head;", - Expected: []sql.Row{{false}}, + Expected: []sql.UntypedSqlRow{{false}}, }, { Query: "/* client b */ SELECT @@mydb_head like @initial_head;", - Expected: []sql.Row{{false}}, + Expected: []sql.UntypedSqlRow{{false}}, }, { Query: "/* client a */ SELECT * FROM x ORDER BY y;", - Expected: []sql.Row{{1, 1}, {2, 2}, {3, 3}}, + Expected: []sql.UntypedSqlRow{{1, 1}, {2, 2}, {3, 3}}, }, { Query: "/* client b */ SELECT * FROM x ORDER BY y;", - Expected: []sql.Row{{1, 1}, {2, 2}, {3, 3}}, + Expected: []sql.UntypedSqlRow{{1, 1}, {2, 2}, {3, 3}}, }, { Query: "/* client a */ SELECT @@mydb_head like @initial_head;", - Expected: []sql.Row{{false}}, + Expected: []sql.UntypedSqlRow{{false}}, }, { Query: "/* client b */ SELECT @@mydb_head like @initial_head;", - Expected: []sql.Row{{false}}, + Expected: []sql.UntypedSqlRow{{false}}, }, { Query: "/* client c */ SELECT * FROM x ORDER BY y;", - Expected: []sql.Row{{1, 1}, {2, 2}, {3, 3}}, + Expected: []sql.UntypedSqlRow{{1, 1}, {2, 2}, {3, 3}}, }, { Query: "/* client a */ SET @@dolt_transaction_commit_message='Commit Message 42';", - Expected: []sql.Row{{}}, + Expected: []sql.UntypedSqlRow{{}}, }, { Query: "/* client a */ create table newTable(pk int primary key);", - Expected: []sql.Row{{types.NewOkResult(0)}}, + Expected: []sql.UntypedSqlRow{{types.NewOkResult(0)}}, }, { Query: "/* client a */ COMMIT;", - Expected: []sql.Row{}, + Expected: []sql.UntypedSqlRow{}, }, { Query: "/* client a */ SELECT message from dolt_log ORDER BY date DESC LIMIT 1;", - Expected: []sql.Row{{"Commit Message 42"}}, + Expected: []sql.UntypedSqlRow{{"Commit Message 42"}}, }, }, }) @@ -219,126 +219,126 @@ func TestDoltTransactionCommitTwoClients(t *testing.T) { Assertions: []queries.ScriptTestAssertion{ { Query: "/* client a */ SET @@autocommit=0;", - Expected: []sql.Row{{}}, + Expected: []sql.UntypedSqlRow{{}}, }, { Query: "/* client b */ SET @@autocommit=0;", - Expected: []sql.Row{{}}, + Expected: []sql.UntypedSqlRow{{}}, }, // start transaction implicitly commits the current transaction, so we have to do so before we turn on dolt commits { Query: "/* client a */ START TRANSACTION;", - Expected: []sql.Row{}, + Expected: []sql.UntypedSqlRow{}, }, { Query: "/* client b */ START TRANSACTION;", - Expected: []sql.Row{}, + Expected: []sql.UntypedSqlRow{}, }, // Concurrent with the two transactions which are going to (dolt_)commit changes, we // have a transaction which only modifies the working set. At the end of this // sequence, the changes to the working set should not be committed. { Query: "/* client c */ START TRANSACTION;", - Expected: []sql.Row{}, + Expected: []sql.UntypedSqlRow{}, }, { Query: "/* client c */ INSERT INTO x values (4, 4)", - Expected: []sql.Row{{types.NewOkResult(1)}}, + Expected: []sql.UntypedSqlRow{{types.NewOkResult(1)}}, }, { Query: "/* client c */ COMMIT", - Expected: []sql.Row{}, + Expected: []sql.UntypedSqlRow{}, }, // Now we have the two concurrent transactions commit their changes. { Query: "/* client a */ SET @@dolt_transaction_commit=1;", - Expected: []sql.Row{{}}, + Expected: []sql.UntypedSqlRow{{}}, }, { Query: "/* client b */ SET @@dolt_transaction_commit=1;", - Expected: []sql.Row{{}}, + Expected: []sql.UntypedSqlRow{{}}, }, { Query: "/* client a */ SET @initial_head=@@mydb_head;", - Expected: []sql.Row{{}}, + Expected: []sql.UntypedSqlRow{{}}, }, { Query: "/* client b */ SET @initial_head=@@mydb_head;", - Expected: []sql.Row{{}}, + Expected: []sql.UntypedSqlRow{{}}, }, { Query: "/* client a */ INSERT INTO x VALUES (2,2);", - Expected: []sql.Row{{types.NewOkResult(1)}}, + Expected: []sql.UntypedSqlRow{{types.NewOkResult(1)}}, }, { Query: "/* client b */ INSERT INTO x VALUES (3,3);", - Expected: []sql.Row{{types.NewOkResult(1)}}, + Expected: []sql.UntypedSqlRow{{types.NewOkResult(1)}}, }, { Query: "/* client a */ SELECT * FROM x ORDER BY y;", - Expected: []sql.Row{{1, 1}, {2, 2}}, + Expected: []sql.UntypedSqlRow{{1, 1}, {2, 2}}, }, { Query: "/* client b */ SELECT * FROM x ORDER BY y;", - Expected: []sql.Row{{1, 1}, {3, 3}}, + Expected: []sql.UntypedSqlRow{{1, 1}, {3, 3}}, }, { Query: "/* client a */ SELECT @@mydb_head like @initial_head;", - Expected: []sql.Row{{true}}, + Expected: []sql.UntypedSqlRow{{true}}, }, { Query: "/* client b */ SELECT @@mydb_head like @initial_head;", - Expected: []sql.Row{{true}}, + Expected: []sql.UntypedSqlRow{{true}}, }, { Query: "/* client b */ SET @@dolt_transaction_commit_message='ClientB Commit';", - Expected: []sql.Row{{}}, + Expected: []sql.UntypedSqlRow{{}}, }, { Query: "/* client b */ COMMIT;", - Expected: []sql.Row{}, + Expected: []sql.UntypedSqlRow{}, }, { Query: "/* client a */ SELECT @@mydb_head like @initial_head;", - Expected: []sql.Row{{true}}, + Expected: []sql.UntypedSqlRow{{true}}, }, { Query: "/* client a */ SET @@dolt_transaction_commit_message='ClientA Commit';", - Expected: []sql.Row{{}}, + Expected: []sql.UntypedSqlRow{{}}, }, { Query: "/* client a */ COMMIT;", - Expected: []sql.Row{}, + Expected: []sql.UntypedSqlRow{}, }, { Query: "/* client a */ SELECT @@mydb_head like @initial_head;", - Expected: []sql.Row{{false}}, + Expected: []sql.UntypedSqlRow{{false}}, }, { Query: "/* client b */ SELECT @@mydb_head like @initial_head;", - Expected: []sql.Row{{false}}, + Expected: []sql.UntypedSqlRow{{false}}, }, { Query: "/* client a */ SELECT * FROM x ORDER BY y;", - Expected: []sql.Row{{1, 1}, {2, 2}, {3, 3}, {4, 4}}, + Expected: []sql.UntypedSqlRow{{1, 1}, {2, 2}, {3, 3}, {4, 4}}, }, { Query: "/* client b */ SELECT * FROM x ORDER BY y;", - Expected: []sql.Row{{1, 1}, {2, 2}, {3, 3}, {4, 4}}, + Expected: []sql.UntypedSqlRow{{1, 1}, {2, 2}, {3, 3}, {4, 4}}, }, { Query: "/* client c */ SELECT * FROM x ORDER BY y;", - Expected: []sql.Row{{1, 1}, {2, 2}, {3, 3}, {4, 4}}, + Expected: []sql.UntypedSqlRow{{1, 1}, {2, 2}, {3, 3}, {4, 4}}, }, { Query: "/* client c */ SELECT * FROM x AS OF 'HEAD' ORDER BY y;", - Expected: []sql.Row{{1, 1}, {2, 2}, {3, 3}}, + Expected: []sql.UntypedSqlRow{{1, 1}, {2, 2}, {3, 3}}, }, // After we commit both transactions, our working set should still have the change which // was never dolt_committed. { Query: "/* client c */ SELECT COUNT(*) FROM DOLT_DIFF('HEAD', 'WORKING', 'x');", - Expected: []sql.Row{{1}}, + Expected: []sql.UntypedSqlRow{{1}}, }, }, }) @@ -395,35 +395,35 @@ func TestDoltTransactionCommitAutocommit(t *testing.T) { // these SET statements currently commit a transaction (since autocommit is on) { Query: "/* client a */ SET @@dolt_transaction_commit=1;", - Expected: []sql.Row{{}}, + Expected: []sql.UntypedSqlRow{{}}, }, { Query: "/* client b */ SET @@dolt_transaction_commit=1;", - Expected: []sql.Row{{}}, + Expected: []sql.UntypedSqlRow{{}}, }, { Query: "/* client b */ SET @@dolt_transaction_commit_message='ClientB Commit';", - Expected: []sql.Row{{}}, + Expected: []sql.UntypedSqlRow{{}}, }, { Query: "/* client a */ INSERT INTO x VALUES (2,2);", - Expected: []sql.Row{{types.NewOkResult(1)}}, + Expected: []sql.UntypedSqlRow{{types.NewOkResult(1)}}, }, { Query: "/* client b */ INSERT INTO x VALUES (3,3);", - Expected: []sql.Row{{types.NewOkResult(1)}}, + Expected: []sql.UntypedSqlRow{{types.NewOkResult(1)}}, }, { Query: "/* client a */ SELECT * FROM x ORDER BY y;", - Expected: []sql.Row{{1, 1}, {2, 2}, {3, 3}}, + Expected: []sql.UntypedSqlRow{{1, 1}, {2, 2}, {3, 3}}, }, { Query: "/* client b */ SELECT * FROM x ORDER BY y;", - Expected: []sql.Row{{1, 1}, {2, 2}, {3, 3}}, + Expected: []sql.UntypedSqlRow{{1, 1}, {2, 2}, {3, 3}}, }, { Query: "/* client c */ SELECT * FROM x ORDER BY y;", - Expected: []sql.Row{{1, 1}, {2, 2}, {3, 3}}, + Expected: []sql.UntypedSqlRow{{1, 1}, {2, 2}, {3, 3}}, }, }, }) @@ -481,51 +481,51 @@ func TestDoltTransactionCommitLateFkResolution(t *testing.T) { Assertions: []queries.ScriptTestAssertion{ { Query: "/* client a */ SET @@autocommit=0;", - Expected: []sql.Row{{}}, + Expected: []sql.UntypedSqlRow{{}}, }, { Query: "/* client b */ SET @@autocommit=0;", - Expected: []sql.Row{{}}, + Expected: []sql.UntypedSqlRow{{}}, }, { Query: "/* client a */ START TRANSACTION;", - Expected: []sql.Row{}, + Expected: []sql.UntypedSqlRow{}, }, { Query: "/* client b */ START TRANSACTION;", - Expected: []sql.Row{}, + Expected: []sql.UntypedSqlRow{}, }, { Query: "/* client a */ INSERT INTO child VALUES (1, 1);", - Expected: []sql.Row{{types.NewOkResult(1)}}, + Expected: []sql.UntypedSqlRow{{types.NewOkResult(1)}}, }, { Query: "/* client b */ INSERT INTO child VALUES (2, 2);", - Expected: []sql.Row{{types.NewOkResult(1)}}, + Expected: []sql.UntypedSqlRow{{types.NewOkResult(1)}}, }, { Query: "/* client a */ COMMIT;", - Expected: []sql.Row{}, + Expected: []sql.UntypedSqlRow{}, }, { Query: "/* client b */ COMMIT;", - Expected: []sql.Row{}, + Expected: []sql.UntypedSqlRow{}, }, { Query: "/* client a */ SELECT * FROM child ORDER BY pk;", - Expected: []sql.Row{{1, 1}, {2, 2}}, + Expected: []sql.UntypedSqlRow{{1, 1}, {2, 2}}, }, { Query: "/* client b */ SELECT * FROM child ORDER BY pk;", - Expected: []sql.Row{{1, 1}, {2, 2}}, + Expected: []sql.UntypedSqlRow{{1, 1}, {2, 2}}, }, { // This uses the index, which is automatically created by the late fk resolution, so it's also tested here Query: "/* client a */ SELECT * FROM child WHERE v1 > 0 ORDER BY pk;", - Expected: []sql.Row{{1, 1}, {2, 2}}, + Expected: []sql.UntypedSqlRow{{1, 1}, {2, 2}}, }, { // This uses the index, which is automatically created by the late fk resolution, so it's also tested here Query: "/* client b */ SELECT * FROM child WHERE v1 > 0 ORDER BY pk;", - Expected: []sql.Row{{1, 1}, {2, 2}}, + Expected: []sql.UntypedSqlRow{{1, 1}, {2, 2}}, }, { Query: "/* client a */ INSERT INTO child VALUES (3, 3);", diff --git a/go/libraries/doltcore/sqle/enginetest/dolt_transaction_queries.go b/go/libraries/doltcore/sqle/enginetest/dolt_transaction_queries.go index b1649acb95a..bf0ba83bd5d 100755 --- a/go/libraries/doltcore/sqle/enginetest/dolt_transaction_queries.go +++ b/go/libraries/doltcore/sqle/enginetest/dolt_transaction_queries.go @@ -30,11 +30,11 @@ var DoltTransactionTests = []queries.TransactionTest{ Assertions: []queries.ScriptTestAssertion{ { Query: "/* client a */ select @@autocommit;", - Expected: []sql.Row{{1}}, + Expected: []sql.UntypedSqlRow{{1}}, }, { Query: "/* client b */ select @@autocommit;", - Expected: []sql.Row{{1}}, + Expected: []sql.UntypedSqlRow{{1}}, }, { Query: "/* client a */ select * from t;", @@ -46,11 +46,11 @@ var DoltTransactionTests = []queries.TransactionTest{ }, { Query: "/* client a */ create table t(pk int primary key);", - Expected: []sql.Row{{types.OkResult{}}}, + Expected: []sql.UntypedSqlRow{{types.OkResult{}}}, }, { Query: "/* client b */ select count(*) from t;", - Expected: []sql.Row{{0}}, + Expected: []sql.UntypedSqlRow{{0}}, }, }, }, @@ -63,7 +63,7 @@ var DoltTransactionTests = []queries.TransactionTest{ Assertions: []queries.ScriptTestAssertion{ { Query: "/* client a */ insert into t values (2, 2)", - Expected: []sql.Row{{types.NewOkResult(1)}}, + Expected: []sql.UntypedSqlRow{{types.NewOkResult(1)}}, }, { Query: "/* client b */ insert into t values (2, 2)", @@ -80,35 +80,35 @@ var DoltTransactionTests = []queries.TransactionTest{ Assertions: []queries.ScriptTestAssertion{ { Query: "/* client a */ start transaction", - Expected: []sql.Row{}, + Expected: []sql.UntypedSqlRow{}, }, { Query: "/* client b */ start transaction", - Expected: []sql.Row{}, + Expected: []sql.UntypedSqlRow{}, }, { Query: "/* client a */ insert into t values (2, 2)", - Expected: []sql.Row{{types.NewOkResult(1)}}, + Expected: []sql.UntypedSqlRow{{types.NewOkResult(1)}}, }, { Query: "/* client b */ insert into t values (2, 2)", - Expected: []sql.Row{{types.NewOkResult(1)}}, + Expected: []sql.UntypedSqlRow{{types.NewOkResult(1)}}, }, { Query: "/* client a */ commit", - Expected: []sql.Row{}, + Expected: []sql.UntypedSqlRow{}, }, { Query: "/* client b */ commit", - Expected: []sql.Row{}, + Expected: []sql.UntypedSqlRow{}, }, { Query: "/* client a */ select * from t order by x", - Expected: []sql.Row{{1, 1}, {2, 2}}, + Expected: []sql.UntypedSqlRow{{1, 1}, {2, 2}}, }, { Query: "/* client b */ select * from t order by x", - Expected: []sql.Row{{1, 1}, {2, 2}}, + Expected: []sql.UntypedSqlRow{{1, 1}, {2, 2}}, }, }, }, @@ -121,23 +121,23 @@ var DoltTransactionTests = []queries.TransactionTest{ Assertions: []queries.ScriptTestAssertion{ { Query: "/* client a */ start transaction", - Expected: []sql.Row{}, + Expected: []sql.UntypedSqlRow{}, }, { Query: "/* client b */ start transaction", - Expected: []sql.Row{}, + Expected: []sql.UntypedSqlRow{}, }, { Query: "/* client a */ insert into t values (2, 2)", - Expected: []sql.Row{{types.NewOkResult(1)}}, + Expected: []sql.UntypedSqlRow{{types.NewOkResult(1)}}, }, { Query: "/* client b */ insert into t values (2, 3)", - Expected: []sql.Row{{types.NewOkResult(1)}}, + Expected: []sql.UntypedSqlRow{{types.NewOkResult(1)}}, }, { Query: "/* client a */ commit", - Expected: []sql.Row{}, + Expected: []sql.UntypedSqlRow{}, }, { Query: "/* client b */ commit", @@ -145,15 +145,15 @@ var DoltTransactionTests = []queries.TransactionTest{ }, { Query: "/* client a */ select * from t order by x", - Expected: []sql.Row{{1, 1}, {2, 2}}, + Expected: []sql.UntypedSqlRow{{1, 1}, {2, 2}}, }, { // client b gets a rollback after failed commit, so gets a new tx Query: "/* client b */ select * from t order by x", - Expected: []sql.Row{{1, 1}, {2, 2}}, + Expected: []sql.UntypedSqlRow{{1, 1}, {2, 2}}, }, { Query: "/* client b */ select * from t order by x", - Expected: []sql.Row{{1, 1}, {2, 2}}, + Expected: []sql.UntypedSqlRow{{1, 1}, {2, 2}}, }, { Query: "/* client b */ insert into t values (2, 3)", @@ -170,7 +170,7 @@ var DoltTransactionTests = []queries.TransactionTest{ Assertions: []queries.ScriptTestAssertion{ { Query: "/* client a */ update t set y = 2", - Expected: []sql.Row{{types.OkResult{ + Expected: []sql.UntypedSqlRow{{types.OkResult{ RowsAffected: uint64(1), Info: plan.UpdateInfo{ Matched: 2, @@ -180,7 +180,7 @@ var DoltTransactionTests = []queries.TransactionTest{ }, { Query: "/* client b */ update t set y = 2", - Expected: []sql.Row{{types.OkResult{ + Expected: []sql.UntypedSqlRow{{types.OkResult{ RowsAffected: uint64(0), Info: plan.UpdateInfo{ Matched: 2, @@ -190,11 +190,11 @@ var DoltTransactionTests = []queries.TransactionTest{ }, { Query: "/* client a */ select * from t order by x", - Expected: []sql.Row{{1, 2}, {2, 2}}, + Expected: []sql.UntypedSqlRow{{1, 2}, {2, 2}}, }, { Query: "/* client b */ select * from t order by x", - Expected: []sql.Row{{1, 2}, {2, 2}}, + Expected: []sql.UntypedSqlRow{{1, 2}, {2, 2}}, }, }, }, @@ -207,15 +207,15 @@ var DoltTransactionTests = []queries.TransactionTest{ Assertions: []queries.ScriptTestAssertion{ { Query: "/* client a */ start transaction", - Expected: []sql.Row{}, + Expected: []sql.UntypedSqlRow{}, }, { Query: "/* client b */ start transaction", - Expected: []sql.Row{}, + Expected: []sql.UntypedSqlRow{}, }, { Query: "/* client a */ update t set y = 2", - Expected: []sql.Row{{types.OkResult{ + Expected: []sql.UntypedSqlRow{{types.OkResult{ RowsAffected: uint64(1), Info: plan.UpdateInfo{ Matched: 2, @@ -225,7 +225,7 @@ var DoltTransactionTests = []queries.TransactionTest{ }, { Query: "/* client b */ update t set y = 2", - Expected: []sql.Row{{types.OkResult{ + Expected: []sql.UntypedSqlRow{{types.OkResult{ RowsAffected: uint64(1), Info: plan.UpdateInfo{ Matched: 2, @@ -235,19 +235,19 @@ var DoltTransactionTests = []queries.TransactionTest{ }, { Query: "/* client a */ commit", - Expected: []sql.Row{}, + Expected: []sql.UntypedSqlRow{}, }, { Query: "/* client b */ commit", - Expected: []sql.Row{}, + Expected: []sql.UntypedSqlRow{}, }, { Query: "/* client a */ select * from t order by x", - Expected: []sql.Row{{1, 2}, {2, 2}}, + Expected: []sql.UntypedSqlRow{{1, 2}, {2, 2}}, }, { Query: "/* client b */ select * from t order by x", - Expected: []sql.Row{{1, 2}, {2, 2}}, + Expected: []sql.UntypedSqlRow{{1, 2}, {2, 2}}, }, }, }, @@ -260,15 +260,15 @@ var DoltTransactionTests = []queries.TransactionTest{ Assertions: []queries.ScriptTestAssertion{ { Query: "/* client a */ start transaction", - Expected: []sql.Row{}, + Expected: []sql.UntypedSqlRow{}, }, { Query: "/* client b */ start transaction", - Expected: []sql.Row{}, + Expected: []sql.UntypedSqlRow{}, }, { Query: "/* client a */ update t set y = 3", - Expected: []sql.Row{{types.OkResult{ + Expected: []sql.UntypedSqlRow{{types.OkResult{ RowsAffected: uint64(2), Info: plan.UpdateInfo{ Matched: 2, @@ -278,7 +278,7 @@ var DoltTransactionTests = []queries.TransactionTest{ }, { Query: "/* client b */ update t set y = 4", - Expected: []sql.Row{{types.OkResult{ + Expected: []sql.UntypedSqlRow{{types.OkResult{ RowsAffected: uint64(2), Info: plan.UpdateInfo{ Matched: 2, @@ -288,7 +288,7 @@ var DoltTransactionTests = []queries.TransactionTest{ }, { Query: "/* client a */ commit", - Expected: []sql.Row{}, + Expected: []sql.UntypedSqlRow{}, }, { Query: "/* client b */ commit", @@ -296,19 +296,19 @@ var DoltTransactionTests = []queries.TransactionTest{ }, { Query: "/* client a */ select * from t order by x", - Expected: []sql.Row{{1, 3}, {2, 3}}, + Expected: []sql.UntypedSqlRow{{1, 3}, {2, 3}}, }, { // client b got rolled back when its commit failed, so it sees the same values as client a Query: "/* client b */ select * from t order by x", - Expected: []sql.Row{{1, 3}, {2, 3}}, + Expected: []sql.UntypedSqlRow{{1, 3}, {2, 3}}, }, { Query: "/* client b */ rollback", - Expected: []sql.Row{}, + Expected: []sql.UntypedSqlRow{}, }, { Query: "/* client b */ select * from t order by x", - Expected: []sql.Row{{1, 3}, {2, 3}}, + Expected: []sql.UntypedSqlRow{{1, 3}, {2, 3}}, }, }, }, @@ -321,15 +321,15 @@ var DoltTransactionTests = []queries.TransactionTest{ Assertions: []queries.ScriptTestAssertion{ { Query: "/* client a */ start transaction", - Expected: []sql.Row{}, + Expected: []sql.UntypedSqlRow{}, }, { Query: "/* client b */ start transaction", - Expected: []sql.Row{}, + Expected: []sql.UntypedSqlRow{}, }, { Query: "/* client a */ update t set y = 3 where x = 1", - Expected: []sql.Row{{types.OkResult{ + Expected: []sql.UntypedSqlRow{{types.OkResult{ RowsAffected: uint64(1), Info: plan.UpdateInfo{ Matched: 1, @@ -339,7 +339,7 @@ var DoltTransactionTests = []queries.TransactionTest{ }, { Query: "/* client b */ update t set y = 4 where x = 2", - Expected: []sql.Row{{types.OkResult{ + Expected: []sql.UntypedSqlRow{{types.OkResult{ RowsAffected: uint64(1), Info: plan.UpdateInfo{ Matched: 1, @@ -349,19 +349,19 @@ var DoltTransactionTests = []queries.TransactionTest{ }, { Query: "/* client a */ commit", - Expected: []sql.Row{}, + Expected: []sql.UntypedSqlRow{}, }, { Query: "/* client b */ commit", - Expected: []sql.Row{}, + Expected: []sql.UntypedSqlRow{}, }, { Query: "/* client a */ select * from t order by x", - Expected: []sql.Row{{1, 3}, {2, 4}}, + Expected: []sql.UntypedSqlRow{{1, 3}, {2, 4}}, }, { Query: "/* client b */ select * from t order by x", - Expected: []sql.Row{{1, 3}, {2, 4}}, + Expected: []sql.UntypedSqlRow{{1, 3}, {2, 4}}, }, }, }, @@ -374,15 +374,15 @@ var DoltTransactionTests = []queries.TransactionTest{ Assertions: []queries.ScriptTestAssertion{ { Query: "/* client a */ start transaction", - Expected: []sql.Row{}, + Expected: []sql.UntypedSqlRow{}, }, { Query: "/* client b */ start transaction", - Expected: []sql.Row{}, + Expected: []sql.UntypedSqlRow{}, }, { Query: "/* client a */ update t set y = 2", - Expected: []sql.Row{{types.OkResult{ + Expected: []sql.UntypedSqlRow{{types.OkResult{ RowsAffected: uint64(1), Info: plan.UpdateInfo{ Matched: 2, @@ -392,7 +392,7 @@ var DoltTransactionTests = []queries.TransactionTest{ }, { Query: "/* client b */ update t set z = 3", - Expected: []sql.Row{{types.OkResult{ + Expected: []sql.UntypedSqlRow{{types.OkResult{ RowsAffected: uint64(2), Info: plan.UpdateInfo{ Matched: 2, @@ -402,19 +402,19 @@ var DoltTransactionTests = []queries.TransactionTest{ }, { Query: "/* client a */ commit", - Expected: []sql.Row{}, + Expected: []sql.UntypedSqlRow{}, }, { Query: "/* client b */ commit", - Expected: []sql.Row{}, + Expected: []sql.UntypedSqlRow{}, }, { Query: "/* client a */ select * from t order by x", - Expected: []sql.Row{{1, 2, 3}, {2, 2, 3}}, + Expected: []sql.UntypedSqlRow{{1, 2, 3}, {2, 2, 3}}, }, { Query: "/* client b */ select * from t order by x", - Expected: []sql.Row{{1, 2, 3}, {2, 2, 3}}, + Expected: []sql.UntypedSqlRow{{1, 2, 3}, {2, 2, 3}}, }, }, }, @@ -427,19 +427,19 @@ var DoltTransactionTests = []queries.TransactionTest{ Assertions: []queries.ScriptTestAssertion{ { Query: "/* client a */ delete from t where y = 2", - Expected: []sql.Row{{types.NewOkResult(1)}}, + Expected: []sql.UntypedSqlRow{{types.NewOkResult(1)}}, }, { Query: "/* client b */ delete from t where y = 2", - Expected: []sql.Row{{types.NewOkResult(0)}}, + Expected: []sql.UntypedSqlRow{{types.NewOkResult(0)}}, }, { Query: "/* client a */ select * from t order by x", - Expected: []sql.Row{{1, 1}}, + Expected: []sql.UntypedSqlRow{{1, 1}}, }, { Query: "/* client b */ select * from t order by x", - Expected: []sql.Row{{1, 1}}, + Expected: []sql.UntypedSqlRow{{1, 1}}, }, }, }, @@ -452,35 +452,35 @@ var DoltTransactionTests = []queries.TransactionTest{ Assertions: []queries.ScriptTestAssertion{ { Query: "/* client a */ start transaction", - Expected: []sql.Row{}, + Expected: []sql.UntypedSqlRow{}, }, { Query: "/* client b */ start transaction", - Expected: []sql.Row{}, + Expected: []sql.UntypedSqlRow{}, }, { Query: "/* client a */ delete from t where y = 2", - Expected: []sql.Row{{types.NewOkResult(1)}}, + Expected: []sql.UntypedSqlRow{{types.NewOkResult(1)}}, }, { Query: "/* client b */ delete from t where y = 2", - Expected: []sql.Row{{types.NewOkResult(1)}}, + Expected: []sql.UntypedSqlRow{{types.NewOkResult(1)}}, }, { Query: "/* client a */ commit", - Expected: []sql.Row{}, + Expected: []sql.UntypedSqlRow{}, }, { Query: "/* client b */ commit", - Expected: []sql.Row{}, + Expected: []sql.UntypedSqlRow{}, }, { Query: "/* client a */ select * from t order by x", - Expected: []sql.Row{{1, 1}}, + Expected: []sql.UntypedSqlRow{{1, 1}}, }, { Query: "/* client b */ select * from t order by x", - Expected: []sql.Row{{1, 1}}, + Expected: []sql.UntypedSqlRow{{1, 1}}, }, }, }, @@ -493,35 +493,35 @@ var DoltTransactionTests = []queries.TransactionTest{ Assertions: []queries.ScriptTestAssertion{ { Query: "/* client a */ start transaction", - Expected: []sql.Row{}, + Expected: []sql.UntypedSqlRow{}, }, { Query: "/* client b */ start transaction", - Expected: []sql.Row{}, + Expected: []sql.UntypedSqlRow{}, }, { Query: "/* client a */ delete from t where y = 2", - Expected: []sql.Row{{types.NewOkResult(1)}}, + Expected: []sql.UntypedSqlRow{{types.NewOkResult(1)}}, }, { Query: "/* client b */ delete from t where y = 3", - Expected: []sql.Row{{types.NewOkResult(1)}}, + Expected: []sql.UntypedSqlRow{{types.NewOkResult(1)}}, }, { Query: "/* client a */ commit", - Expected: []sql.Row{}, + Expected: []sql.UntypedSqlRow{}, }, { Query: "/* client b */ commit", - Expected: []sql.Row{}, + Expected: []sql.UntypedSqlRow{}, }, { Query: "/* client a */ select * from t order by x", - Expected: []sql.Row{{1, 1}}, + Expected: []sql.UntypedSqlRow{{1, 1}}, }, { Query: "/* client b */ select * from t order by x", - Expected: []sql.Row{{1, 1}}, + Expected: []sql.UntypedSqlRow{{1, 1}}, }, }, }, @@ -534,15 +534,15 @@ var DoltTransactionTests = []queries.TransactionTest{ Assertions: []queries.ScriptTestAssertion{ { Query: "/* client a */ start transaction", - Expected: []sql.Row{}, + Expected: []sql.UntypedSqlRow{}, }, { Query: "/* client b */ start transaction", - Expected: []sql.Row{}, + Expected: []sql.UntypedSqlRow{}, }, { Query: "/* client a */ update t set y = 3 where y = 2", - Expected: []sql.Row{{types.OkResult{ + Expected: []sql.UntypedSqlRow{{types.OkResult{ RowsAffected: uint64(1), Info: plan.UpdateInfo{ Matched: 1, @@ -552,11 +552,11 @@ var DoltTransactionTests = []queries.TransactionTest{ }, { Query: "/* client b */ delete from t where y = 2", - Expected: []sql.Row{{types.NewOkResult(1)}}, + Expected: []sql.UntypedSqlRow{{types.NewOkResult(1)}}, }, { Query: "/* client a */ commit", - Expected: []sql.Row{}, + Expected: []sql.UntypedSqlRow{}, }, { Query: "/* client b */ commit", @@ -564,15 +564,15 @@ var DoltTransactionTests = []queries.TransactionTest{ }, { Query: "/* client b */ rollback", - Expected: []sql.Row{}, + Expected: []sql.UntypedSqlRow{}, }, { Query: "/* client a */ select * from t order by x", - Expected: []sql.Row{{1, 1}, {2, 3}}, + Expected: []sql.UntypedSqlRow{{1, 1}, {2, 3}}, }, { Query: "/* client b */ select * from t order by x", - Expected: []sql.Row{{1, 1}, {2, 3}}, + Expected: []sql.UntypedSqlRow{{1, 1}, {2, 3}}, }, }, }, @@ -585,39 +585,39 @@ var DoltTransactionTests = []queries.TransactionTest{ Assertions: []queries.ScriptTestAssertion{ { Query: "/* client a */ start transaction", - Expected: []sql.Row{}, + Expected: []sql.UntypedSqlRow{}, }, { Query: "/* client b */ start transaction", - Expected: []sql.Row{}, + Expected: []sql.UntypedSqlRow{}, }, { Query: "/* client a */ delete from t where y = 1", - Expected: []sql.Row{{types.NewOkResult(1)}}, + Expected: []sql.UntypedSqlRow{{types.NewOkResult(1)}}, }, { Query: "/* client b */ delete from t", - Expected: []sql.Row{{types.NewOkResult(2)}}, + Expected: []sql.UntypedSqlRow{{types.NewOkResult(2)}}, }, { Query: "/* client b */ insert into t values (1,1)", - Expected: []sql.Row{{types.NewOkResult(1)}}, + Expected: []sql.UntypedSqlRow{{types.NewOkResult(1)}}, }, { Query: "/* client a */ commit", - Expected: []sql.Row{}, + Expected: []sql.UntypedSqlRow{}, }, { Query: "/* client b */ commit", - Expected: []sql.Row{}, + Expected: []sql.UntypedSqlRow{}, }, { Query: "/* client a */ select * from t order by x", - Expected: []sql.Row{}, + Expected: []sql.UntypedSqlRow{}, }, { Query: "/* client b */ select * from t order by x", - Expected: []sql.Row{}, + Expected: []sql.UntypedSqlRow{}, }, }, }, @@ -630,19 +630,19 @@ var DoltTransactionTests = []queries.TransactionTest{ Assertions: []queries.ScriptTestAssertion{ { Query: "/* client a */ start transaction", - Expected: []sql.Row{}, + Expected: []sql.UntypedSqlRow{}, }, { Query: "/* client b */ start transaction", - Expected: []sql.Row{}, + Expected: []sql.UntypedSqlRow{}, }, { Query: "/* client c */ start transaction", - Expected: []sql.Row{}, + Expected: []sql.UntypedSqlRow{}, }, { Query: "/* client a */ update t set y = 3 where y = 2", - Expected: []sql.Row{{types.OkResult{ + Expected: []sql.UntypedSqlRow{{types.OkResult{ RowsAffected: uint64(1), Info: plan.UpdateInfo{ Matched: 1, @@ -652,11 +652,11 @@ var DoltTransactionTests = []queries.TransactionTest{ }, { Query: "/* client b */ delete from t where y = 1", - Expected: []sql.Row{{types.NewOkResult(1)}}, + Expected: []sql.UntypedSqlRow{{types.NewOkResult(1)}}, }, { Query: "/* client c */ update t set z = 4 where y = 2", - Expected: []sql.Row{{types.OkResult{ + Expected: []sql.UntypedSqlRow{{types.OkResult{ RowsAffected: uint64(1), Info: plan.UpdateInfo{ Matched: 1, @@ -666,39 +666,39 @@ var DoltTransactionTests = []queries.TransactionTest{ }, { Query: "/* client a */ commit", - Expected: []sql.Row{}, + Expected: []sql.UntypedSqlRow{}, }, { Query: "/* client b */ commit", - Expected: []sql.Row{}, + Expected: []sql.UntypedSqlRow{}, }, { Query: "/* client a */ select * from t order by x", - Expected: []sql.Row{{2, 3, 2}}, + Expected: []sql.UntypedSqlRow{{2, 3, 2}}, }, { Query: "/* client b */ select * from t order by x", - Expected: []sql.Row{{2, 3, 2}}, + Expected: []sql.UntypedSqlRow{{2, 3, 2}}, }, { Query: "/* client c */ select * from t order by x", - Expected: []sql.Row{{1, 1, 1}, {2, 2, 4}}, + Expected: []sql.UntypedSqlRow{{1, 1, 1}, {2, 2, 4}}, }, { Query: "/* client c */ commit", - Expected: []sql.Row{}, + Expected: []sql.UntypedSqlRow{}, }, { Query: "/* client a */ select * from t order by x", - Expected: []sql.Row{{2, 3, 4}}, + Expected: []sql.UntypedSqlRow{{2, 3, 4}}, }, { Query: "/* client b */ select * from t order by x", - Expected: []sql.Row{{2, 3, 4}}, + Expected: []sql.UntypedSqlRow{{2, 3, 4}}, }, { Query: "/* client c */ select * from t order by x", - Expected: []sql.Row{{2, 3, 4}}, + Expected: []sql.UntypedSqlRow{{2, 3, 4}}, }, }, }, @@ -711,11 +711,11 @@ var DoltTransactionTests = []queries.TransactionTest{ Assertions: []queries.ScriptTestAssertion{ { Query: "/* client b */ start transaction", - Expected: []sql.Row{}, + Expected: []sql.UntypedSqlRow{}, }, { Query: "/* client a */ update test set y = 3 where y = 2", - Expected: []sql.Row{{types.OkResult{ + Expected: []sql.UntypedSqlRow{{types.OkResult{ RowsAffected: uint64(1), Info: plan.UpdateInfo{ Matched: 1, @@ -725,7 +725,7 @@ var DoltTransactionTests = []queries.TransactionTest{ }, { Query: "/* client b */ update test set y = 5 where y = 2", - Expected: []sql.Row{{types.OkResult{ + Expected: []sql.UntypedSqlRow{{types.OkResult{ RowsAffected: uint64(1), Info: plan.UpdateInfo{ Matched: 1, @@ -735,19 +735,19 @@ var DoltTransactionTests = []queries.TransactionTest{ }, { Query: "/* client a */ commit", - Expected: []sql.Row{}, + Expected: []sql.UntypedSqlRow{}, }, { Query: "/* client b */ commit", - Expected: []sql.Row{}, + Expected: []sql.UntypedSqlRow{}, }, { Query: "/* client a */ select * from test order by x", - Expected: []sql.Row{{1, 1, 1}, {2, 3, 2}, {2, 5, 2}}, + Expected: []sql.UntypedSqlRow{{1, 1, 1}, {2, 3, 2}, {2, 5, 2}}, }, { Query: "/* client b */ select * from test order by x", - Expected: []sql.Row{{1, 1, 1}, {2, 3, 2}, {2, 5, 2}}, + Expected: []sql.UntypedSqlRow{{1, 1, 1}, {2, 3, 2}, {2, 5, 2}}, }, { Query: "/* client b */ insert into test values (4,3,2)", @@ -770,46 +770,46 @@ var DoltTransactionTests = []queries.TransactionTest{ { // Create a table for the FK to reference Query: "/* client a */ CREATE TABLE ref (id varchar(100) PRIMARY KEY, status int);", - Expected: []sql.Row{{types.NewOkResult(0)}}, + Expected: []sql.UntypedSqlRow{{types.NewOkResult(0)}}, }, { // Create a table with an FK Query: "/* client a */ CREATE TABLE t (id int, ref_id varchar(100), FOREIGN KEY (ref_id) REFERENCES ref(id));", - Expected: []sql.Row{{types.NewOkResult(0)}}, + Expected: []sql.UntypedSqlRow{{types.NewOkResult(0)}}, }, { Query: "/* client a */ COMMIT;", - Expected: []sql.Row{}, + Expected: []sql.UntypedSqlRow{}, }, { // Turn @@foreign_key_checks back on in client a Query: "/* client a */ SET @@foreign_key_checks=1;", - Expected: []sql.Row{{}}, + Expected: []sql.UntypedSqlRow{{}}, }, { // Reference the table with an unresolved FK, so that it gets loaded and resolved Query: "/* client a */ UPDATE t SET ref_id = 42 where ref_id > 100000;", - Expected: []sql.Row{{types.OkResult{Info: plan.UpdateInfo{}}}}, + Expected: []sql.UntypedSqlRow{{types.OkResult{Info: plan.UpdateInfo{}}}}, }, { // Make any change in client b's session Query: "/* client b */ create table foo (i int);", - Expected: []sql.Row{{types.OkResult{RowsAffected: 0}}}, + Expected: []sql.UntypedSqlRow{{types.OkResult{RowsAffected: 0}}}, }, { // Client a still has an unresolved FK at this point Query: "/* client a */ COMMIT;", - Expected: []sql.Row{}, + Expected: []sql.UntypedSqlRow{}, }, { // Assert that client a can see the schema with the foreign key constraints still present Query: "/* client a */ show create table t;", - Expected: []sql.Row{{"t", "CREATE TABLE `t` (\n `id` int,\n `ref_id` varchar(100),\n KEY `ref_id` (`ref_id`),\n CONSTRAINT `t_ibfk_1` FOREIGN KEY (`ref_id`) REFERENCES `ref` (`id`)\n) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_bin"}}, + Expected: []sql.UntypedSqlRow{{"t", "CREATE TABLE `t` (\n `id` int,\n `ref_id` varchar(100),\n KEY `ref_id` (`ref_id`),\n CONSTRAINT `t_ibfk_1` FOREIGN KEY (`ref_id`) REFERENCES `ref` (`id`)\n) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_bin"}}, }, { // Assert that client b can see the schema with the foreign key constraints still present Query: "/* client b */ show create table t;", - Expected: []sql.Row{{"t", "CREATE TABLE `t` (\n `id` int,\n `ref_id` varchar(100),\n KEY `ref_id` (`ref_id`),\n CONSTRAINT `t_ibfk_1` FOREIGN KEY (`ref_id`) REFERENCES `ref` (`id`)\n) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_bin"}}, + Expected: []sql.UntypedSqlRow{{"t", "CREATE TABLE `t` (\n `id` int,\n `ref_id` varchar(100),\n KEY `ref_id` (`ref_id`),\n CONSTRAINT `t_ibfk_1` FOREIGN KEY (`ref_id`) REFERENCES `ref` (`id`)\n) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_bin"}}, }, }, }, @@ -827,7 +827,7 @@ var DoltTransactionTests = []queries.TransactionTest{ }, { Query: "/* client a */ select @@transaction_isolation, @@autocommit", - Expected: []sql.Row{{"READ-COMMITTED", 0}}, + Expected: []sql.UntypedSqlRow{{"READ-COMMITTED", 0}}, }, { Query: "/* client a */ savepoint abc", @@ -835,7 +835,7 @@ var DoltTransactionTests = []queries.TransactionTest{ }, { Query: "/* client a */ release savepoint abc", - Expected: []sql.Row{}, + Expected: []sql.UntypedSqlRow{}, }, }, }, @@ -853,31 +853,31 @@ var DoltConflictHandlingTests = []queries.TransactionTest{ Assertions: []queries.ScriptTestAssertion{ { Query: "/* client a */ set autocommit = off", - Expected: []sql.Row{{}}, + Expected: []sql.UntypedSqlRow{{}}, }, { Query: "/* client a */ start transaction", - Expected: []sql.Row{}, + Expected: []sql.UntypedSqlRow{}, }, { Query: "/* client b */ set autocommit = off", - Expected: []sql.Row{{}}, + Expected: []sql.UntypedSqlRow{{}}, }, { Query: "/* client b */ start transaction", - Expected: []sql.Row{}, + Expected: []sql.UntypedSqlRow{}, }, { Query: "/* client a */ insert into test values (1, 1)", - Expected: []sql.Row{{types.NewOkResult(1)}}, + Expected: []sql.UntypedSqlRow{{types.NewOkResult(1)}}, }, { Query: "/* client b */ insert into test values (1, 2)", - Expected: []sql.Row{{types.NewOkResult(1)}}, + Expected: []sql.UntypedSqlRow{{types.NewOkResult(1)}}, }, { Query: "/* client a */ commit", - Expected: []sql.Row{}, + Expected: []sql.UntypedSqlRow{}, }, { Query: "/* client b */ commit", @@ -885,11 +885,11 @@ var DoltConflictHandlingTests = []queries.TransactionTest{ }, { // no conflicts, transaction got rolled back Query: "/* client b */ select count(*) from dolt_conflicts", - Expected: []sql.Row{{0}}, + Expected: []sql.UntypedSqlRow{{0}}, }, { Query: "/* client b */ select * from test order by 1", - Expected: []sql.Row{{0, 0}, {1, 1}}, + Expected: []sql.UntypedSqlRow{{0, 0}, {1, 1}}, }, }, }, @@ -904,31 +904,31 @@ var DoltConflictHandlingTests = []queries.TransactionTest{ Assertions: []queries.ScriptTestAssertion{ { Query: "/* client a */ set autocommit = off, dolt_allow_commit_conflicts = on", - Expected: []sql.Row{{}}, + Expected: []sql.UntypedSqlRow{{}}, }, { Query: "/* client a */ start transaction", - Expected: []sql.Row{}, + Expected: []sql.UntypedSqlRow{}, }, { Query: "/* client b */ set autocommit = off, dolt_allow_commit_conflicts = on", - Expected: []sql.Row{{}}, + Expected: []sql.UntypedSqlRow{{}}, }, { Query: "/* client b */ start transaction", - Expected: []sql.Row{}, + Expected: []sql.UntypedSqlRow{}, }, { Query: "/* client a */ insert into test values (1, 1)", - Expected: []sql.Row{{types.NewOkResult(1)}}, + Expected: []sql.UntypedSqlRow{{types.NewOkResult(1)}}, }, { Query: "/* client b */ insert into test values (1, 2)", - Expected: []sql.Row{{types.NewOkResult(1)}}, + Expected: []sql.UntypedSqlRow{{types.NewOkResult(1)}}, }, { Query: "/* client a */ commit", - Expected: []sql.Row{}, + Expected: []sql.UntypedSqlRow{}, }, { Query: "/* client b */ commit", @@ -936,11 +936,11 @@ var DoltConflictHandlingTests = []queries.TransactionTest{ }, { // We see the merge value from a's commit here because we were rolled back and a new transaction begun Query: "/* client b */ select * from test order by 1", - Expected: []sql.Row{{0, 0}, {1, 1}}, + Expected: []sql.UntypedSqlRow{{0, 0}, {1, 1}}, }, { // no conflicts, transaction got rolled back Query: "/* client b */ select count(*) from dolt_conflicts", - Expected: []sql.Row{{0}}, + Expected: []sql.UntypedSqlRow{{0}}, }, }, }, @@ -955,31 +955,31 @@ var DoltConflictHandlingTests = []queries.TransactionTest{ Assertions: []queries.ScriptTestAssertion{ { Query: "/* client a */ set autocommit = off, dolt_force_transaction_commit = on", - Expected: []sql.Row{{}}, + Expected: []sql.UntypedSqlRow{{}}, }, { Query: "/* client a */ start transaction", - Expected: []sql.Row{}, + Expected: []sql.UntypedSqlRow{}, }, { Query: "/* client b */ set autocommit = off, dolt_force_transaction_commit = on", - Expected: []sql.Row{{}}, + Expected: []sql.UntypedSqlRow{{}}, }, { Query: "/* client b */ start transaction", - Expected: []sql.Row{}, + Expected: []sql.UntypedSqlRow{}, }, { Query: "/* client a */ insert into test values (1, 1)", - Expected: []sql.Row{{types.NewOkResult(1)}}, + Expected: []sql.UntypedSqlRow{{types.NewOkResult(1)}}, }, { Query: "/* client b */ insert into test values (1, 2)", - Expected: []sql.Row{{types.NewOkResult(1)}}, + Expected: []sql.UntypedSqlRow{{types.NewOkResult(1)}}, }, { Query: "/* client a */ commit", - Expected: []sql.Row{}, + Expected: []sql.UntypedSqlRow{}, }, { Query: "/* client b */ commit", @@ -987,11 +987,11 @@ var DoltConflictHandlingTests = []queries.TransactionTest{ }, { // We see the merge value from a's commit here because we were rolled back and a new transaction begun Query: "/* client b */ select * from test order by 1", - Expected: []sql.Row{{0, 0}, {1, 1}}, + Expected: []sql.UntypedSqlRow{{0, 0}, {1, 1}}, }, { // no conflicts, transaction got rolled back Query: "/* client b */ select count(*) from dolt_conflicts", - Expected: []sql.Row{{0}}, + Expected: []sql.UntypedSqlRow{{0}}, }, }, }, @@ -1006,23 +1006,23 @@ var DoltConflictHandlingTests = []queries.TransactionTest{ Assertions: []queries.ScriptTestAssertion{ { Query: "/* client a */ set autocommit = off, dolt_allow_commit_conflicts = on", - Expected: []sql.Row{{}}, + Expected: []sql.UntypedSqlRow{{}}, }, { Query: "/* client a */ start transaction", - Expected: []sql.Row{}, + Expected: []sql.UntypedSqlRow{}, }, { Query: "/* client b */ set autocommit = off, dolt_allow_commit_conflicts = on", - Expected: []sql.Row{{}}, + Expected: []sql.UntypedSqlRow{{}}, }, { Query: "/* client b */ start transaction", - Expected: []sql.Row{}, + Expected: []sql.UntypedSqlRow{}, }, { Query: "/* client a */ insert into test values (1, 1)", - Expected: []sql.Row{{types.NewOkResult(1)}}, + Expected: []sql.UntypedSqlRow{{types.NewOkResult(1)}}, }, { Query: "/* client b */ call dolt_checkout('-b', 'new-branch')", @@ -1034,7 +1034,7 @@ var DoltConflictHandlingTests = []queries.TransactionTest{ }, { Query: "/* client b */ insert into test values (1, 2)", - Expected: []sql.Row{{types.NewOkResult(1)}}, + Expected: []sql.UntypedSqlRow{{types.NewOkResult(1)}}, }, { Query: "/* client b */ call dolt_commit('-am', 'commit on new-branch')", @@ -1042,25 +1042,25 @@ var DoltConflictHandlingTests = []queries.TransactionTest{ }, { Query: "/* client b */ call dolt_merge('main')", - Expected: []sql.Row{{"", 0, 1, "conflicts found"}}, + Expected: []sql.UntypedSqlRow{{"", 0, 1, "conflicts found"}}, }, { Query: "/* client b */ select count(*) from dolt_conflicts", - Expected: []sql.Row{{1}}, + Expected: []sql.UntypedSqlRow{{1}}, }, { Query: "/* client b */ select * from test order by 1", - Expected: []sql.Row{{0, 0}, {1, 2}}, + Expected: []sql.UntypedSqlRow{{0, 0}, {1, 2}}, }, { // no error because of our session settings // TODO: we should also be able to commit this if the other client made a compatible change // (has the same merge conflicts we do), but that's an error right now Query: "/* client b */ commit", - Expected: []sql.Row{}, + Expected: []sql.UntypedSqlRow{}, }, { // TODO: it should be possible to do this without specifying a literal in the subselect, but it's not working Query: "/* client b */ update test t set val = (select their_val from dolt_conflicts_test where our_pk = 1) where pk = 1", - Expected: []sql.Row{{types.OkResult{ + Expected: []sql.UntypedSqlRow{{types.OkResult{ RowsAffected: 1, Info: plan.UpdateInfo{ Matched: 1, @@ -1070,19 +1070,19 @@ var DoltConflictHandlingTests = []queries.TransactionTest{ }, { Query: "/* client b */ delete from dolt_conflicts_test", - Expected: []sql.Row{{types.NewOkResult(1)}}, + Expected: []sql.UntypedSqlRow{{types.NewOkResult(1)}}, }, { Query: "/* client b */ commit", - Expected: []sql.Row{}, + Expected: []sql.UntypedSqlRow{}, }, { Query: "/* client b */ select * from test order by 1", - Expected: []sql.Row{{0, 0}, {1, 1}}, + Expected: []sql.UntypedSqlRow{{0, 0}, {1, 1}}, }, { Query: "/* client b */ select count(*) from dolt_conflicts", - Expected: []sql.Row{{0}}, + Expected: []sql.UntypedSqlRow{{0}}, }, }, }, @@ -1097,23 +1097,23 @@ var DoltConflictHandlingTests = []queries.TransactionTest{ Assertions: []queries.ScriptTestAssertion{ { Query: "/* client a */ set autocommit = off, dolt_force_transaction_commit = on", - Expected: []sql.Row{{}}, + Expected: []sql.UntypedSqlRow{{}}, }, { Query: "/* client a */ start transaction", - Expected: []sql.Row{}, + Expected: []sql.UntypedSqlRow{}, }, { Query: "/* client b */ set autocommit = off, dolt_force_transaction_commit = on", - Expected: []sql.Row{{}}, + Expected: []sql.UntypedSqlRow{{}}, }, { Query: "/* client b */ start transaction", - Expected: []sql.Row{}, + Expected: []sql.UntypedSqlRow{}, }, { Query: "/* client a */ insert into test values (1, 1)", - Expected: []sql.Row{{types.NewOkResult(1)}}, + Expected: []sql.UntypedSqlRow{{types.NewOkResult(1)}}, }, { Query: "/* client b */ call dolt_checkout('-b', 'new-branch')", @@ -1125,7 +1125,7 @@ var DoltConflictHandlingTests = []queries.TransactionTest{ }, { Query: "/* client b */ insert into test values (1, 2)", - Expected: []sql.Row{{types.NewOkResult(1)}}, + Expected: []sql.UntypedSqlRow{{types.NewOkResult(1)}}, }, { Query: "/* client b */ call dolt_commit('-am', 'commit on new-branch')", @@ -1133,23 +1133,23 @@ var DoltConflictHandlingTests = []queries.TransactionTest{ }, { Query: "/* client b */ call dolt_merge('main')", - Expected: []sql.Row{{"", 0, 1, "conflicts found"}}, + Expected: []sql.UntypedSqlRow{{"", 0, 1, "conflicts found"}}, }, { Query: "/* client b */ select count(*) from dolt_conflicts", - Expected: []sql.Row{{1}}, + Expected: []sql.UntypedSqlRow{{1}}, }, { Query: "/* client b */ select * from test order by 1", - Expected: []sql.Row{{0, 0}, {1, 2}}, + Expected: []sql.UntypedSqlRow{{0, 0}, {1, 2}}, }, { // no error because of our session settings Query: "/* client b */ commit", - Expected: []sql.Row{}, + Expected: []sql.UntypedSqlRow{}, }, { // TODO: it should be possible to do this without specifying a literal in the subselect, but it's not working Query: "/* client b */ update test t set val = (select their_val from dolt_conflicts_test where our_pk = 1) where pk = 1", - Expected: []sql.Row{{types.OkResult{ + Expected: []sql.UntypedSqlRow{{types.OkResult{ RowsAffected: 1, Info: plan.UpdateInfo{ Matched: 1, @@ -1159,19 +1159,19 @@ var DoltConflictHandlingTests = []queries.TransactionTest{ }, { Query: "/* client b */ delete from dolt_conflicts_test", - Expected: []sql.Row{{types.NewOkResult(1)}}, + Expected: []sql.UntypedSqlRow{{types.NewOkResult(1)}}, }, { Query: "/* client b */ commit", - Expected: []sql.Row{}, + Expected: []sql.UntypedSqlRow{}, }, { Query: "/* client b */ select * from test order by 1", - Expected: []sql.Row{{0, 0}, {1, 1}}, + Expected: []sql.UntypedSqlRow{{0, 0}, {1, 1}}, }, { Query: "/* client b */ select count(*) from dolt_conflicts", - Expected: []sql.Row{{0}}, + Expected: []sql.UntypedSqlRow{{0}}, }, }, }, @@ -1186,23 +1186,23 @@ var DoltConflictHandlingTests = []queries.TransactionTest{ Assertions: []queries.ScriptTestAssertion{ { Query: "/* client a */ set autocommit = off", - Expected: []sql.Row{{}}, + Expected: []sql.UntypedSqlRow{{}}, }, { Query: "/* client a */ start transaction", - Expected: []sql.Row{}, + Expected: []sql.UntypedSqlRow{}, }, { Query: "/* client b */ set autocommit = off", - Expected: []sql.Row{{}}, + Expected: []sql.UntypedSqlRow{{}}, }, { Query: "/* client b */ start transaction", - Expected: []sql.Row{}, + Expected: []sql.UntypedSqlRow{}, }, { Query: "/* client a */ insert into test values (1, 1)", - Expected: []sql.Row{{types.NewOkResult(1)}}, + Expected: []sql.UntypedSqlRow{{types.NewOkResult(1)}}, }, { Query: "/* client b */ call dolt_checkout('-b', 'new-branch')", @@ -1214,7 +1214,7 @@ var DoltConflictHandlingTests = []queries.TransactionTest{ }, { Query: "/* client b */ insert into test values (1, 2)", - Expected: []sql.Row{{types.NewOkResult(1)}}, + Expected: []sql.UntypedSqlRow{{types.NewOkResult(1)}}, }, { Query: "/* client b */ call dolt_commit('-am', 'commit on new-branch')", @@ -1222,19 +1222,19 @@ var DoltConflictHandlingTests = []queries.TransactionTest{ }, { Query: "/* client b */ call dolt_merge('main')", - Expected: []sql.Row{{"", 0, 1, "conflicts found"}}, + Expected: []sql.UntypedSqlRow{{"", 0, 1, "conflicts found"}}, }, { Query: "/* client b */ select count(*) from dolt_conflicts", - Expected: []sql.Row{{1}}, + Expected: []sql.UntypedSqlRow{{1}}, }, { Query: "/* client b */ select * from test order by 1", - Expected: []sql.Row{{0, 0}, {1, 2}}, + Expected: []sql.UntypedSqlRow{{0, 0}, {1, 2}}, }, { Query: "/* client b */ insert into test values (2, 2)", - Expected: []sql.Row{{types.NewOkResult(1)}}, + Expected: []sql.UntypedSqlRow{{types.NewOkResult(1)}}, }, { Query: "/* client b */ commit", @@ -1242,7 +1242,7 @@ var DoltConflictHandlingTests = []queries.TransactionTest{ }, { // our transaction got rolled back, so we lose the above insert Query: "/* client b */ select * from test order by 1", - Expected: []sql.Row{{0, 0}, {1, 2}}, + Expected: []sql.UntypedSqlRow{{0, 0}, {1, 2}}, }, }, }, @@ -1268,37 +1268,37 @@ var DoltConflictHandlingTests = []queries.TransactionTest{ Assertions: []queries.ScriptTestAssertion{ { Query: "/* client a */ SET @@autocommit=0;", - Expected: []sql.Row{{}}, + Expected: []sql.UntypedSqlRow{{}}, }, { Query: "/* client b */ SET @@autocommit=0;", - Expected: []sql.Row{{}}, + Expected: []sql.UntypedSqlRow{{}}, }, { Query: "/* client a */ SELECT base_pk, base_col1, our_pk, our_col1, their_pk, their_col1 from dolt_conflicts_t;", - Expected: []sql.Row{{nil, nil, 1, 200, 1, 100}}, + Expected: []sql.UntypedSqlRow{{nil, nil, 1, 200, 1, 100}}, }, { Query: "/* client b */ SELECT base_pk, base_col1, our_pk, our_col1, their_pk, their_col1 from dolt_conflicts_t;", - Expected: []sql.Row{{nil, nil, 1, 200, 1, 100}}, + Expected: []sql.UntypedSqlRow{{nil, nil, 1, 200, 1, 100}}, }, // nominal inserts that will not result in a conflict or constraint violation // They are needed to trigger a three-way transaction merge { Query: "/* client a */ INSERT into t VALUES (2, 2);", - Expected: []sql.Row{{types.NewOkResult(1)}}, + Expected: []sql.UntypedSqlRow{{types.NewOkResult(1)}}, }, { Query: "/* client b */ INSERT into t VALUES (3, 3);", - Expected: []sql.Row{{types.NewOkResult(1)}}, + Expected: []sql.UntypedSqlRow{{types.NewOkResult(1)}}, }, { Query: "/* client a */ SET dolt_allow_commit_conflicts = on;", - Expected: []sql.Row{{}}, + Expected: []sql.UntypedSqlRow{{}}, }, { Query: "/* client a */ COMMIT;", - Expected: []sql.Row{}, + Expected: []sql.UntypedSqlRow{}, }, { Query: "/* client b */ COMMIT;", @@ -1307,7 +1307,7 @@ var DoltConflictHandlingTests = []queries.TransactionTest{ }, { Query: "/* client b */ INSERT into t VALUES (3, 3);", - Expected: []sql.Row{{types.NewOkResult(1)}}, + Expected: []sql.UntypedSqlRow{{types.NewOkResult(1)}}, }, { Query: "/* client b */ COMMIT;", @@ -1327,31 +1327,31 @@ var DoltConflictHandlingTests = []queries.TransactionTest{ Assertions: []queries.ScriptTestAssertion{ { Query: "/* client a */ START TRANSACTION", - Expected: []sql.Row{}, + Expected: []sql.UntypedSqlRow{}, }, { Query: "/* client b */ START TRANSACTION", - Expected: []sql.Row{}, + Expected: []sql.UntypedSqlRow{}, }, { Query: "/* client a */ UPDATE t SET col1 = -100 where pk = 1;", - Expected: []sql.Row{{types.OkResult{RowsAffected: 1, Info: plan.UpdateInfo{Matched: 1, Updated: 1}}}}, + Expected: []sql.UntypedSqlRow{{types.OkResult{RowsAffected: 1, Info: plan.UpdateInfo{Matched: 1, Updated: 1}}}}, }, { Query: "/* client b */ UPDATE t SET col1 = 100 where pk = 1;", - Expected: []sql.Row{{types.OkResult{RowsAffected: 1, Info: plan.UpdateInfo{Matched: 1, Updated: 1}}}}, + Expected: []sql.UntypedSqlRow{{types.OkResult{RowsAffected: 1, Info: plan.UpdateInfo{Matched: 1, Updated: 1}}}}, }, { Query: "/* client a */ INSERT into KEYLESS VALUES (1);", - Expected: []sql.Row{{types.NewOkResult(1)}}, + Expected: []sql.UntypedSqlRow{{types.NewOkResult(1)}}, }, { Query: "/* client b */ INSERT into KEYLESS VALUES (1), (1);", - Expected: []sql.Row{{types.NewOkResult(2)}}, + Expected: []sql.UntypedSqlRow{{types.NewOkResult(2)}}, }, { Query: "/* client a */ COMMIT;", - Expected: []sql.Row{}, + Expected: []sql.UntypedSqlRow{}, }, { Query: "/* client b */ COMMIT;", @@ -1359,15 +1359,15 @@ var DoltConflictHandlingTests = []queries.TransactionTest{ }, { Query: "/* client b */ SELECT * from t;", - Expected: []sql.Row{{1, -100}}, + Expected: []sql.UntypedSqlRow{{1, -100}}, }, { Query: "/* client b */ SELECT * from keyless;", - Expected: []sql.Row{{1}, {1}}, + Expected: []sql.UntypedSqlRow{{1}, {1}}, }, { Query: "/* client b */ SELECT * from t where col1 = -100;", - Expected: []sql.Row{{1, -100}}, + Expected: []sql.UntypedSqlRow{{1, -100}}, }, }, }, @@ -1382,31 +1382,31 @@ var DoltConflictHandlingTests = []queries.TransactionTest{ Assertions: []queries.ScriptTestAssertion{ { Query: "/* client a */ START TRANSACTION", - Expected: []sql.Row{}, + Expected: []sql.UntypedSqlRow{}, }, { Query: "/* client b */ START TRANSACTION", - Expected: []sql.Row{}, + Expected: []sql.UntypedSqlRow{}, }, { Query: "/* client a */ UPDATE t SET col1 = -100 where pk = 1;", - Expected: []sql.Row{{types.OkResult{RowsAffected: 1, Info: plan.UpdateInfo{Matched: 1, Updated: 1}}}}, + Expected: []sql.UntypedSqlRow{{types.OkResult{RowsAffected: 1, Info: plan.UpdateInfo{Matched: 1, Updated: 1}}}}, }, { Query: "/* client b */ UPDATE t SET col1 = 100 where pk = 1;", - Expected: []sql.Row{{types.OkResult{RowsAffected: 1, Info: plan.UpdateInfo{Matched: 1, Updated: 1}}}}, + Expected: []sql.UntypedSqlRow{{types.OkResult{RowsAffected: 1, Info: plan.UpdateInfo{Matched: 1, Updated: 1}}}}, }, { Query: "/* client a */ INSERT into KEYLESS VALUES (1);", - Expected: []sql.Row{{types.NewOkResult(1)}}, + Expected: []sql.UntypedSqlRow{{types.NewOkResult(1)}}, }, { Query: "/* client b */ INSERT into KEYLESS VALUES (1), (1);", - Expected: []sql.Row{{types.NewOkResult(2)}}, + Expected: []sql.UntypedSqlRow{{types.NewOkResult(2)}}, }, { Query: "/* client b */ COMMIT;", - Expected: []sql.Row{}, + Expected: []sql.UntypedSqlRow{}, }, { Query: "/* client a */ COMMIT;", @@ -1414,15 +1414,15 @@ var DoltConflictHandlingTests = []queries.TransactionTest{ }, { Query: "/* client b */ SELECT * from t;", - Expected: []sql.Row{{1, 100}}, + Expected: []sql.UntypedSqlRow{{1, 100}}, }, { Query: "/* client b */ SELECT * from keyless;", - Expected: []sql.Row{{1}, {1}, {1}}, + Expected: []sql.UntypedSqlRow{{1}, {1}, {1}}, }, { Query: "/* client b */ SELECT * from t where col1 = 100;", - Expected: []sql.Row{{1, 100}}, + Expected: []sql.UntypedSqlRow{{1, 100}}, }, }, }, @@ -1447,59 +1447,59 @@ var DoltStoredProcedureTransactionTests = []queries.TransactionTest{ Assertions: []queries.ScriptTestAssertion{ { Query: "/* client a */ start transaction", - Expected: []sql.Row{}, + Expected: []sql.UntypedSqlRow{}, }, { Query: "/* client b */ start transaction", - Expected: []sql.Row{}, + Expected: []sql.UntypedSqlRow{}, }, { Query: "/* client a */ CALL DOLT_MERGE('feature-branch')", - Expected: []sql.Row{{"", 0, 1, "conflicts found"}}, + Expected: []sql.UntypedSqlRow{{"", 0, 1, "conflicts found"}}, }, { Query: "/* client a */ SELECT count(*) from dolt_conflicts_test", - Expected: []sql.Row{{1}}, + Expected: []sql.UntypedSqlRow{{1}}, }, { Query: "/* client b */ SELECT count(*) from dolt_conflicts_test", - Expected: []sql.Row{{0}}, + Expected: []sql.UntypedSqlRow{{0}}, }, { Query: "/* client a */ set dolt_allow_commit_conflicts = 1", - Expected: []sql.Row{{}}, + Expected: []sql.UntypedSqlRow{{}}, }, { Query: "/* client a */ commit", - Expected: []sql.Row{}, + Expected: []sql.UntypedSqlRow{}, }, { Query: "/* client b */ start transaction", - Expected: []sql.Row{}, + Expected: []sql.UntypedSqlRow{}, }, { Query: "/* client b */ SELECT count(*) from dolt_conflicts_test", - Expected: []sql.Row{{1}}, + Expected: []sql.UntypedSqlRow{{1}}, }, { Query: "/* client a */ start transaction", - Expected: []sql.Row{}, + Expected: []sql.UntypedSqlRow{}, }, { Query: "/* client a */ CALL DOLT_MERGE('--abort')", - Expected: []sql.Row{{"", 0, 0, "merge aborted"}}, + Expected: []sql.UntypedSqlRow{{"", 0, 0, "merge aborted"}}, }, { Query: "/* client a */ commit", - Expected: []sql.Row{}, + Expected: []sql.UntypedSqlRow{}, }, { Query: "/* client b */ start transaction", - Expected: []sql.Row{}, + Expected: []sql.UntypedSqlRow{}, }, { Query: "/* client a */ SET @@dolt_allow_commit_conflicts = 0", - Expected: []sql.Row{{}}, + Expected: []sql.UntypedSqlRow{{}}, }, { Query: "/* client a */ CALL DOLT_MERGE('feature-branch')", @@ -1507,15 +1507,15 @@ var DoltStoredProcedureTransactionTests = []queries.TransactionTest{ }, { // client rolled back on merge with conflicts Query: "/* client a */ SELECT count(*) from dolt_conflicts_test", - Expected: []sql.Row{{0}}, + Expected: []sql.UntypedSqlRow{{0}}, }, { Query: "/* client a */ commit", - Expected: []sql.Row{}, + Expected: []sql.UntypedSqlRow{}, }, { Query: "/* client b */ SELECT count(*) from dolt_conflicts_test", - Expected: []sql.Row{{0}}, + Expected: []sql.UntypedSqlRow{{0}}, }, }, }, @@ -1553,19 +1553,19 @@ var DoltStoredProcedureTransactionTests = []queries.TransactionTest{ }, { Query: "/* client a */ select count(*) from dolt_status", // clean working set - Expected: []sql.Row{{0}}, + Expected: []sql.UntypedSqlRow{{0}}, }, { Query: "/* client b */ select count(*) from dolt_status", // clean working set - Expected: []sql.Row{{0}}, + Expected: []sql.UntypedSqlRow{{0}}, }, { Query: "/* client a */ select * from users order by id", - Expected: []sql.Row{{1, "tim2"}, {2, "jim2"}}, + Expected: []sql.UntypedSqlRow{{1, "tim2"}, {2, "jim2"}}, }, { Query: "/* client b */ select * from users order by id", - Expected: []sql.Row{{1, "tim2"}, {2, "jim2"}}, + Expected: []sql.UntypedSqlRow{{1, "tim2"}, {2, "jim2"}}, }, }, }, @@ -1604,31 +1604,31 @@ var DoltStoredProcedureTransactionTests = []queries.TransactionTest{ { // dirty working set: client a's changes were not committed to head Query: "/* client a */ select * from dolt_status", - Expected: []sql.Row{{"users", false, "modified"}}, + Expected: []sql.UntypedSqlRow{{"users", false, "modified"}}, }, { // dirty working set: client a's changes were not committed to head, but are visible to client b Query: "/* client b */ select * from dolt_status", - Expected: []sql.Row{{"users", false, "modified"}}, + Expected: []sql.UntypedSqlRow{{"users", false, "modified"}}, }, { Query: "/* client a */ select * from users order by id", - Expected: []sql.Row{{1, "tim2"}, {2, "jim2"}}, + Expected: []sql.UntypedSqlRow{{1, "tim2"}, {2, "jim2"}}, }, { Query: "/* client b */ select * from users order by id", - Expected: []sql.Row{{1, "tim2"}, {2, "jim2"}}, + Expected: []sql.UntypedSqlRow{{1, "tim2"}, {2, "jim2"}}, }, { // changes from client a are in the working set, but not in HEAD Query: "/* client a */ select from_id, to_id, from_name, to_name from dolt_diff('HEAD', 'WORKING', 'users') order by from_id, to_id", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {1, 1, "tim", "tim2"}, }, }, { Query: "/* client b */ select from_id, to_id, from_name, to_name from dolt_diff('HEAD', 'WORKING', 'users') order by from_id, to_id", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {1, 1, "tim", "tim2"}, }, }, @@ -1676,30 +1676,30 @@ var DoltStoredProcedureTransactionTests = []queries.TransactionTest{ }, { Query: "/* client a */ select * from users order by id", - Expected: []sql.Row{{1, "tim2"}, {2, "jim2"}}, + Expected: []sql.UntypedSqlRow{{1, "tim2"}, {2, "jim2"}}, }, { Query: "/* client b */ select * from users order by id", - Expected: []sql.Row{{1, "tim2"}, {2, "jim2"}}, + Expected: []sql.UntypedSqlRow{{1, "tim2"}, {2, "jim2"}}, }, { // dirty working set: modifications are staged Query: "/* client a */ select * from dolt_status", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {"users", true, "modified"}, }, }, { // dirty working set: modifications are staged Query: "/* client b */ select * from dolt_status", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {"users", true, "modified"}, }, }, { // staged changes include changes from both A and B Query: "/* client a */ select from_id, to_id, from_name, to_name from dolt_diff('HEAD', 'STAGED', 'users') order by from_id, to_id", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {1, 1, "tim", "tim2"}, {2, 2, "jim", "jim2"}, }, @@ -1707,7 +1707,7 @@ var DoltStoredProcedureTransactionTests = []queries.TransactionTest{ { // staged changes include changes from both A and B Query: "/* client a */ select from_id, to_id, from_name, to_name from dolt_diff('HEAD', 'STAGED', 'users') order by from_id, to_id", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {1, 1, "tim", "tim2"}, {2, 2, "jim", "jim2"}, }, @@ -1764,16 +1764,16 @@ var DoltStoredProcedureTransactionTests = []queries.TransactionTest{ }, { Query: "/* client a */ select * from users order by id", - Expected: []sql.Row{{1, "tim3"}, {2, "jim3"}}, + Expected: []sql.UntypedSqlRow{{1, "tim3"}, {2, "jim3"}}, }, { Query: "/* client b */ select * from users order by id", - Expected: []sql.Row{{1, "tim3"}, {2, "jim3"}}, + Expected: []sql.UntypedSqlRow{{1, "tim3"}, {2, "jim3"}}, }, { // dirty working set: modifications are staged and unstaged Query: "/* client a */ select * from dolt_status", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {"users", true, "modified"}, {"users", false, "modified"}, }, @@ -1781,7 +1781,7 @@ var DoltStoredProcedureTransactionTests = []queries.TransactionTest{ { // dirty working set: modifications are staged and unstaged Query: "/* client b */ select * from dolt_status", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {"users", true, "modified"}, {"users", false, "modified"}, }, @@ -1789,7 +1789,7 @@ var DoltStoredProcedureTransactionTests = []queries.TransactionTest{ { // staged changes include changes from both A and B at staged revision of data Query: "/* client a */ select from_id, to_id, from_name, to_name from dolt_diff('HEAD', 'STAGED', 'users') order by from_id, to_id", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {1, 1, "tim", "tim2"}, {2, 2, "jim", "jim2"}, }, @@ -1797,7 +1797,7 @@ var DoltStoredProcedureTransactionTests = []queries.TransactionTest{ { // staged changes include changes from both A and B at staged revision of data Query: "/* client a */ select from_id, to_id, from_name, to_name from dolt_diff('HEAD', 'STAGED', 'users') order by from_id, to_id", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {1, 1, "tim", "tim2"}, {2, 2, "jim", "jim2"}, }, @@ -1805,7 +1805,7 @@ var DoltStoredProcedureTransactionTests = []queries.TransactionTest{ { // working changes include changes from both A and B at working revision of data Query: "/* client a */ select from_id, to_id, from_name, to_name from dolt_diff('HEAD', 'WORKING', 'users') order by from_id, to_id", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {1, 1, "tim", "tim3"}, {2, 2, "jim", "jim3"}, }, @@ -1813,21 +1813,21 @@ var DoltStoredProcedureTransactionTests = []queries.TransactionTest{ { // working changes include changes from both A and B at working revision of data Query: "/* client a */ select from_id, to_id, from_name, to_name from dolt_diff('HEAD', 'WORKING', 'users') order by from_id, to_id", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {1, 1, "tim", "tim3"}, {2, 2, "jim", "jim3"}, }, }, { Query: "/* client a */ select from_id, to_id, from_name, to_name from dolt_diff('STAGED', 'WORKING', 'users') order by from_id, to_id", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {1, 1, "tim2", "tim3"}, {2, 2, "jim2", "jim3"}, }, }, { Query: "/* client a */ select from_id, to_id, from_name, to_name from dolt_diff('STAGED', 'WORKING', 'users') order by from_id, to_id", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {1, 1, "tim2", "tim3"}, {2, 2, "jim2", "jim3"}, }, @@ -1872,7 +1872,7 @@ var DoltStoredProcedureTransactionTests = []queries.TransactionTest{ }, { Query: "/* client b */ select * from users order by id", - Expected: []sql.Row{{1, "tim"}, {2, "jim2"}}, + Expected: []sql.UntypedSqlRow{{1, "tim"}, {2, "jim2"}}, }, { Query: "/* client b */ call dolt_commit('-m', 'jim2 commit')", @@ -1880,24 +1880,24 @@ var DoltStoredProcedureTransactionTests = []queries.TransactionTest{ }, { Query: "/* client b */ select * from users order by id", - Expected: []sql.Row{{1, "tim2"}, {2, "jim2"}}, + Expected: []sql.UntypedSqlRow{{1, "tim2"}, {2, "jim2"}}, }, { Query: "/* client b */ select * from users as of 'HEAD' order by id", - Expected: []sql.Row{{1, "tim2"}, {2, "jim2"}}, + Expected: []sql.UntypedSqlRow{{1, "tim2"}, {2, "jim2"}}, }, { Query: "/* client b */ select * from dolt_status", - Expected: []sql.Row{}, + Expected: []sql.UntypedSqlRow{}, }, { Query: "/* client b */ select from_id, to_id, from_name, to_name from dolt_diff('HEAD', 'STAGED', 'users') order by from_id, to_id", - Expected: []sql.Row{}, + Expected: []sql.UntypedSqlRow{}, }, { // staged changes include changes from both A and B at staged revision of data Query: "/* client b */ select from_id, to_id, from_name, to_name from dolt_diff('HEAD', 'WORKING', 'users') order by from_id, to_id", - Expected: []sql.Row{}, + Expected: []sql.UntypedSqlRow{}, }, }, }, @@ -1912,11 +1912,11 @@ var DoltStoredProcedureTransactionTests = []queries.TransactionTest{ Assertions: []queries.ScriptTestAssertion{ { Query: "/* client a */ set autocommit = off", - Expected: []sql.Row{{}}, + Expected: []sql.UntypedSqlRow{{}}, }, { Query: "/* client a */ call dolt_add('t1')", - Expected: []sql.Row{{0}}, + Expected: []sql.UntypedSqlRow{{0}}, }, { Query: "/* client a */ call dolt_commit('-m', 'initial commit of t1')", @@ -1924,51 +1924,51 @@ var DoltStoredProcedureTransactionTests = []queries.TransactionTest{ }, { Query: "/* client b */ set autocommit = off", - Expected: []sql.Row{{}}, + Expected: []sql.UntypedSqlRow{{}}, }, { Query: "/* client a */ start transaction", - Expected: []sql.Row{}, + Expected: []sql.UntypedSqlRow{}, }, { Query: "/* client b */ start transaction", - Expected: []sql.Row{}, + Expected: []sql.UntypedSqlRow{}, }, { Query: "/* client a */ insert into t1 values (3, 3)", - Expected: []sql.Row{{types.NewOkResult(1)}}, + Expected: []sql.UntypedSqlRow{{types.NewOkResult(1)}}, }, { Query: "/* client b */ insert into t1 values (4, 4)", - Expected: []sql.Row{{types.NewOkResult(1)}}, + Expected: []sql.UntypedSqlRow{{types.NewOkResult(1)}}, }, { Query: "/* client a */ insert into t2 values (3, 3)", - Expected: []sql.Row{{types.NewOkResult(1)}}, + Expected: []sql.UntypedSqlRow{{types.NewOkResult(1)}}, }, { Query: "/* client b */ insert into t2 values (4, 4)", - Expected: []sql.Row{{types.NewOkResult(1)}}, + Expected: []sql.UntypedSqlRow{{types.NewOkResult(1)}}, }, { Query: "/* client a */ call dolt_add('t1')", - Expected: []sql.Row{{0}}, + Expected: []sql.UntypedSqlRow{{0}}, }, { Query: "/* client b */ call dolt_add('t1')", - Expected: []sql.Row{{0}}, + Expected: []sql.UntypedSqlRow{{0}}, }, { Query: "/* client a */ insert into t1 values (5, 5)", - Expected: []sql.Row{{types.NewOkResult(1)}}, + Expected: []sql.UntypedSqlRow{{types.NewOkResult(1)}}, }, { Query: "/* client b */ insert into t1 values (6, 6)", - Expected: []sql.Row{{types.NewOkResult(1)}}, + Expected: []sql.UntypedSqlRow{{types.NewOkResult(1)}}, }, { Query: "/* client c */ insert into t2 values (6, 6)", - Expected: []sql.Row{{types.NewOkResult(1)}}, + Expected: []sql.UntypedSqlRow{{types.NewOkResult(1)}}, }, { Query: "/* client a */ call dolt_commit('-m', 'add 3 to t1')", @@ -1976,15 +1976,15 @@ var DoltStoredProcedureTransactionTests = []queries.TransactionTest{ }, { Query: "/* client a */ select * from t2 order by id asc", - Expected: []sql.Row{{1, 1}, {2, 2}, {3, 3}, {6, 6}}, + Expected: []sql.UntypedSqlRow{{1, 1}, {2, 2}, {3, 3}, {6, 6}}, }, { Query: "/* client a */ select * from t1 order by id asc", - Expected: []sql.Row{{1, 1}, {2, 2}, {3, 3}, {5, 5}}, + Expected: []sql.UntypedSqlRow{{1, 1}, {2, 2}, {3, 3}, {5, 5}}, }, { Query: "/* client a */ select * from t1 as of 'HEAD' order by id asc", - Expected: []sql.Row{{1, 1}, {2, 2}, {3, 3}}, + Expected: []sql.UntypedSqlRow{{1, 1}, {2, 2}, {3, 3}}, }, { Query: "/* client b */ call dolt_commit('-m', 'add 4 to t1')", @@ -1992,20 +1992,20 @@ var DoltStoredProcedureTransactionTests = []queries.TransactionTest{ }, { Query: "/* client b */ select * from t2 order by id asc", - Expected: []sql.Row{{1, 1}, {2, 2}, {3, 3}, {4, 4}, {6, 6}}, + Expected: []sql.UntypedSqlRow{{1, 1}, {2, 2}, {3, 3}, {4, 4}, {6, 6}}, }, { Query: "/* client b */ select * from t1 order by id asc", - Expected: []sql.Row{{1, 1}, {2, 2}, {3, 3}, {4, 4}, {5, 5}, {6, 6}}, + Expected: []sql.UntypedSqlRow{{1, 1}, {2, 2}, {3, 3}, {4, 4}, {5, 5}, {6, 6}}, }, { Query: "/* client b */ select * from t1 as of 'HEAD' order by id asc", - Expected: []sql.Row{{1, 1}, {2, 2}, {3, 3}, {4, 4}}, + Expected: []sql.UntypedSqlRow{{1, 1}, {2, 2}, {3, 3}, {4, 4}}, }, { // working set has t2 new, t1 modified, nothing staged Query: "/* client a */ select * from dolt_status", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {"t2", false, "new table"}, {"t1", false, "modified"}, }, @@ -2013,7 +2013,7 @@ var DoltStoredProcedureTransactionTests = []queries.TransactionTest{ { // working set has t2 new, t1 modified, nothing staged Query: "/* client b */ select * from dolt_status", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {"t2", false, "new table"}, {"t1", false, "modified"}, }, @@ -2021,14 +2021,14 @@ var DoltStoredProcedureTransactionTests = []queries.TransactionTest{ { // client a has a stale view of t1 from before the commit, so it's missing the row with 4 in its session's working set Query: "/* client a */ select from_id, to_id, from_val, to_val from dolt_diff('HEAD', 'WORKING', 't1') order by from_id", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {nil, 5, nil, 5}, {4, nil, 4, nil}, }, }, { Query: "/* client b */ select from_id, to_id, from_val, to_val from dolt_diff('HEAD', 'WORKING', 't1') order by from_id", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {nil, 5, nil, 5}, {nil, 6, nil, 6}, }, @@ -2048,31 +2048,31 @@ var DoltConstraintViolationTransactionTests = []queries.TransactionTest{ Assertions: []queries.ScriptTestAssertion{ { Query: "/* client a */ SET @@autocommit=0;", - Expected: []sql.Row{{}}, + Expected: []sql.UntypedSqlRow{{}}, }, { Query: "/* client b */ SET @@autocommit=0;", - Expected: []sql.Row{{}}, + Expected: []sql.UntypedSqlRow{{}}, }, { Query: "/* client a */ START TRANSACTION;", - Expected: []sql.Row{}, + Expected: []sql.UntypedSqlRow{}, }, { Query: "/* client b */ START TRANSACTION;", - Expected: []sql.Row{}, + Expected: []sql.UntypedSqlRow{}, }, { Query: "/* client a */ DELETE FROM parent where pk = 1;", - Expected: []sql.Row{{types.NewOkResult(1)}}, + Expected: []sql.UntypedSqlRow{{types.NewOkResult(1)}}, }, { Query: "/* client b */ INSERT INTO child VALUES (1, 1);", - Expected: []sql.Row{{types.NewOkResult(1)}}, + Expected: []sql.UntypedSqlRow{{types.NewOkResult(1)}}, }, { Query: "/* client a */ COMMIT;", - Expected: []sql.Row{}, + Expected: []sql.UntypedSqlRow{}, }, { Query: "/* client b */ COMMIT;", @@ -2123,7 +2123,7 @@ var DoltConstraintViolationTransactionTests = []queries.TransactionTest{ }, { Query: "/* client a */ SELECT * from DOLT_CONSTRAINT_VIOLATIONS;", - Expected: []sql.Row{}, + Expected: []sql.UntypedSqlRow{}, }, { Query: "/* client a */ CALL DOLT_MERGE('--abort');", @@ -2145,19 +2145,19 @@ var DoltConstraintViolationTransactionTests = []queries.TransactionTest{ Assertions: []queries.ScriptTestAssertion{ { Query: "/* client a */ SET FOREIGN_KEY_CHECKS = 0;", - Expected: []sql.Row{{}}, + Expected: []sql.UntypedSqlRow{{}}, }, { Query: "/* client a */ START TRANSACTION;", - Expected: []sql.Row{}, + Expected: []sql.UntypedSqlRow{}, }, { Query: "/* client a */ DELETE FROM PARENT where v1 = 2;", - Expected: []sql.Row{{types.NewOkResult(1)}}, + Expected: []sql.UntypedSqlRow{{types.NewOkResult(1)}}, }, { Query: "/* client a */ COMMIT;", - Expected: []sql.Row{}, + Expected: []sql.UntypedSqlRow{}, }, }, }, @@ -2175,27 +2175,27 @@ var DoltConstraintViolationTransactionTests = []queries.TransactionTest{ Assertions: []queries.ScriptTestAssertion{ { Query: "/* client a */ SET FOREIGN_KEY_CHECKS = 0;", - Expected: []sql.Row{{}}, + Expected: []sql.UntypedSqlRow{{}}, }, { Query: "/* client a */ START TRANSACTION;", - Expected: []sql.Row{}, + Expected: []sql.UntypedSqlRow{}, }, { Query: "/* client b */ START TRANSACTION;", - Expected: []sql.Row{}, + Expected: []sql.UntypedSqlRow{}, }, { Query: "/* client a */ DELETE FROM PARENT where v1 = 2;", - Expected: []sql.Row{{types.NewOkResult(1)}}, + Expected: []sql.UntypedSqlRow{{types.NewOkResult(1)}}, }, { Query: "/* client b */ INSERT INTO parent VALUES (30, 3);", - Expected: []sql.Row{{types.NewOkResult(1)}}, + Expected: []sql.UntypedSqlRow{{types.NewOkResult(1)}}, }, { Query: "/* client a */ COMMIT;", - Expected: []sql.Row{}, + Expected: []sql.UntypedSqlRow{}, }, { Query: "/* client b */ COMMIT;", @@ -2219,39 +2219,39 @@ var DoltConstraintViolationTransactionTests = []queries.TransactionTest{ // Assertions: []queries.ScriptTestAssertion{ // { // Query: "/* client a */ SELECT count(*) FROM t;", - // Expected: []sql.Row{{250}}, + // Expected: []sql.UntypedSqlRow{{250}}, // }, // { // Query: "/* client a */ START TRANSACTION", - // Expected: []sql.Row{}, + // Expected: []sql.UntypedSqlRow{}, // }, // { // Query: "/* client b */ START TRANSACTION", - // Expected: []sql.Row{}, + // Expected: []sql.UntypedSqlRow{}, // }, // { // Query: "/* client a */ CALL DOLT_GC();", - // Expected: []sql.Row{{1}}, + // Expected: []sql.UntypedSqlRow{{1}}, // }, // { // Query: "/* client b */ INSERT into t VALUES (300);", - // Expected: []sql.Row{{types.NewOkResult(1)}}, + // Expected: []sql.UntypedSqlRow{{types.NewOkResult(1)}}, // }, // { // Query: "/* client a */ COMMIT;", - // Expected: []sql.Row{}, + // Expected: []sql.UntypedSqlRow{}, // }, // { // Query: "/* client b */ COMMIT;", - // Expected: []sql.Row{}, + // Expected: []sql.UntypedSqlRow{}, // }, // { // Query: "/* client a */ SELECT count(*) FROM t;", - // Expected: []sql.Row{{251}}, + // Expected: []sql.UntypedSqlRow{{251}}, // }, // { // Query: "/* client b */ SELECT count(*) FROM t;", - // Expected: []sql.Row{{251}}, + // Expected: []sql.UntypedSqlRow{{251}}, // }, // }, // }, @@ -2291,15 +2291,15 @@ var BranchIsolationTests = []queries.TransactionTest{ }, { Query: "/* client a */ select * from t1 order by a", - Expected: []sql.Row{{1}}, + Expected: []sql.UntypedSqlRow{{1}}, }, { Query: "/* client a */ select * from t1 as of 'b1' order by a", - Expected: []sql.Row{{1}}, + Expected: []sql.UntypedSqlRow{{1}}, }, { Query: "/* client a */ select * from `mydb/b1`.t1 order by a", - Expected: []sql.Row{{1}}, + Expected: []sql.UntypedSqlRow{{1}}, }, { Query: "/* client a */ start transaction", @@ -2307,17 +2307,17 @@ var BranchIsolationTests = []queries.TransactionTest{ }, { Query: "/* client a */ select * from t1 order by a", - Expected: []sql.Row{{1}}, + Expected: []sql.UntypedSqlRow{{1}}, }, { // This query specifies the branch HEAD commit, which hasn't changed Query: "/* client a */ select * from t1 as of 'b1' order by a", - Expected: []sql.Row{{1}}, + Expected: []sql.UntypedSqlRow{{1}}, }, { // This query specifies the working set of that branch, which has changed Query: "/* client a */ select * from `mydb/b1`.t1 order by a", - Expected: []sql.Row{{1}, {2}}, + Expected: []sql.UntypedSqlRow{{1}, {2}}, }, }, }, @@ -2354,15 +2354,15 @@ var BranchIsolationTests = []queries.TransactionTest{ }, { Query: "/* client a */ select * from t1 order by a", - Expected: []sql.Row{{1}}, + Expected: []sql.UntypedSqlRow{{1}}, }, { Query: "/* client a */ select * from t1 as of 'b1' order by a", - Expected: []sql.Row{{1}}, + Expected: []sql.UntypedSqlRow{{1}}, }, { Query: "/* client a */ select * from `mydb/b1`.t1 order by a", - Expected: []sql.Row{{1}}, + Expected: []sql.UntypedSqlRow{{1}}, }, { Query: "/* client a */ start transaction", @@ -2370,15 +2370,15 @@ var BranchIsolationTests = []queries.TransactionTest{ }, { Query: "/* client a */ select * from t1 order by a", - Expected: []sql.Row{{1}}, + Expected: []sql.UntypedSqlRow{{1}}, }, { Query: "/* client a */ select * from t1 as of 'b1' order by a", - Expected: []sql.Row{{1}, {2}}, + Expected: []sql.UntypedSqlRow{{1}, {2}}, }, { Query: "/* client a */ select * from `mydb/b1`.t1 order by a", - Expected: []sql.Row{{1}, {2}}, + Expected: []sql.UntypedSqlRow{{1}, {2}}, }, }, }, @@ -2407,7 +2407,7 @@ var BranchIsolationTests = []queries.TransactionTest{ }, { Query: "/* client b */ select name from dolt_branches order by 1", - Expected: []sql.Row{{"b2"}, {"main"}}, + Expected: []sql.UntypedSqlRow{{"b2"}, {"main"}}, }, { Query: "/* client b */ commit", @@ -2415,7 +2415,7 @@ var BranchIsolationTests = []queries.TransactionTest{ }, { Query: "/* client a */ select name from dolt_branches order by 1", - Expected: []sql.Row{{"b1"}, {"main"}}, + Expected: []sql.UntypedSqlRow{{"b1"}, {"main"}}, }, { Query: "/* client a */ start transaction", @@ -2423,7 +2423,7 @@ var BranchIsolationTests = []queries.TransactionTest{ }, { Query: "/* client a */ select name from dolt_branches order by 1", - Expected: []sql.Row{{"b2"}, {"main"}}, + Expected: []sql.UntypedSqlRow{{"b2"}, {"main"}}, }, }, }, @@ -2442,33 +2442,33 @@ var MultiDbTransactionTests = []queries.ScriptTest{ Assertions: []queries.ScriptTestAssertion{ { Query: "insert into `mydb/b1`.t1 values (1)", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {types.OkResult{RowsAffected: 1}}, }, }, { Query: "insert into `mydb/b1`.t1 values (2)", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {types.OkResult{RowsAffected: 1}}, }, }, { Query: "select * from t1 order by a", - Expected: []sql.Row{}, + Expected: []sql.UntypedSqlRow{}, }, { Query: "select * from `mydb/b1`.t1 order by a", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {1}, {2}, }, }, { Query: "commit", - Expected: []sql.Row{}, + Expected: []sql.UntypedSqlRow{}, }, { Query: "select * from t1 order by a", - Expected: []sql.Row{}, + Expected: []sql.UntypedSqlRow{}, }, { Query: "call dolt_checkout('b1')", @@ -2476,7 +2476,7 @@ var MultiDbTransactionTests = []queries.ScriptTest{ }, { Query: "select * from t1 order by a", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {1}, {2}, }, }, @@ -2494,13 +2494,13 @@ var MultiDbTransactionTests = []queries.ScriptTest{ Assertions: []queries.ScriptTestAssertion{ { Query: "insert into `mydb/b1`.t1 values (1)", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {types.OkResult{RowsAffected: 1}}, }, }, { Query: "select * from t1 order by a", - Expected: []sql.Row{}, + Expected: []sql.UntypedSqlRow{}, }, { Query: "call dolt_checkout('b1')", @@ -2508,7 +2508,7 @@ var MultiDbTransactionTests = []queries.ScriptTest{ }, { Query: "select * from t1 order by a", - Expected: []sql.Row{{1}}, + Expected: []sql.UntypedSqlRow{{1}}, }, }, }, @@ -2525,23 +2525,23 @@ var MultiDbTransactionTests = []queries.ScriptTest{ Assertions: []queries.ScriptTestAssertion{ { Query: "insert into `mydb/b1`.t1 values (1)", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {types.OkResult{RowsAffected: 1}}, }, }, { Query: "insert into `mydb/b1`.t1 values (2)", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {types.OkResult{RowsAffected: 1}}, }, }, { Query: "select * from t1 order by a", - Expected: []sql.Row{}, + Expected: []sql.UntypedSqlRow{}, }, { Query: "select * from `mydb/b1`.t1 order by a", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {1}, {2}, }, }, @@ -2551,29 +2551,29 @@ var MultiDbTransactionTests = []queries.ScriptTest{ }, { Query: "select * from `mydb/main`.t1 order by a", - Expected: []sql.Row{}, + Expected: []sql.UntypedSqlRow{}, }, { Query: "use mydb/b1", - Expected: []sql.Row{}, + Expected: []sql.UntypedSqlRow{}, }, { Query: "commit", - Expected: []sql.Row{}, + Expected: []sql.UntypedSqlRow{}, }, { Query: "select * from `mydb/b1`.t1 order by a", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {1}, {2}, }, }, { Query: "select * from `mydb/main`.t1 order by a", - Expected: []sql.Row{}, + Expected: []sql.UntypedSqlRow{}, }, { Query: "select * from t1 order by a", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {1}, {2}, }, }, @@ -2591,13 +2591,13 @@ var MultiDbTransactionTests = []queries.ScriptTest{ Assertions: []queries.ScriptTestAssertion{ { Query: "insert into `mydb/b1`.t1 values (1)", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {types.OkResult{RowsAffected: 1}}, }, }, { Query: "select * from t1 order by a", - Expected: []sql.Row{}, + Expected: []sql.UntypedSqlRow{}, }, { Query: "call dolt_commit('-am', 'changes on b1')", @@ -2605,7 +2605,7 @@ var MultiDbTransactionTests = []queries.ScriptTest{ }, { Query: "use mydb/b1", - Expected: []sql.Row{}, + Expected: []sql.UntypedSqlRow{}, }, { Query: "call dolt_commit('-am', 'other changes on b1')", @@ -2613,11 +2613,11 @@ var MultiDbTransactionTests = []queries.ScriptTest{ }, { Query: "select * from t1 order by a", - Expected: []sql.Row{{1}}, + Expected: []sql.UntypedSqlRow{{1}}, }, { Query: "select message from dolt_log order by date desc limit 1", - Expected: []sql.Row{{"other changes on b1"}}, + Expected: []sql.UntypedSqlRow{{"other changes on b1"}}, }, }, }, @@ -2638,21 +2638,21 @@ var MultiDbTransactionTests = []queries.ScriptTest{ }, { Query: "use mydb/b1", - Expected: []sql.Row{}, + Expected: []sql.UntypedSqlRow{}, }, { Query: "select * from t1 order by a", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {1}, }, }, { Query: "commit", - Expected: []sql.Row{}, + Expected: []sql.UntypedSqlRow{}, }, { Query: "select * from t1 order by a", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {1}, }, }, @@ -2670,19 +2670,19 @@ var MultiDbTransactionTests = []queries.ScriptTest{ Assertions: []queries.ScriptTestAssertion{ { Query: "insert into `mydb/b1`.t1 values (1)", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {types.OkResult{RowsAffected: 1}}, }, }, { Query: "insert into `mydb/b1`.t1 values (2)", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {types.OkResult{RowsAffected: 1}}, }, }, { Query: "select * from t1 order by a", - Expected: []sql.Row{}, + Expected: []sql.UntypedSqlRow{}, }, { Query: "call dolt_checkout('b1')", @@ -2690,11 +2690,11 @@ var MultiDbTransactionTests = []queries.ScriptTest{ }, { Query: "select active_branch()", - Expected: []sql.Row{{"b1"}}, + Expected: []sql.UntypedSqlRow{{"b1"}}, }, { Query: "select * from t1 order by a", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {1}, {2}, }, }, @@ -2704,39 +2704,39 @@ var MultiDbTransactionTests = []queries.ScriptTest{ }, { Query: "select active_branch()", - Expected: []sql.Row{{"main"}}, + Expected: []sql.UntypedSqlRow{{"main"}}, }, { Query: "select * from t1 order by a", - Expected: []sql.Row{}, + Expected: []sql.UntypedSqlRow{}, }, { Query: "use `mydb/b1`", - Expected: []sql.Row{}, + Expected: []sql.UntypedSqlRow{}, }, { Query: "select active_branch()", - Expected: []sql.Row{{"b1"}}, + Expected: []sql.UntypedSqlRow{{"b1"}}, }, { Query: "select * from t1 order by a", - Expected: []sql.Row{{1}, {2}}, + Expected: []sql.UntypedSqlRow{{1}, {2}}, }, { Query: "use mydb", - Expected: []sql.Row{}, + Expected: []sql.UntypedSqlRow{}, }, { Query: "select active_branch()", - Expected: []sql.Row{{"main"}}, + Expected: []sql.UntypedSqlRow{{"main"}}, }, { Query: "commit", - Expected: []sql.Row{}, + Expected: []sql.UntypedSqlRow{}, }, { Query: "select * from t1 order by a", - Expected: []sql.Row{}, + Expected: []sql.UntypedSqlRow{}, }, { Query: "call dolt_checkout('b1')", @@ -2744,7 +2744,7 @@ var MultiDbTransactionTests = []queries.ScriptTest{ }, { Query: "select * from t1 order by a", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {1}, {2}, }, }, @@ -2765,35 +2765,35 @@ var MultiDbTransactionTests = []queries.ScriptTest{ Assertions: []queries.ScriptTestAssertion{ { Query: "insert into db1.t1 values (1)", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {types.OkResult{RowsAffected: 1}}, }, }, { Query: "insert into db1.t1 values (2)", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {types.OkResult{RowsAffected: 1}}, }, }, { Query: "select * from t1 order by a", - Expected: []sql.Row{}, + Expected: []sql.UntypedSqlRow{}, }, { Query: "select * from db1.t1 order by a", - Expected: []sql.Row{{1}, {2}}, + Expected: []sql.UntypedSqlRow{{1}, {2}}, }, { Query: "commit", - Expected: []sql.Row{}, + Expected: []sql.UntypedSqlRow{}, }, { Query: "select * from t1 order by a", - Expected: []sql.Row{}, + Expected: []sql.UntypedSqlRow{}, }, { Query: "select * from db1.t1 order by a", - Expected: []sql.Row{{1}, {2}}, + Expected: []sql.UntypedSqlRow{{1}, {2}}, }, }, }, @@ -2816,7 +2816,7 @@ var MultiDbTransactionTests = []queries.ScriptTest{ Assertions: []queries.ScriptTestAssertion{ { Query: "insert into `db1/b1`.t1 values (1)", - Expected: []sql.Row{{types.OkResult{RowsAffected: 1}}}, + Expected: []sql.UntypedSqlRow{{types.OkResult{RowsAffected: 1}}}, }, { Query: "call dolt_commit('-am', 'changes on b1')", @@ -2824,7 +2824,7 @@ var MultiDbTransactionTests = []queries.ScriptTest{ }, { Query: "use db1/b1", - Expected: []sql.Row{}, + Expected: []sql.UntypedSqlRow{}, }, { Query: "call dolt_commit('-am', 'other changes on b1')", @@ -2832,11 +2832,11 @@ var MultiDbTransactionTests = []queries.ScriptTest{ }, { Query: "select * from t1 order by a", - Expected: []sql.Row{{1}}, + Expected: []sql.UntypedSqlRow{{1}}, }, { Query: "select message from dolt_log order by date desc limit 1", - Expected: []sql.Row{{"other changes on b1"}}, + Expected: []sql.UntypedSqlRow{{"other changes on b1"}}, }, }, }, @@ -2858,43 +2858,43 @@ var MultiDbTransactionTests = []queries.ScriptTest{ Assertions: []queries.ScriptTestAssertion{ { Query: "insert into `db1/b1`.t1 values (1)", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {types.OkResult{RowsAffected: 1}}, }, }, { Query: "insert into `db1/b1`.t1 values (2)", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {types.OkResult{RowsAffected: 1}}, }, }, { Query: "select * from t1 order by a", - Expected: []sql.Row{}, + Expected: []sql.UntypedSqlRow{}, }, { Query: "select * from db1.t1 order by a", - Expected: []sql.Row{}, + Expected: []sql.UntypedSqlRow{}, }, { Query: "select * from `db1/b1`.t1 order by a", - Expected: []sql.Row{{1}, {2}}, + Expected: []sql.UntypedSqlRow{{1}, {2}}, }, { Query: "commit", - Expected: []sql.Row{}, + Expected: []sql.UntypedSqlRow{}, }, { Query: "select * from t1 order by a", - Expected: []sql.Row{}, + Expected: []sql.UntypedSqlRow{}, }, { Query: "select * from db1.t1 order by a", - Expected: []sql.Row{}, + Expected: []sql.UntypedSqlRow{}, }, { Query: "select * from `db1/b1`.t1 order by a", - Expected: []sql.Row{{1}, {2}}, + Expected: []sql.UntypedSqlRow{{1}, {2}}, }, }, }, @@ -2943,7 +2943,7 @@ var MultiDbTransactionTests = []queries.ScriptTest{ Assertions: []queries.ScriptTestAssertion{ { Query: "insert into `db1/b1`.t1 values (1)", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {types.OkResult{RowsAffected: 1}}, }, }, @@ -2965,13 +2965,13 @@ var MultiDbTransactionTests = []queries.ScriptTest{ Assertions: []queries.ScriptTestAssertion{ { Query: "insert into t1 values (1)", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {types.OkResult{RowsAffected: 1}}, }, }, { Query: "insert into `mydb/b1`.t1 values (2)", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {types.OkResult{RowsAffected: 1}}, }, }, @@ -2993,7 +2993,7 @@ var MultiDbTransactionTests = []queries.ScriptTest{ Assertions: []queries.ScriptTestAssertion{ { Query: "insert into t1 values (1)", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {types.OkResult{RowsAffected: 1}}, }, }, @@ -3003,7 +3003,7 @@ var MultiDbTransactionTests = []queries.ScriptTest{ }, { Query: "insert into t1 values (2)", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {types.OkResult{RowsAffected: 1}}, }, }, @@ -3026,13 +3026,13 @@ var MultiDbTransactionTests = []queries.ScriptTest{ Assertions: []queries.ScriptTestAssertion{ { Query: "insert into t1 values (1)", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {types.OkResult{RowsAffected: 1}}, }, }, { Query: "insert into db2.t1 values (2)", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {types.OkResult{RowsAffected: 1}}, }, }, @@ -3058,171 +3058,171 @@ var MultiDbSavepointTests = []queries.TransactionTest{ Assertions: []queries.ScriptTestAssertion{ { Query: "/* client a */ set autocommit = off", - Expected: []sql.Row{{}}, + Expected: []sql.UntypedSqlRow{{}}, }, { Query: "/* client b */ set autocommit = off", - Expected: []sql.Row{{}}, + Expected: []sql.UntypedSqlRow{{}}, }, { Query: "/* client a */ start transaction", - Expected: []sql.Row{}, + Expected: []sql.UntypedSqlRow{}, }, { Query: "/* client b */ start transaction", - Expected: []sql.Row{}, + Expected: []sql.UntypedSqlRow{}, }, { Query: "/* client a */ insert into db1.t values (3, 3)", - Expected: []sql.Row{{types.NewOkResult(1)}}, + Expected: []sql.UntypedSqlRow{{types.NewOkResult(1)}}, }, { Query: "/* client a */ insert into db2.t values (4, 4)", - Expected: []sql.Row{{types.NewOkResult(1)}}, + Expected: []sql.UntypedSqlRow{{types.NewOkResult(1)}}, }, { Query: "/* client b */ insert into db1.t values (5, 5)", - Expected: []sql.Row{{types.NewOkResult(1)}}, + Expected: []sql.UntypedSqlRow{{types.NewOkResult(1)}}, }, { Query: "/* client b */ insert into db2.t values (6, 6)", - Expected: []sql.Row{{types.NewOkResult(1)}}, + Expected: []sql.UntypedSqlRow{{types.NewOkResult(1)}}, }, { Query: "/* client a */ savepoint spa1", - Expected: []sql.Row{}, + Expected: []sql.UntypedSqlRow{}, }, { Query: "/* client b */ savepoint spb1", - Expected: []sql.Row{}, + Expected: []sql.UntypedSqlRow{}, }, { Query: "/* client a */ insert into db1.t values (5, 5)", - Expected: []sql.Row{{types.NewOkResult(1)}}, + Expected: []sql.UntypedSqlRow{{types.NewOkResult(1)}}, }, { Query: "/* client a */ insert into db2.t values (6, 6)", - Expected: []sql.Row{{types.NewOkResult(1)}}, + Expected: []sql.UntypedSqlRow{{types.NewOkResult(1)}}, }, { Query: "/* client b */ insert into db1.t values (7, 7)", - Expected: []sql.Row{{types.NewOkResult(1)}}, + Expected: []sql.UntypedSqlRow{{types.NewOkResult(1)}}, }, { Query: "/* client b */ insert into db2.t values (8, 8)", - Expected: []sql.Row{{types.NewOkResult(1)}}, + Expected: []sql.UntypedSqlRow{{types.NewOkResult(1)}}, }, { Query: "/* client a */ savepoint spa2", - Expected: []sql.Row{}, + Expected: []sql.UntypedSqlRow{}, }, { Query: "/* client b */ savepoint spb2", - Expected: []sql.Row{}, + Expected: []sql.UntypedSqlRow{}, }, { Query: "/* client a */ insert into db1.t values (7, 7)", - Expected: []sql.Row{{types.NewOkResult(1)}}, + Expected: []sql.UntypedSqlRow{{types.NewOkResult(1)}}, }, { Query: "/* client a */ insert into db2.t values (8, 8)", - Expected: []sql.Row{{types.NewOkResult(1)}}, + Expected: []sql.UntypedSqlRow{{types.NewOkResult(1)}}, }, { Query: "/* client b */ insert into db1.t values (9, 9)", - Expected: []sql.Row{{types.NewOkResult(1)}}, + Expected: []sql.UntypedSqlRow{{types.NewOkResult(1)}}, }, { Query: "/* client b */ insert into db2.t values (10, 10)", - Expected: []sql.Row{{types.NewOkResult(1)}}, + Expected: []sql.UntypedSqlRow{{types.NewOkResult(1)}}, }, { Query: "/* client a */ select * from db1.t order by x", - Expected: []sql.Row{{1, 1}, {3, 3}, {5, 5}, {7, 7}}, + Expected: []sql.UntypedSqlRow{{1, 1}, {3, 3}, {5, 5}, {7, 7}}, }, { Query: "/* client a */ select * from db2.t order by x", - Expected: []sql.Row{{2, 2}, {4, 4}, {6, 6}, {8, 8}}, + Expected: []sql.UntypedSqlRow{{2, 2}, {4, 4}, {6, 6}, {8, 8}}, }, { Query: "/* client b */ select * from db1.t order by x", - Expected: []sql.Row{{1, 1}, {5, 5}, {7, 7}, {9, 9}}, + Expected: []sql.UntypedSqlRow{{1, 1}, {5, 5}, {7, 7}, {9, 9}}, }, { Query: "/* client b */ select * from db2.t order by x", - Expected: []sql.Row{{2, 2}, {6, 6}, {8, 8}, {10, 10}}, + Expected: []sql.UntypedSqlRow{{2, 2}, {6, 6}, {8, 8}, {10, 10}}, }, { Query: "/* client a */ rollback to SPA2", - Expected: []sql.Row{}, + Expected: []sql.UntypedSqlRow{}, }, { Query: "/* client b */ rollback to spB2", - Expected: []sql.Row{}, + Expected: []sql.UntypedSqlRow{}, }, { Query: "/* client a */ select * from db1.t order by x", - Expected: []sql.Row{{1, 1}, {3, 3}, {5, 5}}, + Expected: []sql.UntypedSqlRow{{1, 1}, {3, 3}, {5, 5}}, }, { Query: "/* client a */ select * from db2.t order by x", - Expected: []sql.Row{{2, 2}, {4, 4}, {6, 6}}, + Expected: []sql.UntypedSqlRow{{2, 2}, {4, 4}, {6, 6}}, }, { Query: "/* client b */ select * from db1.t order by x", - Expected: []sql.Row{{1, 1}, {5, 5}, {7, 7}}, + Expected: []sql.UntypedSqlRow{{1, 1}, {5, 5}, {7, 7}}, }, { Query: "/* client b */ select * from db2.t order by x", - Expected: []sql.Row{{2, 2}, {6, 6}, {8, 8}}, + Expected: []sql.UntypedSqlRow{{2, 2}, {6, 6}, {8, 8}}, }, { Query: "/* client a */ rollback to sPa2", - Expected: []sql.Row{}, + Expected: []sql.UntypedSqlRow{}, }, { Query: "/* client b */ rollback to Spb2", - Expected: []sql.Row{}, + Expected: []sql.UntypedSqlRow{}, }, { Query: "/* client a */ select * from db1.t order by x", - Expected: []sql.Row{{1, 1}, {3, 3}, {5, 5}}, + Expected: []sql.UntypedSqlRow{{1, 1}, {3, 3}, {5, 5}}, }, { Query: "/* client a */ select * from db2.t order by x", - Expected: []sql.Row{{2, 2}, {4, 4}, {6, 6}}, + Expected: []sql.UntypedSqlRow{{2, 2}, {4, 4}, {6, 6}}, }, { Query: "/* client b */ select * from db1.t order by x", - Expected: []sql.Row{{1, 1}, {5, 5}, {7, 7}}, + Expected: []sql.UntypedSqlRow{{1, 1}, {5, 5}, {7, 7}}, }, { Query: "/* client b */ select * from db2.t order by x", - Expected: []sql.Row{{2, 2}, {6, 6}, {8, 8}}, + Expected: []sql.UntypedSqlRow{{2, 2}, {6, 6}, {8, 8}}, }, { Query: "/* client a */ rollback to spA1", - Expected: []sql.Row{}, + Expected: []sql.UntypedSqlRow{}, }, { Query: "/* client b */ rollback to SPb1", - Expected: []sql.Row{}, + Expected: []sql.UntypedSqlRow{}, }, { Query: "/* client a */ select * from db1.t order by x", - Expected: []sql.Row{{1, 1}, {3, 3}}, + Expected: []sql.UntypedSqlRow{{1, 1}, {3, 3}}, }, { Query: "/* client a */ select * from db2.t order by x", - Expected: []sql.Row{{2, 2}, {4, 4}}, + Expected: []sql.UntypedSqlRow{{2, 2}, {4, 4}}, }, { Query: "/* client b */ select * from db1.t order by x", - Expected: []sql.Row{{1, 1}, {5, 5}}, + Expected: []sql.UntypedSqlRow{{1, 1}, {5, 5}}, }, { Query: "/* client b */ select * from db2.t order by x", - Expected: []sql.Row{{2, 2}, {6, 6}}, + Expected: []sql.UntypedSqlRow{{2, 2}, {6, 6}}, }, { Query: "/* client a */ rollback to spa2", @@ -3234,51 +3234,51 @@ var MultiDbSavepointTests = []queries.TransactionTest{ }, { Query: "/* client a */ rollback to Spa1", - Expected: []sql.Row{}, + Expected: []sql.UntypedSqlRow{}, }, { Query: "/* client b */ rollback to spB1", - Expected: []sql.Row{}, + Expected: []sql.UntypedSqlRow{}, }, { Query: "/* client a */ select * from db1.t order by x", - Expected: []sql.Row{{1, 1}, {3, 3}}, + Expected: []sql.UntypedSqlRow{{1, 1}, {3, 3}}, }, { Query: "/* client a */ select * from db2.t order by x", - Expected: []sql.Row{{2, 2}, {4, 4}}, + Expected: []sql.UntypedSqlRow{{2, 2}, {4, 4}}, }, { Query: "/* client b */ select * from db1.t order by x", - Expected: []sql.Row{{1, 1}, {5, 5}}, + Expected: []sql.UntypedSqlRow{{1, 1}, {5, 5}}, }, { Query: "/* client b */ select * from db2.t order by x", - Expected: []sql.Row{{2, 2}, {6, 6}}, + Expected: []sql.UntypedSqlRow{{2, 2}, {6, 6}}, }, { Query: "/* client a */ rollback", - Expected: []sql.Row{}, + Expected: []sql.UntypedSqlRow{}, }, { Query: "/* client b */ rollback", - Expected: []sql.Row{}, + Expected: []sql.UntypedSqlRow{}, }, { Query: "/* client a */ select * from db1.t order by x", - Expected: []sql.Row{{1, 1}}, + Expected: []sql.UntypedSqlRow{{1, 1}}, }, { Query: "/* client a */ select * from db2.t order by x", - Expected: []sql.Row{{2, 2}}, + Expected: []sql.UntypedSqlRow{{2, 2}}, }, { Query: "/* client b */ select * from db1.t order by x", - Expected: []sql.Row{{1, 1}}, + Expected: []sql.UntypedSqlRow{{1, 1}}, }, { Query: "/* client b */ select * from db2.t order by x", - Expected: []sql.Row{{2, 2}}, + Expected: []sql.UntypedSqlRow{{2, 2}}, }, { Query: "/* client a */ rollback to spa1", @@ -3303,83 +3303,83 @@ var MultiDbSavepointTests = []queries.TransactionTest{ Assertions: []queries.ScriptTestAssertion{ { Query: "/* client a */ start transaction", - Expected: []sql.Row{}, + Expected: []sql.UntypedSqlRow{}, }, { Query: "/* client a */ insert into db1.t values (3, 3)", - Expected: []sql.Row{{types.NewOkResult(1)}}, + Expected: []sql.UntypedSqlRow{{types.NewOkResult(1)}}, }, { Query: "/* client a */ insert into db2.t values (4, 4)", - Expected: []sql.Row{{types.NewOkResult(1)}}, + Expected: []sql.UntypedSqlRow{{types.NewOkResult(1)}}, }, { Query: "/* client a */ savepoint spa1", - Expected: []sql.Row{}, + Expected: []sql.UntypedSqlRow{}, }, { Query: "/* client a */ insert into db1.t values (5, 5)", - Expected: []sql.Row{{types.NewOkResult(1)}}, + Expected: []sql.UntypedSqlRow{{types.NewOkResult(1)}}, }, { Query: "/* client a */ insert into db2.t values (6, 6)", - Expected: []sql.Row{{types.NewOkResult(1)}}, + Expected: []sql.UntypedSqlRow{{types.NewOkResult(1)}}, }, { Query: "/* client a */ savepoint spa2", - Expected: []sql.Row{}, + Expected: []sql.UntypedSqlRow{}, }, { Query: "/* client a */ insert into db1.t values (7, 7)", - Expected: []sql.Row{{types.NewOkResult(1)}}, + Expected: []sql.UntypedSqlRow{{types.NewOkResult(1)}}, }, { Query: "/* client a */ insert into db2.t values (8, 8)", - Expected: []sql.Row{{types.NewOkResult(1)}}, + Expected: []sql.UntypedSqlRow{{types.NewOkResult(1)}}, }, { Query: "/* client a */ savepoint SPA1", - Expected: []sql.Row{}, + Expected: []sql.UntypedSqlRow{}, }, { Query: "/* client a */ insert into db1.t values (9, 9)", - Expected: []sql.Row{{types.NewOkResult(1)}}, + Expected: []sql.UntypedSqlRow{{types.NewOkResult(1)}}, }, { Query: "/* client a */ insert into db2.t values (10, 10)", - Expected: []sql.Row{{types.NewOkResult(1)}}, + Expected: []sql.UntypedSqlRow{{types.NewOkResult(1)}}, }, { Query: "/* client a */ select * from db1.t order by x", - Expected: []sql.Row{{1, 1}, {3, 3}, {5, 5}, {7, 7}, {9, 9}}, + Expected: []sql.UntypedSqlRow{{1, 1}, {3, 3}, {5, 5}, {7, 7}, {9, 9}}, }, { Query: "/* client a */ select * from db2.t order by x", - Expected: []sql.Row{{2, 2}, {4, 4}, {6, 6}, {8, 8}, {10, 10}}, + Expected: []sql.UntypedSqlRow{{2, 2}, {4, 4}, {6, 6}, {8, 8}, {10, 10}}, }, { Query: "/* client a */ rollback to Spa1", - Expected: []sql.Row{}, + Expected: []sql.UntypedSqlRow{}, }, { Query: "/* client a */ select * from db1.t order by x", - Expected: []sql.Row{{1, 1}, {3, 3}, {5, 5}, {7, 7}}, + Expected: []sql.UntypedSqlRow{{1, 1}, {3, 3}, {5, 5}, {7, 7}}, }, { Query: "/* client a */ select * from db2.t order by x", - Expected: []sql.Row{{2, 2}, {4, 4}, {6, 6}, {8, 8}}, + Expected: []sql.UntypedSqlRow{{2, 2}, {4, 4}, {6, 6}, {8, 8}}, }, { Query: "/* client a */ rollback to spa2", - Expected: []sql.Row{}, + Expected: []sql.UntypedSqlRow{}, }, { Query: "/* client a */ select * from db1.t order by x", - Expected: []sql.Row{{1, 1}, {3, 3}, {5, 5}}, + Expected: []sql.UntypedSqlRow{{1, 1}, {3, 3}, {5, 5}}, }, { Query: "/* client a */ select * from db2.t order by x", - Expected: []sql.Row{{2, 2}, {4, 4}, {6, 6}}, + Expected: []sql.UntypedSqlRow{{2, 2}, {4, 4}, {6, 6}}, }, { Query: "/* client a */ rollback to spa1", diff --git a/go/libraries/doltcore/sqle/enginetest/prepared_queries.go b/go/libraries/doltcore/sqle/enginetest/prepared_queries.go index 8981ac6b293..57473980903 100644 --- a/go/libraries/doltcore/sqle/enginetest/prepared_queries.go +++ b/go/libraries/doltcore/sqle/enginetest/prepared_queries.go @@ -39,7 +39,7 @@ func DoltPreparedScripts(t *testing.T, harness enginetest.Harness) { Bindings: map[string]sqlparser.Expr{ "v1": sqlparser.NewStrVal([]byte("dolt_history_mytable")), }, - Expected: []sql.Row{{"dolt_history_mytable"}}, + Expected: []sql.UntypedSqlRow{{"dolt_history_mytable"}}, }, } diff --git a/go/libraries/doltcore/sqle/enginetest/privilege_test.go b/go/libraries/doltcore/sqle/enginetest/privilege_test.go index 20796c366d6..1a1c5f3ad22 100755 --- a/go/libraries/doltcore/sqle/enginetest/privilege_test.go +++ b/go/libraries/doltcore/sqle/enginetest/privilege_test.go @@ -163,13 +163,13 @@ var DoltOnlyRevisionDbPrivilegeTests = []queries.UserPrivilegeTest{ User: "root", Host: "localhost", Query: "GRANT SELECT ON mydb.* TO tester@localhost;", - Expected: []sql.Row{{types.NewOkResult(0)}}, + Expected: []sql.UntypedSqlRow{{types.NewOkResult(0)}}, }, { User: "tester", Host: "localhost", Query: "SELECT * FROM test;/*2*/", - Expected: []sql.Row{{1}}, + Expected: []sql.UntypedSqlRow{{1}}, }, { User: "tester", @@ -181,7 +181,7 @@ var DoltOnlyRevisionDbPrivilegeTests = []queries.UserPrivilegeTest{ User: "root", Host: "localhost", Query: "REVOKE SELECT ON mydb.* FROM tester@localhost;", - Expected: []sql.Row{{types.NewOkResult(0)}}, + Expected: []sql.UntypedSqlRow{{types.NewOkResult(0)}}, }, { // Ensure we've reverted to initial state (all SELECTs after REVOKEs are doing this) User: "tester", @@ -199,13 +199,13 @@ var DoltOnlyRevisionDbPrivilegeTests = []queries.UserPrivilegeTest{ User: "root", Host: "localhost", Query: "GRANT SELECT ON mydb.* TO tester@localhost;", - Expected: []sql.Row{{types.NewOkResult(0)}}, + Expected: []sql.UntypedSqlRow{{types.NewOkResult(0)}}, }, { User: "tester", Host: "localhost", Query: "SELECT * FROM mydb.test;/*4*/", - Expected: []sql.Row{{1}}, + Expected: []sql.UntypedSqlRow{{1}}, }, { User: "tester", @@ -217,7 +217,7 @@ var DoltOnlyRevisionDbPrivilegeTests = []queries.UserPrivilegeTest{ User: "root", Host: "localhost", Query: "REVOKE SELECT ON mydb.* FROM tester@localhost;", - Expected: []sql.Row{{types.NewOkResult(0)}}, + Expected: []sql.UntypedSqlRow{{types.NewOkResult(0)}}, }, { User: "tester", @@ -235,13 +235,13 @@ var DoltOnlyRevisionDbPrivilegeTests = []queries.UserPrivilegeTest{ User: "root", Host: "localhost", Query: "GRANT SELECT ON mydb.test TO tester@localhost;", - Expected: []sql.Row{{types.NewOkResult(0)}}, + Expected: []sql.UntypedSqlRow{{types.NewOkResult(0)}}, }, { User: "tester", Host: "localhost", Query: "SELECT * FROM test;/*6*/", - Expected: []sql.Row{{1}}, + Expected: []sql.UntypedSqlRow{{1}}, }, { User: "tester", @@ -253,7 +253,7 @@ var DoltOnlyRevisionDbPrivilegeTests = []queries.UserPrivilegeTest{ User: "root", Host: "localhost", Query: "REVOKE SELECT ON mydb.test FROM tester@localhost;", - Expected: []sql.Row{{types.NewOkResult(0)}}, + Expected: []sql.UntypedSqlRow{{types.NewOkResult(0)}}, }, { User: "tester", @@ -271,7 +271,7 @@ var DoltOnlyRevisionDbPrivilegeTests = []queries.UserPrivilegeTest{ User: "root", Host: "localhost", Query: "GRANT SELECT ON mydb.test2 TO tester@localhost;", - Expected: []sql.Row{{types.NewOkResult(0)}}, + Expected: []sql.UntypedSqlRow{{types.NewOkResult(0)}}, }, { User: "tester", @@ -289,7 +289,7 @@ var DoltOnlyRevisionDbPrivilegeTests = []queries.UserPrivilegeTest{ User: "root", Host: "localhost", Query: "REVOKE SELECT ON mydb.test2 FROM tester@localhost;", - Expected: []sql.Row{{types.NewOkResult(0)}}, + Expected: []sql.UntypedSqlRow{{types.NewOkResult(0)}}, }, { User: "tester", @@ -307,13 +307,13 @@ var DoltOnlyRevisionDbPrivilegeTests = []queries.UserPrivilegeTest{ User: "root", Host: "localhost", Query: "GRANT test_role TO tester@localhost;", - Expected: []sql.Row{{types.NewOkResult(0)}}, + Expected: []sql.UntypedSqlRow{{types.NewOkResult(0)}}, }, { User: "tester", Host: "localhost", Query: "SELECT * FROM test;/*10*/", - Expected: []sql.Row{{1}}, + Expected: []sql.UntypedSqlRow{{1}}, }, { User: "tester", @@ -344,13 +344,13 @@ var DoltOnlyRevisionDbPrivilegeTests = []queries.UserPrivilegeTest{ User: "root", Host: "localhost", Query: "GRANT INSERT ON mydb.* TO tester@localhost;", - Expected: []sql.Row{{types.NewOkResult(0)}}, + Expected: []sql.UntypedSqlRow{{types.NewOkResult(0)}}, }, { User: "tester", Host: "localhost", Query: "INSERT INTO test VALUES (4);", - Expected: []sql.Row{{types.NewOkResult(1)}}, + Expected: []sql.UntypedSqlRow{{types.NewOkResult(1)}}, }, { User: "tester", @@ -362,19 +362,19 @@ var DoltOnlyRevisionDbPrivilegeTests = []queries.UserPrivilegeTest{ User: "root", Host: "localhost", Query: "SELECT * FROM test;", - Expected: []sql.Row{{1}, {2}, {3}, {4}}, + Expected: []sql.UntypedSqlRow{{1}, {2}, {3}, {4}}, }, { User: "root", Host: "localhost", Query: "GRANT SELECT ON mydb.* TO tester@localhost;", - Expected: []sql.Row{{types.NewOkResult(0)}}, + Expected: []sql.UntypedSqlRow{{types.NewOkResult(0)}}, }, { User: "tester", Host: "localhost", Query: "SELECT * FROM test;", - Expected: []sql.Row{{1}, {2}, {3}, {4}}, + Expected: []sql.UntypedSqlRow{{1}, {2}, {3}, {4}}, }, }, }, @@ -399,7 +399,7 @@ var DoltOnlyRevisionDbPrivilegeTests = []queries.UserPrivilegeTest{ User: "root", Host: "localhost", Query: "GRANT UPDATE ON mydb.* TO tester@localhost;", - Expected: []sql.Row{{types.NewOkResult(0)}}, + Expected: []sql.UntypedSqlRow{{types.NewOkResult(0)}}, }, { User: "tester", @@ -411,7 +411,7 @@ var DoltOnlyRevisionDbPrivilegeTests = []queries.UserPrivilegeTest{ User: "tester", Host: "localhost", Query: "UPDATE test set pk = 4 where pk = 3;", - Expected: []sql.Row{{types.OkResult{ + Expected: []sql.UntypedSqlRow{{types.OkResult{ RowsAffected: 1, Info: plan.UpdateInfo{ Matched: 1, @@ -429,7 +429,7 @@ var DoltOnlyRevisionDbPrivilegeTests = []queries.UserPrivilegeTest{ User: "root", Host: "localhost", Query: "SELECT * FROM test;", - Expected: []sql.Row{{1}, {2}, {4}}, + Expected: []sql.UntypedSqlRow{{1}, {2}, {4}}, }, }, }, @@ -454,7 +454,7 @@ var DoltOnlyRevisionDbPrivilegeTests = []queries.UserPrivilegeTest{ User: "root", Host: "localhost", Query: "GRANT DELETE ON mydb.* TO tester@localhost;", - Expected: []sql.Row{{types.NewOkResult(0)}}, + Expected: []sql.UntypedSqlRow{{types.NewOkResult(0)}}, }, { User: "tester", @@ -466,7 +466,7 @@ var DoltOnlyRevisionDbPrivilegeTests = []queries.UserPrivilegeTest{ User: "tester", Host: "localhost", Query: "DELETE from test where pk = 3;", - Expected: []sql.Row{{types.NewOkResult(1)}}, + Expected: []sql.UntypedSqlRow{{types.NewOkResult(1)}}, }, { User: "tester", @@ -478,7 +478,7 @@ var DoltOnlyRevisionDbPrivilegeTests = []queries.UserPrivilegeTest{ User: "root", Host: "localhost", Query: "SELECT * FROM test;", - Expected: []sql.Row{{1}, {2}}, + Expected: []sql.UntypedSqlRow{{1}, {2}}, }, }, }, @@ -502,19 +502,19 @@ var DoltOnlyRevisionDbPrivilegeTests = []queries.UserPrivilegeTest{ User: "root", Host: "localhost", Query: "GRANT CREATE ON mydb.* TO tester@localhost;", - Expected: []sql.Row{{types.NewOkResult(0)}}, + Expected: []sql.UntypedSqlRow{{types.NewOkResult(0)}}, }, { User: "tester", Host: "localhost", Query: "CREATE TABLE t2 (a int primary key);", - Expected: []sql.Row{{types.NewOkResult(0)}}, + Expected: []sql.UntypedSqlRow{{types.NewOkResult(0)}}, }, { User: "tester", Host: "localhost", Query: "show tables;", - Expected: []sql.Row{{"mytable"}, {"myview"}, {"test"}, {"t2"}}, + Expected: []sql.UntypedSqlRow{{"mytable"}, {"myview"}, {"test"}, {"t2"}}, }, }, }, @@ -539,19 +539,19 @@ var DoltOnlyRevisionDbPrivilegeTests = []queries.UserPrivilegeTest{ User: "root", Host: "localhost", Query: "GRANT DROP ON mydb.* TO tester@localhost;", - Expected: []sql.Row{{types.NewOkResult(0)}}, + Expected: []sql.UntypedSqlRow{{types.NewOkResult(0)}}, }, { User: "tester", Host: "localhost", Query: "DROP TABLE TEST", - Expected: []sql.Row{{types.NewOkResult(0)}}, + Expected: []sql.UntypedSqlRow{{types.NewOkResult(0)}}, }, { User: "tester", Host: "localhost", Query: "show tables;", - Expected: []sql.Row{{"mytable"}, {"myview"}}, + Expected: []sql.UntypedSqlRow{{"mytable"}, {"myview"}}, }, }, }, @@ -576,19 +576,19 @@ var DoltOnlyRevisionDbPrivilegeTests = []queries.UserPrivilegeTest{ User: "root", Host: "localhost", Query: "GRANT ALTER ON mydb.* TO tester@localhost;", - Expected: []sql.Row{{types.NewOkResult(0)}}, + Expected: []sql.UntypedSqlRow{{types.NewOkResult(0)}}, }, { User: "tester", Host: "localhost", Query: "ALTER TABLE test add column a int;", - Expected: []sql.Row{{types.NewOkResult(0)}}, + Expected: []sql.UntypedSqlRow{{types.NewOkResult(0)}}, }, { User: "tester", Host: "localhost", Query: "desc test;", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {"pk", "bigint", "NO", "PRI", nil, ""}, {"a", "int", "YES", "", nil, ""}, }, @@ -616,7 +616,7 @@ var DoltOnlyRevisionDbPrivilegeTests = []queries.UserPrivilegeTest{ User: "root", Host: "localhost", Query: "GRANT select ON mydb.* TO tester@localhost;", - Expected: []sql.Row{{types.NewOkResult(0)}}, + Expected: []sql.UntypedSqlRow{{types.NewOkResult(0)}}, }, { User: "tester", @@ -628,19 +628,19 @@ var DoltOnlyRevisionDbPrivilegeTests = []queries.UserPrivilegeTest{ User: "root", Host: "localhost", Query: "GRANT index ON mydb.* TO tester@localhost;", - Expected: []sql.Row{{types.NewOkResult(0)}}, + Expected: []sql.UntypedSqlRow{{types.NewOkResult(0)}}, }, { User: "tester", Host: "localhost", Query: "create index t1 on test(a) ;", - Expected: []sql.Row{{types.NewOkResult(0)}}, + Expected: []sql.UntypedSqlRow{{types.NewOkResult(0)}}, }, { User: "tester", Host: "localhost", Query: "desc test;", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {"pk", "bigint", "NO", "PRI", nil, ""}, {"a", "int", "YES", "MUL", nil, ""}, }, @@ -649,7 +649,7 @@ var DoltOnlyRevisionDbPrivilegeTests = []queries.UserPrivilegeTest{ User: "root", Host: "localhost", Query: "REVOKE index ON mydb.* FROM tester@localhost;", - Expected: []sql.Row{{types.NewOkResult(0)}}, + Expected: []sql.UntypedSqlRow{{types.NewOkResult(0)}}, }, { User: "tester", @@ -661,19 +661,19 @@ var DoltOnlyRevisionDbPrivilegeTests = []queries.UserPrivilegeTest{ User: "root", Host: "localhost", Query: "GRANT index ON mydb.* TO tester@localhost;", - Expected: []sql.Row{{types.NewOkResult(0)}}, + Expected: []sql.UntypedSqlRow{{types.NewOkResult(0)}}, }, { User: "tester", Host: "localhost", Query: "drop index t1 on test;", - Expected: []sql.Row{{types.NewOkResult(0)}}, + Expected: []sql.UntypedSqlRow{{types.NewOkResult(0)}}, }, { User: "tester", Host: "localhost", Query: "desc test;", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {"pk", "bigint", "NO", "PRI", nil, ""}, {"a", "int", "YES", "", nil, ""}, }, @@ -701,7 +701,7 @@ var DoltOnlyRevisionDbPrivilegeTests = []queries.UserPrivilegeTest{ User: "root", Host: "localhost", Query: "GRANT select ON mydb.* TO tester@localhost;", - Expected: []sql.Row{{types.NewOkResult(0)}}, + Expected: []sql.UntypedSqlRow{{types.NewOkResult(0)}}, }, { User: "tester", @@ -713,19 +713,19 @@ var DoltOnlyRevisionDbPrivilegeTests = []queries.UserPrivilegeTest{ User: "root", Host: "localhost", Query: "GRANT alter ON mydb.* TO tester@localhost;", - Expected: []sql.Row{{types.NewOkResult(0)}}, + Expected: []sql.UntypedSqlRow{{types.NewOkResult(0)}}, }, { User: "tester", Host: "localhost", Query: "alter table test add constraint chk1 CHECK (a < 10);", - Expected: []sql.Row{{types.NewOkResult(0)}}, + Expected: []sql.UntypedSqlRow{{types.NewOkResult(0)}}, }, { User: "tester", Host: "localhost", Query: "show create table test;", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {"test", "CREATE TABLE `test` (\n" + " `pk` bigint NOT NULL,\n" + " `a` int,\n" + @@ -738,7 +738,7 @@ var DoltOnlyRevisionDbPrivilegeTests = []queries.UserPrivilegeTest{ User: "root", Host: "localhost", Query: "REVOKE alter ON mydb.* FROM tester@localhost;", - Expected: []sql.Row{{types.NewOkResult(0)}}, + Expected: []sql.UntypedSqlRow{{types.NewOkResult(0)}}, }, { User: "tester", @@ -750,19 +750,19 @@ var DoltOnlyRevisionDbPrivilegeTests = []queries.UserPrivilegeTest{ User: "root", Host: "localhost", Query: "GRANT alter ON mydb.* TO tester@localhost;", - Expected: []sql.Row{{types.NewOkResult(0)}}, + Expected: []sql.UntypedSqlRow{{types.NewOkResult(0)}}, }, { User: "tester", Host: "localhost", Query: "alter table test drop check chk1;", - Expected: []sql.Row{}, + Expected: []sql.UntypedSqlRow{}, }, { User: "tester", Host: "localhost", Query: "show create table test;", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {"test", "CREATE TABLE `test` (\n" + " `pk` bigint NOT NULL,\n" + " `a` int,\n" + @@ -774,13 +774,13 @@ var DoltOnlyRevisionDbPrivilegeTests = []queries.UserPrivilegeTest{ User: "tester", Host: "localhost", Query: "alter table test add constraint chk1 CHECK (a < 10);", - Expected: []sql.Row{{types.NewOkResult(0)}}, + Expected: []sql.UntypedSqlRow{{types.NewOkResult(0)}}, }, { User: "root", Host: "localhost", Query: "REVOKE alter ON mydb.* FROM tester@localhost;", - Expected: []sql.Row{{types.NewOkResult(0)}}, + Expected: []sql.UntypedSqlRow{{types.NewOkResult(0)}}, }, { User: "tester", @@ -792,19 +792,19 @@ var DoltOnlyRevisionDbPrivilegeTests = []queries.UserPrivilegeTest{ User: "root", Host: "localhost", Query: "GRANT alter ON mydb.* TO tester@localhost;", - Expected: []sql.Row{{types.NewOkResult(0)}}, + Expected: []sql.UntypedSqlRow{{types.NewOkResult(0)}}, }, { User: "tester", Host: "localhost", Query: "alter table test drop constraint chk1;", - Expected: []sql.Row{}, + Expected: []sql.UntypedSqlRow{}, }, { User: "tester", Host: "localhost", Query: "show create table test;", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {"test", "CREATE TABLE `test` (\n" + " `pk` bigint NOT NULL,\n" + " `a` int,\n" + @@ -830,19 +830,19 @@ var DoltOnlyRevisionDbPrivilegeTests = []queries.UserPrivilegeTest{ User: "tester", Host: "localhost", Query: "SELECT * FROM test;", - Expected: []sql.Row{{1}, {2}, {3}}, + Expected: []sql.UntypedSqlRow{{1}, {2}, {3}}, }, { User: "root", Host: "localhost", Query: "SELECT User, Host, Select_priv FROM mysql.user WHERE User = 'tester';", - Expected: []sql.Row{{"tester", "localhost", "N"}}, + Expected: []sql.UntypedSqlRow{{"tester", "localhost", "N"}}, }, { User: "root", Host: "localhost", Query: "REVOKE SELECT ON mydb.* FROM tester@localhost;", - Expected: []sql.Row{{types.NewOkResult(0)}}, + Expected: []sql.UntypedSqlRow{{types.NewOkResult(0)}}, }, { User: "tester", @@ -854,7 +854,7 @@ var DoltOnlyRevisionDbPrivilegeTests = []queries.UserPrivilegeTest{ User: "root", Host: "localhost", Query: "SELECT User, Host, Select_priv FROM mysql.user WHERE User = 'tester';", - Expected: []sql.Row{{"tester", "localhost", "N"}}, + Expected: []sql.UntypedSqlRow{{"tester", "localhost", "N"}}, }, }, }, @@ -882,31 +882,31 @@ var DoltOnlyRevisionDbPrivilegeTests = []queries.UserPrivilegeTest{ User: "root", Host: "localhost", Query: "SELECT COUNT(*) FROM mysql.role_edges;", - Expected: []sql.Row{{0}}, + Expected: []sql.UntypedSqlRow{{0}}, }, { User: "root", Host: "localhost", Query: "GRANT test_role TO tester@localhost;", - Expected: []sql.Row{{types.NewOkResult(0)}}, + Expected: []sql.UntypedSqlRow{{types.NewOkResult(0)}}, }, { User: "root", Host: "localhost", Query: "SELECT * FROM mysql.role_edges;", - Expected: []sql.Row{{"%", "test_role", "localhost", "tester", "N"}}, + Expected: []sql.UntypedSqlRow{{"%", "test_role", "localhost", "tester", "N"}}, }, { User: "tester", Host: "localhost", Query: "SELECT * FROM test;", - Expected: []sql.Row{{1}, {2}, {3}}, + Expected: []sql.UntypedSqlRow{{1}, {2}, {3}}, }, { User: "root", Host: "localhost", Query: "SELECT User, Host, Select_priv FROM mysql.user WHERE User = 'tester';", - Expected: []sql.Row{{"tester", "localhost", "N"}}, + Expected: []sql.UntypedSqlRow{{"tester", "localhost", "N"}}, }, }, }, @@ -929,19 +929,19 @@ var DoltOnlyRevisionDbPrivilegeTests = []queries.UserPrivilegeTest{ User: "tester", Host: "localhost", Query: "SELECT * FROM test;", - Expected: []sql.Row{{1}, {2}, {3}}, + Expected: []sql.UntypedSqlRow{{1}, {2}, {3}}, }, { User: "root", Host: "localhost", Query: "SELECT * FROM mysql.role_edges;", - Expected: []sql.Row{{"%", "test_role", "localhost", "tester", "N"}}, + Expected: []sql.UntypedSqlRow{{"%", "test_role", "localhost", "tester", "N"}}, }, { User: "root", Host: "localhost", Query: "REVOKE test_role FROM tester@localhost;", - Expected: []sql.Row{{types.NewOkResult(0)}}, + Expected: []sql.UntypedSqlRow{{types.NewOkResult(0)}}, }, { User: "tester", @@ -953,19 +953,19 @@ var DoltOnlyRevisionDbPrivilegeTests = []queries.UserPrivilegeTest{ User: "root", Host: "localhost", Query: "SELECT COUNT(*) FROM mysql.role_edges;", - Expected: []sql.Row{{0}}, + Expected: []sql.UntypedSqlRow{{0}}, }, { User: "root", Host: "localhost", Query: "SELECT COUNT(*) FROM mysql.user WHERE User = 'test_role';", - Expected: []sql.Row{{1}}, + Expected: []sql.UntypedSqlRow{{1}}, }, { User: "root", Host: "localhost", Query: "SELECT COUNT(*) FROM mysql.user WHERE User = 'tester';", - Expected: []sql.Row{{1}}, + Expected: []sql.UntypedSqlRow{{1}}, }, }, }, diff --git a/go/libraries/doltcore/sqle/enginetest/stats_queries.go b/go/libraries/doltcore/sqle/enginetest/stats_queries.go index a844607e71b..df288dbebc9 100644 --- a/go/libraries/doltcore/sqle/enginetest/stats_queries.go +++ b/go/libraries/doltcore/sqle/enginetest/stats_queries.go @@ -44,7 +44,7 @@ var DoltHistogramTests = []queries.ScriptTest{ Assertions: []queries.ScriptTestAssertion{ { Query: " SELECT mcv_cnt from information_schema.column_statistics join json_table(histogram, '$.statistic.buckets[*]' COLUMNS(mcv_cnt JSON path '$.mcv_counts')) as dt where table_name = 'xy' and column_name = 'y,z'", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {types.JSONDocument{Val: []interface{}{ float64(4), }}}, @@ -52,7 +52,7 @@ var DoltHistogramTests = []queries.ScriptTest{ }, { Query: " SELECT mcv from information_schema.column_statistics join json_table(histogram, '$.statistic.buckets[*]' COLUMNS(mcv JSON path '$.mcvs[*]')) as dt where table_name = 'xy' and column_name = 'y,z'", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {types.JSONDocument{Val: []interface{}{ []interface{}{float64(0), "a"}, }}}, @@ -60,7 +60,7 @@ var DoltHistogramTests = []queries.ScriptTest{ }, { Query: " SELECT x,z from information_schema.column_statistics join json_table(histogram, '$.statistic.buckets[*]' COLUMNS(x bigint path '$.upper_bound[0]', z text path '$.upper_bound[1]')) as dt where table_name = 'xy' and column_name = 'y,z'", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {2, "a"}, }, }, @@ -78,23 +78,23 @@ var DoltHistogramTests = []queries.ScriptTest{ Assertions: []queries.ScriptTestAssertion{ { Query: "SELECT json_length(json_extract(histogram, \"$.statistic.buckets\")) from information_schema.column_statistics where column_name = 'x'", - Expected: []sql.Row{{32}}, + Expected: []sql.UntypedSqlRow{{32}}, }, { Query: " SELECT sum(cnt) from information_schema.column_statistics join json_table(histogram, '$.statistic.buckets[*]' COLUMNS(cnt int path '$.row_count')) as dt where table_name = 'xy' and column_name = 'x'", - Expected: []sql.Row{{float64(30000)}}, + Expected: []sql.UntypedSqlRow{{float64(30000)}}, }, { Query: " SELECT sum(cnt) from information_schema.column_statistics join json_table(histogram, '$.statistic.buckets[*]' COLUMNS(cnt int path '$.null_count')) as dt where table_name = 'xy' and column_name = 'x'", - Expected: []sql.Row{{float64(0)}}, + Expected: []sql.UntypedSqlRow{{float64(0)}}, }, { Query: " SELECT sum(cnt) from information_schema.column_statistics join json_table(histogram, '$.statistic.buckets[*]' COLUMNS(cnt int path '$.distinct_count')) as dt where table_name = 'xy' and column_name = 'x'", - Expected: []sql.Row{{float64(30000)}}, + Expected: []sql.UntypedSqlRow{{float64(30000)}}, }, { Query: " SELECT max(bound_cnt) from information_schema.column_statistics join json_table(histogram, '$.statistic.buckets[*]' COLUMNS(bound_cnt int path '$.bound_count')) as dt where table_name = 'xy' and column_name = 'x'", - Expected: []sql.Row{{int64(1)}}, + Expected: []sql.UntypedSqlRow{{int64(1)}}, }, }, }, @@ -109,30 +109,30 @@ var DoltHistogramTests = []queries.ScriptTest{ Assertions: []queries.ScriptTestAssertion{ { Query: "SELECT json_length(json_extract(histogram, \"$.statistic.buckets\")) from information_schema.column_statistics where column_name = 'z'", - Expected: []sql.Row{{2}}, + Expected: []sql.UntypedSqlRow{{2}}, }, { // bucket boundary duplication Query: "SELECT json_value(histogram, \"$.statistic.distinct_count\", 'signed') from information_schema.column_statistics where column_name = 'z'", - Expected: []sql.Row{{202}}, + Expected: []sql.UntypedSqlRow{{202}}, }, { Query: " SELECT sum(cnt) from information_schema.column_statistics join json_table(histogram, '$.statistic.buckets[*]' COLUMNS(cnt int path '$.row_count')) as dt where table_name = 'xy' and column_name = 'z'", - Expected: []sql.Row{{float64(400)}}, + Expected: []sql.UntypedSqlRow{{float64(400)}}, }, { Query: " SELECT sum(cnt) from information_schema.column_statistics join json_table(histogram, '$.statistic.buckets[*]' COLUMNS(cnt int path '$.null_count')) as dt where table_name = 'xy' and column_name = 'z'", - Expected: []sql.Row{{float64(200)}}, + Expected: []sql.UntypedSqlRow{{float64(200)}}, }, { // chunk border double count Query: " SELECT sum(cnt) from information_schema.column_statistics join json_table(histogram, '$.statistic.buckets[*]' COLUMNS(cnt int path '$.distinct_count')) as dt where table_name = 'xy' and column_name = 'z'", - Expected: []sql.Row{{float64(202)}}, + Expected: []sql.UntypedSqlRow{{float64(202)}}, }, { // max bound count is an all nulls chunk Query: " SELECT max(bound_cnt) from information_schema.column_statistics join json_table(histogram, '$.statistic.buckets[*]' COLUMNS(bound_cnt int path '$.bound_count')) as dt where table_name = 'xy' and column_name = 'z'", - Expected: []sql.Row{{int64(183)}}, + Expected: []sql.UntypedSqlRow{{int64(183)}}, }, }, }, @@ -148,25 +148,25 @@ var DoltHistogramTests = []queries.ScriptTest{ Assertions: []queries.ScriptTestAssertion{ { Query: "SELECT json_length(json_extract(histogram, \"$.statistic.buckets\")) from information_schema.column_statistics where column_name = 'z'", - Expected: []sql.Row{{152}}, + Expected: []sql.UntypedSqlRow{{152}}, }, { Query: " SELECT sum(cnt) from information_schema.column_statistics join json_table(histogram, '$.statistic.buckets[*]' COLUMNS(cnt int path '$.row_count')) as dt where table_name = 'xy' and column_name = 'z'", - Expected: []sql.Row{{float64(30000)}}, + Expected: []sql.UntypedSqlRow{{float64(30000)}}, }, { Query: " SELECT sum(cnt) from information_schema.column_statistics join json_table(histogram, '$.statistic.buckets[*]' COLUMNS(cnt int path '$.null_count')) as dt where table_name = 'xy' and column_name = 'z'", - Expected: []sql.Row{{float64(10000)}}, + Expected: []sql.UntypedSqlRow{{float64(10000)}}, }, { // border NULL double count Query: " SELECT sum(cnt) from information_schema.column_statistics join json_table(histogram, '$.statistic.buckets[*]' COLUMNS(cnt int path '$.distinct_count')) as dt where table_name = 'xy' and column_name = 'z'", - Expected: []sql.Row{{float64(20036)}}, + Expected: []sql.UntypedSqlRow{{float64(20036)}}, }, { // max bound count is nulls chunk Query: " SELECT max(bound_cnt) from information_schema.column_statistics join json_table(histogram, '$.statistic.buckets[*]' COLUMNS(bound_cnt int path '$.bound_count')) as dt where table_name = 'xy' and column_name = 'z'", - Expected: []sql.Row{{int64(440)}}, + Expected: []sql.UntypedSqlRow{{int64(440)}}, }, }, }, @@ -182,24 +182,24 @@ var DoltHistogramTests = []queries.ScriptTest{ Assertions: []queries.ScriptTestAssertion{ { Query: "SELECT json_length(json_extract(histogram, \"$.statistic.buckets\")) from information_schema.column_statistics where column_name = 'x,z'", - Expected: []sql.Row{{155}}, + Expected: []sql.UntypedSqlRow{{155}}, }, { Query: " SELECT sum(cnt) from information_schema.column_statistics join json_table(histogram, '$.statistic.buckets[*]' COLUMNS(cnt int path '$.row_count')) as dt where table_name = 'xy' and column_name = 'x,z'", - Expected: []sql.Row{{float64(30000)}}, + Expected: []sql.UntypedSqlRow{{float64(30000)}}, }, { Query: " SELECT sum(cnt) from information_schema.column_statistics join json_table(histogram, '$.statistic.buckets[*]' COLUMNS(cnt int path '$.null_count')) as dt where table_name = 'xy' and column_name = 'x,z'", - Expected: []sql.Row{{float64(10000)}}, + Expected: []sql.UntypedSqlRow{{float64(10000)}}, }, { Query: " SELECT sum(cnt) from information_schema.column_statistics join json_table(histogram, '$.statistic.buckets[*]' COLUMNS(cnt int path '$.distinct_count')) as dt where table_name = 'xy' and column_name = 'x,z'", - Expected: []sql.Row{{float64(30000)}}, + Expected: []sql.UntypedSqlRow{{float64(30000)}}, }, { // max bound count is nulls chunk Query: " SELECT max(bound_cnt) from information_schema.column_statistics join json_table(histogram, '$.statistic.buckets[*]' COLUMNS(bound_cnt int path '$.bound_count')) as dt where table_name = 'xy' and column_name = 'x,z'", - Expected: []sql.Row{{int64(1)}}, + Expected: []sql.UntypedSqlRow{{int64(1)}}, }, }, }, @@ -212,14 +212,14 @@ var DoltHistogramTests = []queries.ScriptTest{ Assertions: []queries.ScriptTestAssertion{ { Query: " SELECT column_name from information_schema.column_statistics", - Expected: []sql.Row{}, + Expected: []sql.UntypedSqlRow{}, }, { Query: "analyze table xy", }, { Query: " SELECT column_name from information_schema.column_statistics", - Expected: []sql.Row{{"x"}, {"z"}, {"x,z"}}, + Expected: []sql.UntypedSqlRow{{"x"}, {"z"}, {"x,z"}}, }, }, }, @@ -235,24 +235,24 @@ var DoltHistogramTests = []queries.ScriptTest{ Assertions: []queries.ScriptTestAssertion{ { Query: "SELECT json_length(json_extract(histogram, \"$.statistic.buckets\")) from information_schema.column_statistics where column_name = 'x'", - Expected: []sql.Row{{26}}, + Expected: []sql.UntypedSqlRow{{26}}, }, { Query: " SELECT sum(cnt) from information_schema.column_statistics join json_table(histogram, '$.statistic.buckets[*]' COLUMNS(cnt int path '$.row_count')) as dt where table_name = 'xy' and column_name = 'x'", - Expected: []sql.Row{{float64(30000)}}, + Expected: []sql.UntypedSqlRow{{float64(30000)}}, }, { Query: " SELECT sum(cnt) from information_schema.column_statistics join json_table(histogram, '$.statistic.buckets[*]' COLUMNS(cnt int path '$.null_count')) as dt where table_name = 'xy' and column_name = 'x'", - Expected: []sql.Row{{float64(0)}}, + Expected: []sql.UntypedSqlRow{{float64(0)}}, }, { Query: " SELECT sum(cnt) from information_schema.column_statistics join json_table(histogram, '$.statistic.buckets[*]' COLUMNS(cnt int path '$.distinct_count')) as dt where table_name = 'xy' and column_name = 'x'", - Expected: []sql.Row{{float64(30000)}}, + Expected: []sql.UntypedSqlRow{{float64(30000)}}, }, { // max bound count is nulls chunk Query: " SELECT max(bound_cnt) from information_schema.column_statistics join json_table(histogram, '$.statistic.buckets[*]' COLUMNS(bound_cnt int path '$.bound_count')) as dt where table_name = 'xy' and column_name = 'x'", - Expected: []sql.Row{{int64(1)}}, + Expected: []sql.UntypedSqlRow{{int64(1)}}, }, }, }, @@ -268,28 +268,28 @@ var DoltHistogramTests = []queries.ScriptTest{ Assertions: []queries.ScriptTestAssertion{ { Query: " SELECT column_name from information_schema.column_statistics", - Expected: []sql.Row{{"z,x"}}, + Expected: []sql.UntypedSqlRow{{"z,x"}}, }, { Query: "SELECT json_length(json_extract(histogram, \"$.statistic.buckets\")) from information_schema.column_statistics where column_name = 'z,x'", - Expected: []sql.Row{{42}}, + Expected: []sql.UntypedSqlRow{{42}}, }, { Query: " SELECT sum(cnt) from information_schema.column_statistics join json_table(histogram, '$.statistic.buckets[*]' COLUMNS(cnt int path '$.row_count')) as dt where table_name = 'xy' and column_name = 'z,x'", - Expected: []sql.Row{{float64(30000)}}, + Expected: []sql.UntypedSqlRow{{float64(30000)}}, }, { Query: " SELECT sum(cnt) from information_schema.column_statistics join json_table(histogram, '$.statistic.buckets[*]' COLUMNS(cnt int path '$.null_count')) as dt where table_name = 'xy' and column_name = 'z,x'", - Expected: []sql.Row{{float64(0)}}, + Expected: []sql.UntypedSqlRow{{float64(0)}}, }, { Query: " SELECT sum(cnt) from information_schema.column_statistics join json_table(histogram, '$.statistic.buckets[*]' COLUMNS(cnt int path '$.distinct_count')) as dt where table_name = 'xy' and column_name = 'z,x'", - Expected: []sql.Row{{float64(30000)}}, + Expected: []sql.UntypedSqlRow{{float64(30000)}}, }, { // max bound count is nulls chunk Query: " SELECT max(bound_cnt) from information_schema.column_statistics join json_table(histogram, '$.statistic.buckets[*]' COLUMNS(bound_cnt int path '$.bound_count')) as dt where table_name = 'xy' and column_name = 'z,x'", - Expected: []sql.Row{{int64(1)}}, + Expected: []sql.UntypedSqlRow{{int64(1)}}, }, }, }, @@ -306,25 +306,25 @@ var DoltStatsIOTests = []queries.ScriptTest{ Assertions: []queries.ScriptTestAssertion{ { Query: "select database_name, table_name, index_name, columns, types from dolt_statistics", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {"mydb", "xy", "primary", "x", "bigint"}, {"mydb", "xy", "y", "y,z", "int,varchar(500)"}, }, }, { Query: fmt.Sprintf("select %s, %s, %s from dolt_statistics", schema.StatsRowCountColName, schema.StatsDistinctCountColName, schema.StatsNullCountColName), - Expected: []sql.Row{{uint64(6), uint64(6), uint64(0)}, {uint64(6), uint64(3), uint64(0)}}, + Expected: []sql.UntypedSqlRow{{uint64(6), uint64(6), uint64(0)}, {uint64(6), uint64(3), uint64(0)}}, }, { Query: fmt.Sprintf("select %s, %s from dolt_statistics", schema.StatsUpperBoundColName, schema.StatsUpperBoundCntColName), - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {"5", uint64(1)}, {"2,a", uint64(1)}, }, }, { Query: fmt.Sprintf("select %s, %s, %s, %s, %s from dolt_statistics", schema.StatsMcv1ColName, schema.StatsMcv2ColName, schema.StatsMcv3ColName, schema.StatsMcv4ColName, schema.StatsMcvCountsColName), - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {"", "", "", "", ""}, {"0,a", "", "", "", "4"}, }, @@ -341,7 +341,7 @@ var DoltStatsIOTests = []queries.ScriptTest{ Assertions: []queries.ScriptTestAssertion{ { Query: "select count(*) from dolt_statistics", - Expected: []sql.Row{{1}}, + Expected: []sql.UntypedSqlRow{{1}}, }, }, }, @@ -355,7 +355,7 @@ var DoltStatsIOTests = []queries.ScriptTest{ Assertions: []queries.ScriptTestAssertion{ { Query: "select count(*) from dolt_statistics", - Expected: []sql.Row{{2}}, + Expected: []sql.UntypedSqlRow{{2}}, }, }, }, @@ -369,7 +369,7 @@ var DoltStatsIOTests = []queries.ScriptTest{ Assertions: []queries.ScriptTestAssertion{ { Query: "select database_name, table_name, index_name, columns, types from dolt_statistics", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {"mydb", "xy", "primary", "x", "bigint"}, {"mydb", "xy", "y", "y,x", "varchar(10),bigint"}, }, @@ -386,7 +386,7 @@ var DoltStatsIOTests = []queries.ScriptTest{ Assertions: []queries.ScriptTestAssertion{ { Query: "select database_name, table_name, index_name, columns, types from dolt_statistics", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {"mydb", "xy", "y", "y", "varbinary(10)"}, {"mydb", "xy", "primary", "x", "bigint"}, {"mydb", "xy", "z", "z", "binary(14)"}, @@ -394,7 +394,7 @@ var DoltStatsIOTests = []queries.ScriptTest{ }, { Query: "select count(*) from dolt_statistics", - Expected: []sql.Row{{3}}, + Expected: []sql.UntypedSqlRow{{3}}, }, }, }, @@ -408,14 +408,14 @@ var DoltStatsIOTests = []queries.ScriptTest{ Assertions: []queries.ScriptTestAssertion{ { Query: "select database_name, table_name, index_name, columns, types from dolt_statistics", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {"mydb", "xy", "primary", "x", "bigint"}, {"mydb", "xy", "y", "y", "timestamp"}, }, }, { Query: "select count(*) from dolt_statistics", - Expected: []sql.Row{{2}}, + Expected: []sql.UntypedSqlRow{{2}}, }, }, }, @@ -432,18 +432,18 @@ var DoltStatsIOTests = []queries.ScriptTest{ Assertions: []queries.ScriptTestAssertion{ { Query: "select database_name, table_name, index_name, columns, types from dolt_statistics where table_name = 'xy'", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {"mydb", "xy", "primary", "x", "bigint"}, {"mydb", "xy", "y", "y,z", "int,varchar(500)"}, }, }, { Query: fmt.Sprintf("select %s, %s, %s from dolt_statistics where table_name = 'xy'", schema.StatsRowCountColName, schema.StatsDistinctCountColName, schema.StatsNullCountColName), - Expected: []sql.Row{{uint64(6), uint64(6), uint64(0)}, {uint64(6), uint64(3), uint64(0)}}, + Expected: []sql.UntypedSqlRow{{uint64(6), uint64(6), uint64(0)}, {uint64(6), uint64(3), uint64(0)}}, }, { Query: "select `table_name`, `index_name` from dolt_statistics", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {"ab", "primary"}, {"ab", "b"}, {"xy", "primary"}, @@ -452,14 +452,14 @@ var DoltStatsIOTests = []queries.ScriptTest{ }, { Query: "select database_name, table_name, index_name, columns, types from dolt_statistics where table_name = 'ab'", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {"mydb", "ab", "primary", "a", "bigint"}, {"mydb", "ab", "b", "b,c", "int,int"}, }, }, { Query: fmt.Sprintf("select %s, %s, %s from dolt_statistics where table_name = 'ab'", schema.StatsRowCountColName, schema.StatsDistinctCountColName, schema.StatsNullCountColName), - Expected: []sql.Row{{uint64(6), uint64(6), uint64(0)}, {uint64(6), uint64(3), uint64(0)}}, + Expected: []sql.UntypedSqlRow{{uint64(6), uint64(6), uint64(0)}, {uint64(6), uint64(3), uint64(0)}}, }, }, }, @@ -476,7 +476,7 @@ var DoltStatsIOTests = []queries.ScriptTest{ Assertions: []queries.ScriptTestAssertion{ { Query: fmt.Sprintf("select %s, %s, %s from dolt_statistics where table_name = 'xy'", schema.StatsRowCountColName, schema.StatsDistinctCountColName, schema.StatsNullCountColName), - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {uint64(8), uint64(8), uint64(0)}, {uint64(8), uint64(3), uint64(0)}, }, @@ -493,7 +493,7 @@ var DoltStatsIOTests = []queries.ScriptTest{ Assertions: []queries.ScriptTestAssertion{ { Query: "select count(*) as cnt from dolt_statistics group by table_name, index_name order by cnt", - Expected: []sql.Row{{6}, {7}}, + Expected: []sql.UntypedSqlRow{{6}, {7}}, }, { Query: "delete from xy where x > 500", @@ -503,7 +503,7 @@ var DoltStatsIOTests = []queries.ScriptTest{ }, { Query: "select count(*) from dolt_statistics group by table_name, index_name", - Expected: []sql.Row{{4}, {4}}, + Expected: []sql.UntypedSqlRow{{4}, {4}}, }, }, }, @@ -519,7 +519,7 @@ var DoltStatsIOTests = []queries.ScriptTest{ Assertions: []queries.ScriptTestAssertion{ { Query: "select count(*) as cnt from dolt_statistics group by table_name, index_name order by cnt", - Expected: []sql.Row{{6}, {7}}, + Expected: []sql.UntypedSqlRow{{6}, {7}}, }, { Query: "delete from xy where x > 500", @@ -532,7 +532,7 @@ var DoltStatsIOTests = []queries.ScriptTest{ }, { Query: "select count(*) from dolt_statistics group by table_name, index_name", - Expected: []sql.Row{{4}, {4}}, + Expected: []sql.UntypedSqlRow{{4}, {4}}, }, }, }, @@ -549,7 +549,7 @@ var DoltStatsIOTests = []queries.ScriptTest{ Assertions: []queries.ScriptTestAssertion{ { Query: "select count(*) from dolt_statistics group by table_name, index_name", - Expected: []sql.Row{{1}}, + Expected: []sql.UntypedSqlRow{{1}}, }, { Query: "alter table xy modify column x varchar(16);", @@ -565,7 +565,7 @@ var DoltStatsIOTests = []queries.ScriptTest{ }, { Query: "select count(*) from dolt_statistics group by table_name, index_name", - Expected: []sql.Row{{1}}, + Expected: []sql.UntypedSqlRow{{1}}, }, }, }, @@ -581,7 +581,7 @@ var DoltStatsIOTests = []queries.ScriptTest{ Assertions: []queries.ScriptTestAssertion{ { Query: "select count(*) from dolt_statistics group by table_name, index_name", - Expected: []sql.Row{{1}}, + Expected: []sql.UntypedSqlRow{{1}}, }, { Query: "alter table xy drop primary key", @@ -597,7 +597,7 @@ var DoltStatsIOTests = []queries.ScriptTest{ }, { Query: "select count(*) from dolt_statistics group by table_name, index_name", - Expected: []sql.Row{}, + Expected: []sql.UntypedSqlRow{}, }, }, }, @@ -628,14 +628,14 @@ var StatBranchTests = []queries.ScriptTest{ }, { Query: "select table_name, index_name, row_count from dolt_statistics", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {"xy", "primary", uint64(6)}, {"xy", "y", uint64(6)}, }, }, { Query: "select table_name, index_name, row_count from dolt_statistics as of 'feat'", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {"ab", "primary", uint64(6)}, {"ab", "b", uint64(6)}, {"xy", "primary", uint64(6)}, @@ -644,7 +644,7 @@ var StatBranchTests = []queries.ScriptTest{ }, { Query: "select table_name, index_name, row_count from dolt_statistics as of 'main'", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {"xy", "primary", uint64(6)}, {"xy", "y", uint64(6)}, }, @@ -663,7 +663,7 @@ var StatBranchTests = []queries.ScriptTest{ }, { Query: "select table_name, index_name, row_count from dolt_statistics as of 'feat'", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {"ab", "primary", uint64(6)}, {"ab", "b", uint64(6)}, {"xy", "primary", uint64(7)}, @@ -672,7 +672,7 @@ var StatBranchTests = []queries.ScriptTest{ }, { Query: "select table_name, index_name, row_count from dolt_statistics as of 'main'", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {"xy", "primary", uint64(6)}, {"xy", "y", uint64(6)}, }, @@ -691,12 +691,12 @@ var StatBranchTests = []queries.ScriptTest{ }, { Query: "select table_name, index_name, row_count from dolt_statistics as of 'feat'", - Expected: []sql.Row{}, + Expected: []sql.UntypedSqlRow{}, }, { // we dropped 'feat', not 'main' Query: "select table_name, index_name, row_count from dolt_statistics as of 'main'", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {"xy", "primary", uint64(6)}, {"xy", "y", uint64(6)}, }, @@ -713,7 +713,7 @@ var StatBranchTests = []queries.ScriptTest{ Assertions: []queries.ScriptTestAssertion{ { Query: "analyze table xy", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {"xy", "analyze", "status", "OK"}, }, }, @@ -734,14 +734,14 @@ var StatProcTests = []queries.ScriptTest{ }, { Query: "select count(*) from information_schema.column_statistics", - Expected: []sql.Row{{2}}, + Expected: []sql.UntypedSqlRow{{2}}, }, { Query: "call dolt_stats_drop()", }, { Query: "select count(*) from information_schema.column_statistics", - Expected: []sql.Row{{0}}, + Expected: []sql.UntypedSqlRow{{0}}, }, }, }, @@ -756,15 +756,15 @@ var StatProcTests = []queries.ScriptTest{ }, { Query: "select count(*) from dolt_statistics", - Expected: []sql.Row{{0}}, + Expected: []sql.UntypedSqlRow{{0}}, }, { Query: "set @@GLOBAL.dolt_stats_auto_refresh_threshold = 0", - Expected: []sql.Row{{}}, + Expected: []sql.UntypedSqlRow{{}}, }, { Query: "set @@GLOBAL.dolt_stats_auto_refresh_interval = 0", - Expected: []sql.Row{{}}, + Expected: []sql.UntypedSqlRow{{}}, }, { // don't panic @@ -781,7 +781,7 @@ var StatProcTests = []queries.ScriptTest{ }, { Query: "select count(*) from dolt_statistics", - Expected: []sql.Row{{2}}, + Expected: []sql.UntypedSqlRow{{2}}, }, }, }, @@ -794,31 +794,31 @@ var StatProcTests = []queries.ScriptTest{ Assertions: []queries.ScriptTestAssertion{ { Query: "select count(*) from dolt_statistics", - Expected: []sql.Row{{0}}, + Expected: []sql.UntypedSqlRow{{0}}, }, { Query: "call dolt_stats_status()", - Expected: []sql.Row{{"no active stats thread"}}, + Expected: []sql.UntypedSqlRow{{"no active stats thread"}}, }, // set refresh interval arbitrarily high to avoid updating when we restart { Query: "set @@PERSIST.dolt_stats_auto_refresh_interval = 100000;", - Expected: []sql.Row{{}}, + Expected: []sql.UntypedSqlRow{{}}, }, { Query: "set @@PERSIST.dolt_stats_auto_refresh_threshold = 0", - Expected: []sql.Row{{}}, + Expected: []sql.UntypedSqlRow{{}}, }, { Query: "call dolt_stats_restart()", }, { Query: "call dolt_stats_status()", - Expected: []sql.Row{{"restarted thread: mydb"}}, + Expected: []sql.UntypedSqlRow{{"restarted thread: mydb"}}, }, { Query: "set @@PERSIST.dolt_stats_auto_refresh_interval = 0;", - Expected: []sql.Row{{}}, + Expected: []sql.UntypedSqlRow{{}}, }, // new restart picks up 0-interval, will start refreshing immediately { @@ -829,11 +829,11 @@ var StatProcTests = []queries.ScriptTest{ }, { Query: "call dolt_stats_status()", - Expected: []sql.Row{{"refreshed mydb"}}, + Expected: []sql.UntypedSqlRow{{"refreshed mydb"}}, }, { Query: "select count(*) from dolt_statistics", - Expected: []sql.Row{{2}}, + Expected: []sql.UntypedSqlRow{{2}}, }, // kill refresh thread { @@ -841,7 +841,7 @@ var StatProcTests = []queries.ScriptTest{ }, { Query: "call dolt_stats_status()", - Expected: []sql.Row{{"cancelled thread: mydb"}}, + Expected: []sql.UntypedSqlRow{{"cancelled thread: mydb"}}, }, // insert without refresh thread will not update stats { @@ -852,20 +852,20 @@ var StatProcTests = []queries.ScriptTest{ }, { Query: "call dolt_stats_status()", - Expected: []sql.Row{{"cancelled thread: mydb"}}, + Expected: []sql.UntypedSqlRow{{"cancelled thread: mydb"}}, }, // manual analyze will update stats { Query: "analyze table xy", - Expected: []sql.Row{{"xy", "analyze", "status", "OK"}}, + Expected: []sql.UntypedSqlRow{{"xy", "analyze", "status", "OK"}}, }, { Query: "call dolt_stats_status()", - Expected: []sql.Row{{"refreshed mydb"}}, + Expected: []sql.UntypedSqlRow{{"refreshed mydb"}}, }, { Query: "select count(*) from dolt_statistics", - Expected: []sql.Row{{2}}, + Expected: []sql.UntypedSqlRow{{2}}, }, // kill refresh thread and delete stats ref { @@ -873,11 +873,11 @@ var StatProcTests = []queries.ScriptTest{ }, { Query: "call dolt_stats_status()", - Expected: []sql.Row{{"dropped"}}, + Expected: []sql.UntypedSqlRow{{"dropped"}}, }, { Query: "select count(*) from dolt_statistics", - Expected: []sql.Row{{0}}, + Expected: []sql.UntypedSqlRow{{0}}, }, }, }, @@ -892,14 +892,14 @@ var StatProcTests = []queries.ScriptTest{ Assertions: []queries.ScriptTestAssertion{ { Query: "select count(*) as cnt from dolt_statistics group by table_name, index_name order by cnt", - Expected: []sql.Row{{1}, {1}}, + Expected: []sql.UntypedSqlRow{{1}, {1}}, }, { Query: "call dolt_stats_purge()", }, { Query: "select count(*) from dolt_statistics;", - Expected: []sql.Row{{0}}, + Expected: []sql.UntypedSqlRow{{0}}, }, }, }, @@ -914,14 +914,14 @@ var StatProcTests = []queries.ScriptTest{ Assertions: []queries.ScriptTestAssertion{ { Query: "select count(*) as cnt from dolt_statistics group by table_name, index_name order by cnt", - Expected: []sql.Row{{1}, {1}}, + Expected: []sql.UntypedSqlRow{{1}, {1}}, }, { Query: "call dolt_stats_prune()", }, { Query: "select count(*) from dolt_statistics;", - Expected: []sql.Row{{2}}, + Expected: []sql.UntypedSqlRow{{2}}, }, }, }, diff --git a/go/libraries/doltcore/sqle/enginetest/sysbench_test.go b/go/libraries/doltcore/sqle/enginetest/sysbench_test.go index 30d40026b14..48a8c161da8 100644 --- a/go/libraries/doltcore/sqle/enginetest/sysbench_test.go +++ b/go/libraries/doltcore/sqle/enginetest/sysbench_test.go @@ -103,183 +103,183 @@ s_dist_07, s_dist_08, s_dist_09, s_dist_10, s_ytd, s_order_cnt, s_remote_cnt, s_ Assertions: []queries.ScriptTestAssertion{ { Query: "/* client a */ SET SESSION transaction_isolation='REPEATABLE-READ';", - Expected: []sql.Row{{}}, + Expected: []sql.UntypedSqlRow{{}}, }, { Query: "/* client b */ SET SESSION transaction_isolation='REPEATABLE-READ';", - Expected: []sql.Row{{}}, + Expected: []sql.UntypedSqlRow{{}}, }, { Query: "/* client a */ SET FOREIGN_KEY_CHECKS=0;", - Expected: []sql.Row{{}}, + Expected: []sql.UntypedSqlRow{{}}, }, { Query: "/* client b */ SET FOREIGN_KEY_CHECKS=0;", - Expected: []sql.Row{{}}, + Expected: []sql.UntypedSqlRow{{}}, }, { Query: "/* client a */ SET autocommit=0;", - Expected: []sql.Row{{}}, + Expected: []sql.UntypedSqlRow{{}}, }, { Query: "/* client b */ SET autocommit=0;", - Expected: []sql.Row{{}}, + Expected: []sql.UntypedSqlRow{{}}, }, { Query: "/* client a */ BEGIN;", - Expected: []sql.Row{}, + Expected: []sql.UntypedSqlRow{}, }, { Query: "/* client b */ BEGIN;", - Expected: []sql.Row{}, + Expected: []sql.UntypedSqlRow{}, }, { Query: "/* client a */ SELECT * FROM dolt_constraint_violations;", - Expected: []sql.Row{}, + Expected: []sql.UntypedSqlRow{}, }, { Query: "/* client b */ SELECT * FROM dolt_constraint_violations;", - Expected: []sql.Row{}, + Expected: []sql.UntypedSqlRow{}, }, { Query: "/* client a */ UPDATE warehouse1 SET w_ytd = w_ytd + 622 WHERE w_id = 1;", - Expected: []sql.Row{{types.OkResult{RowsAffected: 1, Info: plan.UpdateInfo{Matched: 1, Updated: 1}}}}, + Expected: []sql.UntypedSqlRow{{types.OkResult{RowsAffected: 1, Info: plan.UpdateInfo{Matched: 1, Updated: 1}}}}, }, { Query: "/* client a */ UPDATE district1 SET d_ytd = d_ytd + 622 WHERE d_w_id = 1 AND d_id= 10;", - Expected: []sql.Row{{types.OkResult{RowsAffected: 1, Info: plan.UpdateInfo{Matched: 1, Updated: 1}}}}, + Expected: []sql.UntypedSqlRow{{types.OkResult{RowsAffected: 1, Info: plan.UpdateInfo{Matched: 1, Updated: 1}}}}, }, { Query: "/* client a */ UPDATE customer1 SET c_balance=-632.000000, c_ytd_payment=632.000000 WHERE c_w_id = 1 AND c_d_id=1 AND c_id=2786;", - Expected: []sql.Row{{types.OkResult{RowsAffected: 1, Info: plan.UpdateInfo{Matched: 1, Updated: 1}}}}, + Expected: []sql.UntypedSqlRow{{types.OkResult{RowsAffected: 1, Info: plan.UpdateInfo{Matched: 1, Updated: 1}}}}, }, { Query: "/* client b */ UPDATE district1 SET d_next_o_id = 3002 WHERE d_id = 7 AND d_w_id= 1;", - Expected: []sql.Row{{types.OkResult{RowsAffected: 1, Info: plan.UpdateInfo{Matched: 1, Updated: 1}}}}, + Expected: []sql.UntypedSqlRow{{types.OkResult{RowsAffected: 1, Info: plan.UpdateInfo{Matched: 1, Updated: 1}}}}, }, { Query: "/* client b */ INSERT INTO orders1 (o_id, o_d_id, o_w_id, o_c_id, o_entry_d, o_ol_cnt, o_all_local) VALUES (3001,7,1,2561,NOW(),12,1);", - Expected: []sql.Row{{types.OkResult{RowsAffected: 1}}}, + Expected: []sql.UntypedSqlRow{{types.OkResult{RowsAffected: 1}}}, }, { Query: "/* client a */ INSERT INTO history1 (h_c_d_id, h_c_w_id, h_c_id, h_d_id, h_w_id, h_date, h_amount, h_data) VALUES (1,1,2786,10,1,NOW(),622,'name-zcsld name-mmsod ');", - Expected: []sql.Row{{types.OkResult{RowsAffected: 1}}}, + Expected: []sql.UntypedSqlRow{{types.OkResult{RowsAffected: 1}}}, }, { Query: "/* client a */ COMMIT;", - Expected: []sql.Row{}, + Expected: []sql.UntypedSqlRow{}, }, { Query: "/* client b */ INSERT INTO new_orders1 (no_o_id, no_d_id, no_w_id) VALUES (3001,7,1);", - Expected: []sql.Row{{types.OkResult{RowsAffected: 1}}}, + Expected: []sql.UntypedSqlRow{{types.OkResult{RowsAffected: 1}}}, }, { Query: "/* client b */ UPDATE stock1 SET s_quantity = 65 WHERE s_i_id = 42365 AND s_w_id= 1;", - Expected: []sql.Row{{types.OkResult{RowsAffected: 1, Info: plan.UpdateInfo{Matched: 1, Updated: 1}}}}, + Expected: []sql.UntypedSqlRow{{types.OkResult{RowsAffected: 1, Info: plan.UpdateInfo{Matched: 1, Updated: 1}}}}, }, { Query: "/* client b */ INSERT INTO order_line1 (ol_o_id, ol_d_id, ol_w_id, ol_number, ol_i_id, ol_supply_w_id, ol_quantity, ol_amount, ol_dist_info) VALUES (3001,7,1,1,42365,1,1,7,'xxxxxxxxxxxxxxxxxxxxxxxx');", - Expected: []sql.Row{{types.OkResult{RowsAffected: 1}}}, + Expected: []sql.UntypedSqlRow{{types.OkResult{RowsAffected: 1}}}, }, { Query: "/* client b */ UPDATE stock1 SET s_quantity = 53 WHERE s_i_id = 84125 AND s_w_id= 1;", - Expected: []sql.Row{{types.OkResult{RowsAffected: 1, Info: plan.UpdateInfo{Matched: 1, Updated: 1}}}}, + Expected: []sql.UntypedSqlRow{{types.OkResult{RowsAffected: 1, Info: plan.UpdateInfo{Matched: 1, Updated: 1}}}}, }, { Query: "/* client b */ INSERT INTO order_line1 (ol_o_id, ol_d_id, ol_w_id, ol_number, ol_i_id, ol_supply_w_id, ol_quantity, ol_amount, ol_dist_info) VALUES (3001,7,1,2,84125,1,6,232,'nnnnnnnnnnnnnnnnnnnnnnnn');", - Expected: []sql.Row{{types.OkResult{RowsAffected: 1}}}, + Expected: []sql.UntypedSqlRow{{types.OkResult{RowsAffected: 1}}}, }, { Query: "/* client b */ UPDATE stock1 SET s_quantity = 24 WHERE s_i_id = 29168 AND s_w_id= 1;", - Expected: []sql.Row{{types.OkResult{RowsAffected: 1, Info: plan.UpdateInfo{Matched: 1, Updated: 1}}}}, + Expected: []sql.UntypedSqlRow{{types.OkResult{RowsAffected: 1, Info: plan.UpdateInfo{Matched: 1, Updated: 1}}}}, }, { Query: "/* client b */ INSERT INTO order_line1 (ol_o_id, ol_d_id, ol_w_id, ol_number, ol_i_id, ol_supply_w_id, ol_quantity, ol_amount, ol_dist_info) VALUES (3001,7,1,3,29168,1,8,372,'mmmmmmmmmmmmmmmmmmmmmmmm');", - Expected: []sql.Row{{types.OkResult{RowsAffected: 1}}}, + Expected: []sql.UntypedSqlRow{{types.OkResult{RowsAffected: 1}}}, }, { Query: "/* client b */ UPDATE stock1 SET s_quantity = 31 WHERE s_i_id = 70752 AND s_w_id= 1;", - Expected: []sql.Row{{types.OkResult{RowsAffected: 1, Info: plan.UpdateInfo{Matched: 1, Updated: 1}}}}, + Expected: []sql.UntypedSqlRow{{types.OkResult{RowsAffected: 1, Info: plan.UpdateInfo{Matched: 1, Updated: 1}}}}, }, { Query: "/* client b */ INSERT INTO order_line1 (ol_o_id, ol_d_id, ol_w_id, ol_number, ol_i_id, ol_supply_w_id, ol_quantity, ol_amount, ol_dist_info) VALUES (3001,7,1,4,70752,1,8,491,'llllllllllllllllllllllll');", - Expected: []sql.Row{{types.OkResult{RowsAffected: 1}}}, + Expected: []sql.UntypedSqlRow{{types.OkResult{RowsAffected: 1}}}, }, { Query: "/* client b */ UPDATE stock1 SET s_quantity = 52 WHERE s_i_id = 3115 AND s_w_id= 1;", - Expected: []sql.Row{{types.OkResult{RowsAffected: 1, Info: plan.UpdateInfo{Matched: 1, Updated: 1}}}}, + Expected: []sql.UntypedSqlRow{{types.OkResult{RowsAffected: 1, Info: plan.UpdateInfo{Matched: 1, Updated: 1}}}}, }, { Query: "/* client b */ INSERT INTO order_line1 (ol_o_id, ol_d_id, ol_w_id, ol_number, ol_i_id, ol_supply_w_id, ol_quantity, ol_amount, ol_dist_info) VALUES (3001,7,1,5,3115,1,8,60,'tttttttttttttttttttttttt');", - Expected: []sql.Row{{types.OkResult{RowsAffected: 1}}}, + Expected: []sql.UntypedSqlRow{{types.OkResult{RowsAffected: 1}}}, }, { Query: "/* client b */ UPDATE stock1 SET s_quantity = 58 WHERE s_i_id = 60995 AND s_w_id= 1;", - Expected: []sql.Row{{types.OkResult{RowsAffected: 1, Info: plan.UpdateInfo{Matched: 1, Updated: 1}}}}, + Expected: []sql.UntypedSqlRow{{types.OkResult{RowsAffected: 1, Info: plan.UpdateInfo{Matched: 1, Updated: 1}}}}, }, { Query: "/* client b */ INSERT INTO order_line1 (ol_o_id, ol_d_id, ol_w_id, ol_number, ol_i_id, ol_supply_w_id, ol_quantity, ol_amount, ol_dist_info) VALUES (3001,7,1,6,60995,1,9,334,'qqqqqqqqqqqqqqqqqqqqqqqq');", - Expected: []sql.Row{{types.OkResult{RowsAffected: 1}}}, + Expected: []sql.UntypedSqlRow{{types.OkResult{RowsAffected: 1}}}, }, { Query: "/* client b */ UPDATE stock1 SET s_quantity = 23 WHERE s_i_id = 87468 AND s_w_id= 1;", - Expected: []sql.Row{{types.OkResult{RowsAffected: 1, Info: plan.UpdateInfo{Matched: 1, Updated: 1}}}}, + Expected: []sql.UntypedSqlRow{{types.OkResult{RowsAffected: 1, Info: plan.UpdateInfo{Matched: 1, Updated: 1}}}}, }, { Query: "/* client b */ INSERT INTO order_line1 (ol_o_id, ol_d_id, ol_w_id, ol_number, ol_i_id, ol_supply_w_id, ol_quantity, ol_amount, ol_dist_info) VALUES (3001,7,1,7,87468,1,6,224,'gggggggggggggggggggggggg');", - Expected: []sql.Row{{types.OkResult{RowsAffected: 1}}}, + Expected: []sql.UntypedSqlRow{{types.OkResult{RowsAffected: 1}}}, }, { Query: "/* client b */ UPDATE stock1 SET s_quantity = 45 WHERE s_i_id = 26507 AND s_w_id= 1;", - Expected: []sql.Row{{types.OkResult{RowsAffected: 1, Info: plan.UpdateInfo{Matched: 1, Updated: 1}}}}, + Expected: []sql.UntypedSqlRow{{types.OkResult{RowsAffected: 1, Info: plan.UpdateInfo{Matched: 1, Updated: 1}}}}, }, { Query: "/* client b */ INSERT INTO order_line1 (ol_o_id, ol_d_id, ol_w_id, ol_number, ol_i_id, ol_supply_w_id, ol_quantity, ol_amount, ol_dist_info) VALUES (3001,7,1,8,26507,1,7,231,'zzzzzzzzzzzzzzzzzzzzzzzz');", - Expected: []sql.Row{{types.OkResult{RowsAffected: 1}}}, + Expected: []sql.UntypedSqlRow{{types.OkResult{RowsAffected: 1}}}, }, { Query: "/* client b */ UPDATE stock1 SET s_quantity = 61 WHERE s_i_id = 38702 AND s_w_id= 1;", - Expected: []sql.Row{{types.OkResult{RowsAffected: 1, Info: plan.UpdateInfo{Matched: 1, Updated: 1}}}}, + Expected: []sql.UntypedSqlRow{{types.OkResult{RowsAffected: 1, Info: plan.UpdateInfo{Matched: 1, Updated: 1}}}}, }, { Query: "/* client b */ INSERT INTO order_line1 (ol_o_id, ol_d_id, ol_w_id, ol_number, ol_i_id, ol_supply_w_id, ol_quantity, ol_amount, ol_dist_info) VALUES (3001,7,1,9,38702,1,6,300,'xxxxxxxxxxxxxxxxxxxxxxxx');", - Expected: []sql.Row{{types.OkResult{RowsAffected: 1}}}, + Expected: []sql.UntypedSqlRow{{types.OkResult{RowsAffected: 1}}}, }, { Query: "/* client b */ UPDATE stock1 SET s_quantity = 38 WHERE s_i_id = 39823 AND s_w_id= 1;", - Expected: []sql.Row{{types.OkResult{RowsAffected: 1, Info: plan.UpdateInfo{Matched: 1, Updated: 1}}}}, + Expected: []sql.UntypedSqlRow{{types.OkResult{RowsAffected: 1, Info: plan.UpdateInfo{Matched: 1, Updated: 1}}}}, }, { Query: "/* client b */ INSERT INTO order_line1 (ol_o_id, ol_d_id, ol_w_id, ol_number, ol_i_id, ol_supply_w_id, ol_quantity, ol_amount, ol_dist_info) VALUES (3001,7,1,10,39823,1,5,167,'mmmmmmmmmmmmmmmmmmmmmmmm');", - Expected: []sql.Row{{types.OkResult{RowsAffected: 1}}}, + Expected: []sql.UntypedSqlRow{{types.OkResult{RowsAffected: 1}}}, }, { Query: "/* client b */ UPDATE stock1 SET s_quantity = 62 WHERE s_i_id = 53534 AND s_w_id= 1;", - Expected: []sql.Row{{types.OkResult{RowsAffected: 1, Info: plan.UpdateInfo{Matched: 1, Updated: 1}}}}, + Expected: []sql.UntypedSqlRow{{types.OkResult{RowsAffected: 1, Info: plan.UpdateInfo{Matched: 1, Updated: 1}}}}, }, { Query: "/* client b */ INSERT INTO order_line1 (ol_o_id, ol_d_id, ol_w_id, ol_number, ol_i_id, ol_supply_w_id, ol_quantity, ol_amount, ol_dist_info) VALUES (3001,7,1,11,53534,1,7,380,'pppppppppppppppppppppppp');", - Expected: []sql.Row{{types.OkResult{RowsAffected: 1}}}, + Expected: []sql.UntypedSqlRow{{types.OkResult{RowsAffected: 1}}}, }, { Query: "/* client b */ UPDATE stock1 SET s_quantity = 61 WHERE s_i_id = 62631 AND s_w_id= 1;", - Expected: []sql.Row{{types.OkResult{RowsAffected: 1, Info: plan.UpdateInfo{Matched: 1, Updated: 1}}}}, + Expected: []sql.UntypedSqlRow{{types.OkResult{RowsAffected: 1, Info: plan.UpdateInfo{Matched: 1, Updated: 1}}}}, }, { Query: "/* client b */ INSERT INTO order_line1 (ol_o_id, ol_d_id, ol_w_id, ol_number, ol_i_id, ol_supply_w_id, ol_quantity, ol_amount, ol_dist_info) VALUES (3001,7,1,12,62631,1,6,171,'gggggggggggggggggggggggg');", - Expected: []sql.Row{{types.OkResult{RowsAffected: 1}}}, + Expected: []sql.UntypedSqlRow{{types.OkResult{RowsAffected: 1}}}, }, { Query: "/* client b */ COMMIT;", - Expected: []sql.Row{}, + Expected: []sql.UntypedSqlRow{}, }, { Query: "/* client a */ SELECT * FROM dolt_constraint_violations;", - Expected: []sql.Row{}, + Expected: []sql.UntypedSqlRow{}, }, { Query: "/* client b */ SELECT * FROM dolt_constraint_violations;", - Expected: []sql.Row{}, + Expected: []sql.UntypedSqlRow{}, }, }, }) diff --git a/go/libraries/doltcore/sqle/enginetest/system_table_function_index_tests.go b/go/libraries/doltcore/sqle/enginetest/system_table_function_index_tests.go index 19c8fe91a00..bc97ac2e048 100644 --- a/go/libraries/doltcore/sqle/enginetest/system_table_function_index_tests.go +++ b/go/libraries/doltcore/sqle/enginetest/system_table_function_index_tests.go @@ -35,21 +35,21 @@ var SystemTableFunctionIndexTests = []queries.ScriptTest{ Assertions: []queries.ScriptTestAssertion{ { Query: "SELECT table_name, diff_type, statement from dolt_patch(@Commit0, @Commit1, 't') WHERE diff_type = 'schema';", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {"t", "schema", "CREATE TABLE `t` (\n `pk` int NOT NULL,\n `c1` varchar(20),\n `c2` varchar(20),\n PRIMARY KEY (`pk`)\n) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_bin;"}, }, ExpectedIndexes: []string{"diff_type"}, }, { Query: "SELECT table_name, diff_type, statement from dolt_patch(@Commit0, @Commit1, 't') WHERE diff_type = 'data';", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {"t", "data", "INSERT INTO `t` (`pk`,`c1`,`c2`) VALUES (1,'one','two');"}, }, ExpectedIndexes: []string{"diff_type"}, }, { Query: "SELECT /*+ JOIN_ORDER(diff_type_name,dolt_patch) LOOKUP_JOIN(diff_type_name,dolt_patch) */ name, t, table_name, statement from diff_type_name join dolt_patch(@Commit0, @Commit1, 't') on diff_type_name.t = diff_type;", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {"s", "schema", "t", "CREATE TABLE `t` (\n `pk` int NOT NULL,\n `c1` varchar(20),\n `c2` varchar(20),\n PRIMARY KEY (`pk`)\n) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_bin;"}, {"d", "data", "t", "INSERT INTO `t` (`pk`,`c1`,`c2`) VALUES (1,'one','two');"}, }, @@ -57,7 +57,7 @@ var SystemTableFunctionIndexTests = []queries.ScriptTest{ }, { Query: "SELECT ( SELECT statement FROM (SELECT * FROM dolt_patch(@Commit0, @Commit1, 't') where diff_type = diff_type_name.t) as rhs) from diff_type_name;", - Expected: []sql.Row{ + Expected: []sql.UntypedSqlRow{ {"CREATE TABLE `t` (\n `pk` int NOT NULL,\n `c1` varchar(20),\n `c2` varchar(20),\n PRIMARY KEY (`pk`)\n) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_bin;"}, {"INSERT INTO `t` (`pk`,`c1`,`c2`) VALUES (1,'one','two');"}, }, diff --git a/go/libraries/doltcore/sqle/history_table.go b/go/libraries/doltcore/sqle/history_table.go index 115532e63c5..d2b55729c16 100644 --- a/go/libraries/doltcore/sqle/history_table.go +++ b/go/libraries/doltcore/sqle/history_table.go @@ -272,7 +272,7 @@ func commitFilterForExprs(ctx *sql.Context, filters []sql.Expression) (doltdb.Co } sc := sql.NewContext(ctx) - r := sql.Row{h.String(), meta.Name, meta.Time()} + r := sql.UntypedSqlRow{h.String(), meta.Name, meta.Time()} for _, filter := range filters { res, err := filter.Eval(sc, r) @@ -608,18 +608,18 @@ func (ht *HistoryTable) rowConverter(ctx *sql.Context, srcSchema, targetSchema s } return func(row sql.Row) sql.Row { - r := make(sql.Row, len(projections)) + r := make(sql.UntypedSqlRow, len(projections)) for i, t := range projections { switch t { case schema.HistoryCommitterTag: - r[i] = meta.Name + r.SetValue(i, meta.Name) case schema.HistoryCommitDateTag: - r[i] = meta.Time() + r.SetValue(i, meta.Time()) case schema.HistoryCommitHashTag: - r[i] = h.String() + r.SetValue(i, h.String()) default: if j, ok := srcToTarget[i]; ok { - r[j] = row[i] + r.SetValue(j, row.GetValue(i)) } } } diff --git a/go/libraries/doltcore/sqle/index/dolt_index_test.go b/go/libraries/doltcore/sqle/index/dolt_index_test.go index 044bf946fba..5de6aa161f0 100644 --- a/go/libraries/doltcore/sqle/index/dolt_index_test.go +++ b/go/libraries/doltcore/sqle/index/dolt_index_test.go @@ -51,14 +51,14 @@ const ( type doltIndexTestCase struct { indexName string keys []interface{} - expectedRows []sql.Row + expectedRows []sql.UntypedSqlRow } type doltIndexBetweenTestCase struct { indexName string greaterThanOrEqual []interface{} lessThanOrEqual []interface{} - expectedRows []sql.Row + expectedRows []sql.UntypedSqlRow } var typesTests = []struct { @@ -174,11 +174,11 @@ var typesTests = []struct { } var ( - typesTableRow1 = sql.Row{int32(-3), uint64(1), mustTime("2020-05-14 12:00:00"), mustDecimal("-3.30000"), uint16(2), -3.3, uint64(1), types.Timespan(-183000000), "a", int16(1980)} - typesTableRow2 = sql.Row{int32(-1), uint64(2), mustTime("2020-05-14 12:00:01"), mustDecimal("-1.10000"), uint16(3), -1.1, uint64(3), types.Timespan(-61000000), "b", int16(1990)} - typesTableRow3 = sql.Row{int32(0), uint64(3), mustTime("2020-05-14 12:00:02"), mustDecimal("0.00000"), uint16(4), 0.0, uint64(4), types.Timespan(0), "c", int16(2000)} - typesTableRow4 = sql.Row{int32(1), uint64(4), mustTime("2020-05-14 12:00:03"), mustDecimal("1.10000"), uint16(5), 1.1, uint64(5), types.Timespan(61000000), "d", int16(2010)} - typesTableRow5 = sql.Row{int32(3), uint64(5), mustTime("2020-05-14 12:00:04"), mustDecimal("3.30000"), uint16(6), 3.3, uint64(6), types.Timespan(183000000), "e", int16(2020)} + typesTableRow1 = sql.UntypedSqlRow{int32(-3), uint64(1), mustTime("2020-05-14 12:00:00"), mustDecimal("-3.30000"), uint16(2), -3.3, uint64(1), types.Timespan(-183000000), "a", int16(1980)} + typesTableRow2 = sql.UntypedSqlRow{int32(-1), uint64(2), mustTime("2020-05-14 12:00:01"), mustDecimal("-1.10000"), uint16(3), -1.1, uint64(3), types.Timespan(-61000000), "b", int16(1990)} + typesTableRow3 = sql.UntypedSqlRow{int32(0), uint64(3), mustTime("2020-05-14 12:00:02"), mustDecimal("0.00000"), uint16(4), 0.0, uint64(4), types.Timespan(0), "c", int16(2000)} + typesTableRow4 = sql.UntypedSqlRow{int32(1), uint64(4), mustTime("2020-05-14 12:00:03"), mustDecimal("1.10000"), uint16(5), 1.1, uint64(5), types.Timespan(61000000), "d", int16(2010)} + typesTableRow5 = sql.UntypedSqlRow{int32(3), uint64(5), mustTime("2020-05-14 12:00:04"), mustDecimal("3.30000"), uint16(6), 3.3, uint64(6), types.Timespan(183000000), "e", int16(2020)} ) func TestDoltIndexEqual(t *testing.T) { @@ -188,12 +188,12 @@ func TestDoltIndexEqual(t *testing.T) { { "onepk:primaryKey", []interface{}{1}, - []sql.Row{{1, 1, 1}}, + []sql.UntypedSqlRow{{1, 1, 1}}, }, { "onepk:primaryKey", []interface{}{3}, - []sql.Row{{3, 3, 3}}, + []sql.UntypedSqlRow{{3, 3, 3}}, }, { "onepk:primaryKey", @@ -208,17 +208,17 @@ func TestDoltIndexEqual(t *testing.T) { { "onepk:idx_v1", []interface{}{1}, - []sql.Row{{1, 1, 1}, {2, 1, 2}}, + []sql.UntypedSqlRow{{1, 1, 1}, {2, 1, 2}}, }, { "onepk:idx_v1", []interface{}{3}, - []sql.Row{{3, 3, 3}}, + []sql.UntypedSqlRow{{3, 3, 3}}, }, { "twopk:primaryKey", []interface{}{1, 1}, - []sql.Row{{1, 1, 3, 3}}, + []sql.UntypedSqlRow{{1, 1, 3, 3}}, }, { "twopk:primaryKey", @@ -228,27 +228,27 @@ func TestDoltIndexEqual(t *testing.T) { { "twopk:primaryKey", []interface{}{2, 1}, - []sql.Row{{2, 1, 4, 4}}, + []sql.UntypedSqlRow{{2, 1, 4, 4}}, }, { "twopk:idx_v2v1", []interface{}{3, 4}, - []sql.Row{{2, 2, 4, 3}}, + []sql.UntypedSqlRow{{2, 2, 4, 3}}, }, { "twopk:idx_v2v1", []interface{}{4, 3}, - []sql.Row{{1, 2, 3, 4}}, + []sql.UntypedSqlRow{{1, 2, 3, 4}}, }, //{ // "twopk:idx_v2v1_PARTIAL_1", // []interface{}{3}, - // []sql.Row{{1, 1, 3, 3}, {2, 2, 4, 3}}, + // []sql.UntypedSqlRow{{1, 1, 3, 3}, {2, 2, 4, 3}}, //}, //{ // "twopk:idx_v2v1_PARTIAL_1", // []interface{}{4}, - // []sql.Row{{1, 2, 3, 4}, {2, 1, 4, 4}}, + // []sql.UntypedSqlRow{{1, 2, 3, 4}, {2, 1, 4, 4}}, //}, } @@ -260,31 +260,31 @@ func TestDoltIndexEqual(t *testing.T) { }, doltIndexTestCase{ typesTest.indexName, typesTest.firstValue, - []sql.Row{ + []sql.UntypedSqlRow{ typesTableRow1, }, }, doltIndexTestCase{ typesTest.indexName, typesTest.secondValue, - []sql.Row{ + []sql.UntypedSqlRow{ typesTableRow2, }, }, doltIndexTestCase{ typesTest.indexName, typesTest.thirdValue, - []sql.Row{ + []sql.UntypedSqlRow{ typesTableRow3, }, }, doltIndexTestCase{ typesTest.indexName, typesTest.fourthValue, - []sql.Row{ + []sql.UntypedSqlRow{ typesTableRow4, }, }, doltIndexTestCase{ typesTest.indexName, typesTest.fifthValue, - []sql.Row{ + []sql.UntypedSqlRow{ typesTableRow5, }, }, doltIndexTestCase{ @@ -310,17 +310,17 @@ func TestDoltIndexGreaterThan(t *testing.T) { tests := []struct { indexName string keys []interface{} - expectedRows []sql.Row + expectedRows []sql.UntypedSqlRow }{ { "onepk:primaryKey", []interface{}{1}, - []sql.Row{{2, 1, 2}, {3, 3, 3}, {4, 4, 3}}, + []sql.UntypedSqlRow{{2, 1, 2}, {3, 3, 3}, {4, 4, 3}}, }, { "onepk:primaryKey", []interface{}{3}, - []sql.Row{{4, 4, 3}}, + []sql.UntypedSqlRow{{4, 4, 3}}, }, { "onepk:primaryKey", @@ -330,12 +330,12 @@ func TestDoltIndexGreaterThan(t *testing.T) { { "onepk:idx_v1", []interface{}{1}, - []sql.Row{{3, 3, 3}, {4, 4, 3}}, + []sql.UntypedSqlRow{{3, 3, 3}, {4, 4, 3}}, }, { "onepk:idx_v1", []interface{}{3}, - []sql.Row{{4, 4, 3}}, + []sql.UntypedSqlRow{{4, 4, 3}}, }, { "onepk:idx_v1", @@ -345,7 +345,7 @@ func TestDoltIndexGreaterThan(t *testing.T) { { "twopk:primaryKey", []interface{}{1, 1}, - []sql.Row{{2, 2, 4, 3}}, + []sql.UntypedSqlRow{{2, 2, 4, 3}}, }, { "twopk:primaryKey", @@ -355,12 +355,12 @@ func TestDoltIndexGreaterThan(t *testing.T) { { "twopk:idx_v2v1", []interface{}{2, 3}, - []sql.Row{{2, 1, 4, 4}, {2, 2, 4, 3}}, + []sql.UntypedSqlRow{{2, 1, 4, 4}, {2, 2, 4, 3}}, }, { "twopk:idx_v2v1", []interface{}{3, 3}, - []sql.Row{{2, 1, 4, 4}}, + []sql.UntypedSqlRow{{2, 1, 4, 4}}, }, { "twopk:idx_v2v1", @@ -375,7 +375,7 @@ func TestDoltIndexGreaterThan(t *testing.T) { //{ // "twopk:idx_v2v1_PARTIAL_1", // []interface{}{3}, - // []sql.Row{{1, 2, 3, 4}, {2, 1, 4, 4}}, + // []sql.UntypedSqlRow{{1, 2, 3, 4}, {2, 1, 4, 4}}, //}, //{ // "twopk:idx_v2v1_PARTIAL_1", @@ -388,7 +388,7 @@ func TestDoltIndexGreaterThan(t *testing.T) { tests = append(tests, doltIndexTestCase{ typesTest.indexName, typesTest.belowfirstValue, - []sql.Row{ + []sql.UntypedSqlRow{ typesTableRow1, typesTableRow2, typesTableRow3, @@ -398,7 +398,7 @@ func TestDoltIndexGreaterThan(t *testing.T) { }, doltIndexTestCase{ typesTest.indexName, typesTest.firstValue, - []sql.Row{ + []sql.UntypedSqlRow{ typesTableRow2, typesTableRow3, typesTableRow4, @@ -407,7 +407,7 @@ func TestDoltIndexGreaterThan(t *testing.T) { }, doltIndexTestCase{ typesTest.indexName, typesTest.secondValue, - []sql.Row{ + []sql.UntypedSqlRow{ typesTableRow3, typesTableRow4, typesTableRow5, @@ -415,14 +415,14 @@ func TestDoltIndexGreaterThan(t *testing.T) { }, doltIndexTestCase{ typesTest.indexName, typesTest.thirdValue, - []sql.Row{ + []sql.UntypedSqlRow{ typesTableRow4, typesTableRow5, }, }, doltIndexTestCase{ typesTest.indexName, typesTest.fourthValue, - []sql.Row{ + []sql.UntypedSqlRow{ typesTableRow5, }, }, doltIndexTestCase{ @@ -452,67 +452,67 @@ func TestDoltIndexGreaterThanOrEqual(t *testing.T) { tests := []struct { indexName string keys []interface{} - expectedRows []sql.Row + expectedRows []sql.UntypedSqlRow }{ { "onepk:primaryKey", []interface{}{1}, - []sql.Row{{1, 1, 1}, {2, 1, 2}, {3, 3, 3}, {4, 4, 3}}, + []sql.UntypedSqlRow{{1, 1, 1}, {2, 1, 2}, {3, 3, 3}, {4, 4, 3}}, }, { "onepk:primaryKey", []interface{}{3}, - []sql.Row{{3, 3, 3}, {4, 4, 3}}, + []sql.UntypedSqlRow{{3, 3, 3}, {4, 4, 3}}, }, { "onepk:primaryKey", []interface{}{4}, - []sql.Row{{4, 4, 3}}, + []sql.UntypedSqlRow{{4, 4, 3}}, }, { "onepk:idx_v1", []interface{}{1}, - []sql.Row{{1, 1, 1}, {2, 1, 2}, {3, 3, 3}, {4, 4, 3}}, + []sql.UntypedSqlRow{{1, 1, 1}, {2, 1, 2}, {3, 3, 3}, {4, 4, 3}}, }, { "onepk:idx_v1", []interface{}{3}, - []sql.Row{{3, 3, 3}, {4, 4, 3}}, + []sql.UntypedSqlRow{{3, 3, 3}, {4, 4, 3}}, }, { "onepk:idx_v1", []interface{}{4}, - []sql.Row{{4, 4, 3}}, + []sql.UntypedSqlRow{{4, 4, 3}}, }, { "twopk:primaryKey", []interface{}{1, 1}, - []sql.Row{{1, 1, 3, 3}, {1, 2, 3, 4}, {2, 1, 4, 4}, {2, 2, 4, 3}}, + []sql.UntypedSqlRow{{1, 1, 3, 3}, {1, 2, 3, 4}, {2, 1, 4, 4}, {2, 2, 4, 3}}, }, { "twopk:primaryKey", []interface{}{2, 1}, - []sql.Row{{2, 1, 4, 4}, {2, 2, 4, 3}}, + []sql.UntypedSqlRow{{2, 1, 4, 4}, {2, 2, 4, 3}}, }, { "twopk:idx_v2v1", []interface{}{3, 4}, - []sql.Row{{2, 1, 4, 4}, {2, 2, 4, 3}}, + []sql.UntypedSqlRow{{2, 1, 4, 4}, {2, 2, 4, 3}}, }, { "twopk:idx_v2v1", []interface{}{4, 3}, - []sql.Row{{1, 2, 3, 4}, {2, 1, 4, 4}}, + []sql.UntypedSqlRow{{1, 2, 3, 4}, {2, 1, 4, 4}}, }, //{ // "twopk:idx_v2v1_PARTIAL_1", // []interface{}{3}, - // []sql.Row{{1, 1, 3, 3}, {1, 2, 3, 4}, {2, 1, 4, 4}, {2, 2, 4, 3}}, + // []sql.UntypedSqlRow{{1, 1, 3, 3}, {1, 2, 3, 4}, {2, 1, 4, 4}, {2, 2, 4, 3}}, //}, //{ // "twopk:idx_v2v1_PARTIAL_1", // []interface{}{4}, - // []sql.Row{{1, 2, 3, 4}, {2, 1, 4, 4}}, + // []sql.UntypedSqlRow{{1, 2, 3, 4}, {2, 1, 4, 4}}, //}, } @@ -520,7 +520,7 @@ func TestDoltIndexGreaterThanOrEqual(t *testing.T) { tests = append(tests, doltIndexTestCase{ typesTest.indexName, typesTest.belowfirstValue, - []sql.Row{ + []sql.UntypedSqlRow{ typesTableRow1, typesTableRow2, typesTableRow3, @@ -530,7 +530,7 @@ func TestDoltIndexGreaterThanOrEqual(t *testing.T) { }, doltIndexTestCase{ typesTest.indexName, typesTest.firstValue, - []sql.Row{ + []sql.UntypedSqlRow{ typesTableRow1, typesTableRow2, typesTableRow3, @@ -540,7 +540,7 @@ func TestDoltIndexGreaterThanOrEqual(t *testing.T) { }, doltIndexTestCase{ typesTest.indexName, typesTest.secondValue, - []sql.Row{ + []sql.UntypedSqlRow{ typesTableRow2, typesTableRow3, typesTableRow4, @@ -549,7 +549,7 @@ func TestDoltIndexGreaterThanOrEqual(t *testing.T) { }, doltIndexTestCase{ typesTest.indexName, typesTest.thirdValue, - []sql.Row{ + []sql.UntypedSqlRow{ typesTableRow3, typesTableRow4, typesTableRow5, @@ -557,14 +557,14 @@ func TestDoltIndexGreaterThanOrEqual(t *testing.T) { }, doltIndexTestCase{ typesTest.indexName, typesTest.fourthValue, - []sql.Row{ + []sql.UntypedSqlRow{ typesTableRow4, typesTableRow5, }, }, doltIndexTestCase{ typesTest.indexName, typesTest.fifthValue, - []sql.Row{ + []sql.UntypedSqlRow{ typesTableRow5, }, }, doltIndexTestCase{ @@ -590,7 +590,7 @@ func TestDoltIndexLessThan(t *testing.T) { tests := []struct { indexName string keys []interface{} - expectedRows []sql.Row + expectedRows []sql.UntypedSqlRow }{ { "onepk:primaryKey", @@ -600,12 +600,12 @@ func TestDoltIndexLessThan(t *testing.T) { { "onepk:primaryKey", []interface{}{3}, - []sql.Row{{2, 1, 2}, {1, 1, 1}}, + []sql.UntypedSqlRow{{2, 1, 2}, {1, 1, 1}}, }, { "onepk:primaryKey", []interface{}{4}, - []sql.Row{{3, 3, 3}, {2, 1, 2}, {1, 1, 1}}, + []sql.UntypedSqlRow{{3, 3, 3}, {2, 1, 2}, {1, 1, 1}}, }, { "onepk:idx_v1", @@ -615,12 +615,12 @@ func TestDoltIndexLessThan(t *testing.T) { { "onepk:idx_v1", []interface{}{3}, - []sql.Row{{2, 1, 2}, {1, 1, 1}}, + []sql.UntypedSqlRow{{2, 1, 2}, {1, 1, 1}}, }, { "onepk:idx_v1", []interface{}{4}, - []sql.Row{{3, 3, 3}, {2, 1, 2}, {1, 1, 1}}, + []sql.UntypedSqlRow{{3, 3, 3}, {2, 1, 2}, {1, 1, 1}}, }, { "twopk:primaryKey", @@ -635,12 +635,12 @@ func TestDoltIndexLessThan(t *testing.T) { { "twopk:primaryKey", []interface{}{2, 2}, - []sql.Row{{1, 1, 3, 3}}, + []sql.UntypedSqlRow{{1, 1, 3, 3}}, }, { "twopk:primaryKey", []interface{}{2, 3}, - []sql.Row{{1, 2, 3, 4}, {1, 1, 3, 3}}, + []sql.UntypedSqlRow{{1, 2, 3, 4}, {1, 1, 3, 3}}, }, { "twopk:idx_v2v1", @@ -655,7 +655,7 @@ func TestDoltIndexLessThan(t *testing.T) { { "twopk:idx_v2v1", []interface{}{4, 4}, - []sql.Row{{1, 1, 3, 3}}, + []sql.UntypedSqlRow{{1, 1, 3, 3}}, }, //{ // "twopk:idx_v2v1_PARTIAL_1", @@ -665,7 +665,7 @@ func TestDoltIndexLessThan(t *testing.T) { //{ // "twopk:idx_v2v1_PARTIAL_1", // []interface{}{4}, - // []sql.Row{{2, 2, 4, 3}, {1, 1, 3, 3}}, + // []sql.UntypedSqlRow{{2, 2, 4, 3}, {1, 1, 3, 3}}, //}, } @@ -681,20 +681,20 @@ func TestDoltIndexLessThan(t *testing.T) { }, doltIndexTestCase{ typesTest.indexName, typesTest.secondValue, - []sql.Row{ + []sql.UntypedSqlRow{ typesTableRow1, }, }, doltIndexTestCase{ typesTest.indexName, typesTest.thirdValue, - []sql.Row{ + []sql.UntypedSqlRow{ typesTableRow2, typesTableRow1, }, }, doltIndexTestCase{ typesTest.indexName, typesTest.fourthValue, - []sql.Row{ + []sql.UntypedSqlRow{ typesTableRow3, typesTableRow2, typesTableRow1, @@ -702,7 +702,7 @@ func TestDoltIndexLessThan(t *testing.T) { }, doltIndexTestCase{ typesTest.indexName, typesTest.fifthValue, - []sql.Row{ + []sql.UntypedSqlRow{ typesTableRow4, typesTableRow3, typesTableRow2, @@ -711,7 +711,7 @@ func TestDoltIndexLessThan(t *testing.T) { }, doltIndexTestCase{ typesTest.indexName, typesTest.abovefifthValue, - []sql.Row{ + []sql.UntypedSqlRow{ typesTableRow5, typesTableRow4, typesTableRow3, @@ -737,77 +737,77 @@ func TestDoltIndexLessThanOrEqual(t *testing.T) { tests := []struct { indexName string keys []interface{} - expectedRows []sql.Row + expectedRows []sql.UntypedSqlRow }{ { "onepk:primaryKey", []interface{}{1}, - []sql.Row{{1, 1, 1}}, + []sql.UntypedSqlRow{{1, 1, 1}}, }, { "onepk:primaryKey", []interface{}{3}, - []sql.Row{{3, 3, 3}, {2, 1, 2}, {1, 1, 1}}, + []sql.UntypedSqlRow{{3, 3, 3}, {2, 1, 2}, {1, 1, 1}}, }, { "onepk:primaryKey", []interface{}{4}, - []sql.Row{{4, 4, 3}, {3, 3, 3}, {2, 1, 2}, {1, 1, 1}}, + []sql.UntypedSqlRow{{4, 4, 3}, {3, 3, 3}, {2, 1, 2}, {1, 1, 1}}, }, { "onepk:idx_v1", []interface{}{1}, - []sql.Row{{2, 1, 2}, {1, 1, 1}}, + []sql.UntypedSqlRow{{2, 1, 2}, {1, 1, 1}}, }, { "onepk:idx_v1", []interface{}{3}, - []sql.Row{{3, 3, 3}, {2, 1, 2}, {1, 1, 1}}, + []sql.UntypedSqlRow{{3, 3, 3}, {2, 1, 2}, {1, 1, 1}}, }, { "onepk:idx_v1", []interface{}{4}, - []sql.Row{{4, 4, 3}, {3, 3, 3}, {2, 1, 2}, {1, 1, 1}}, + []sql.UntypedSqlRow{{4, 4, 3}, {3, 3, 3}, {2, 1, 2}, {1, 1, 1}}, }, { "twopk:primaryKey", []interface{}{1, 1}, - []sql.Row{{1, 1, 3, 3}}, + []sql.UntypedSqlRow{{1, 1, 3, 3}}, }, { "twopk:primaryKey", []interface{}{2, 1}, - []sql.Row{{2, 1, 4, 4}, {1, 1, 3, 3}}, + []sql.UntypedSqlRow{{2, 1, 4, 4}, {1, 1, 3, 3}}, }, { "twopk:primaryKey", []interface{}{2, 2}, - []sql.Row{{1, 1, 3, 3}, {1, 2, 3, 4}, {2, 1, 4, 4}, {2, 2, 4, 3}}, + []sql.UntypedSqlRow{{1, 1, 3, 3}, {1, 2, 3, 4}, {2, 1, 4, 4}, {2, 2, 4, 3}}, }, { "twopk:idx_v2v1", []interface{}{3, 4}, - []sql.Row{{2, 2, 4, 3}, {1, 1, 3, 3}}, + []sql.UntypedSqlRow{{2, 2, 4, 3}, {1, 1, 3, 3}}, }, { "twopk:idx_v2v1", []interface{}{4, 3}, - []sql.Row{{1, 1, 3, 3}, {1, 2, 3, 4}}, + []sql.UntypedSqlRow{{1, 1, 3, 3}, {1, 2, 3, 4}}, }, { "twopk:idx_v2v1", []interface{}{4, 4}, - []sql.Row{{1, 1, 3, 3}, {1, 2, 3, 4}, {2, 1, 4, 4}, {2, 2, 4, 3}}, + []sql.UntypedSqlRow{{1, 1, 3, 3}, {1, 2, 3, 4}, {2, 1, 4, 4}, {2, 2, 4, 3}}, }, //{ // "twopk:idx_v2v1_PARTIAL_1", // []interface{}{3}, - // []sql.Row{{1, 1, 3, 3}, {2, 2, 4, 3}}, + // []sql.UntypedSqlRow{{1, 1, 3, 3}, {2, 2, 4, 3}}, //}, //{ // "twopk:idx_v2v1_PARTIAL_1", // []interface{}{4}, - // []sql.Row{{1, 1, 3, 3}, {1, 2, 3, 4}, {2, 1, 4, 4}, {2, 2, 4, 3}}, + // []sql.UntypedSqlRow{{1, 1, 3, 3}, {1, 2, 3, 4}, {2, 1, 4, 4}, {2, 2, 4, 3}}, //}, } @@ -819,20 +819,20 @@ func TestDoltIndexLessThanOrEqual(t *testing.T) { }, doltIndexTestCase{ typesTest.indexName, typesTest.firstValue, - []sql.Row{ + []sql.UntypedSqlRow{ typesTableRow1, }, }, doltIndexTestCase{ typesTest.indexName, typesTest.secondValue, - []sql.Row{ + []sql.UntypedSqlRow{ typesTableRow2, typesTableRow1, }, }, doltIndexTestCase{ typesTest.indexName, typesTest.thirdValue, - []sql.Row{ + []sql.UntypedSqlRow{ typesTableRow3, typesTableRow2, typesTableRow1, @@ -840,7 +840,7 @@ func TestDoltIndexLessThanOrEqual(t *testing.T) { }, doltIndexTestCase{ typesTest.indexName, typesTest.fourthValue, - []sql.Row{ + []sql.UntypedSqlRow{ typesTableRow4, typesTableRow3, typesTableRow2, @@ -849,7 +849,7 @@ func TestDoltIndexLessThanOrEqual(t *testing.T) { }, doltIndexTestCase{ typesTest.indexName, typesTest.fifthValue, - []sql.Row{ + []sql.UntypedSqlRow{ typesTableRow5, typesTableRow4, typesTableRow3, @@ -859,7 +859,7 @@ func TestDoltIndexLessThanOrEqual(t *testing.T) { }, doltIndexTestCase{ typesTest.indexName, typesTest.abovefifthValue, - []sql.Row{ + []sql.UntypedSqlRow{ typesTableRow5, typesTableRow4, typesTableRow3, @@ -887,103 +887,103 @@ func TestDoltIndexBetween(t *testing.T) { "onepk:primaryKey", []interface{}{1}, []interface{}{2}, - []sql.Row{{1, 1, 1}, {2, 1, 2}}, + []sql.UntypedSqlRow{{1, 1, 1}, {2, 1, 2}}, }, { "onepk:primaryKey", []interface{}{3}, []interface{}{3}, - []sql.Row{{3, 3, 3}}, + []sql.UntypedSqlRow{{3, 3, 3}}, }, { "onepk:primaryKey", []interface{}{4}, []interface{}{6}, - []sql.Row{{4, 4, 3}}, + []sql.UntypedSqlRow{{4, 4, 3}}, }, { "onepk:primaryKey", []interface{}{0}, []interface{}{10}, - []sql.Row{{1, 1, 1}, {2, 1, 2}, {3, 3, 3}, {4, 4, 3}}, + []sql.UntypedSqlRow{{1, 1, 1}, {2, 1, 2}, {3, 3, 3}, {4, 4, 3}}, }, { "onepk:idx_v1", []interface{}{1}, []interface{}{2}, - []sql.Row{{1, 1, 1}, {2, 1, 2}}, + []sql.UntypedSqlRow{{1, 1, 1}, {2, 1, 2}}, }, { "onepk:idx_v1", []interface{}{2}, []interface{}{4}, - []sql.Row{{3, 3, 3}, {4, 4, 3}}, + []sql.UntypedSqlRow{{3, 3, 3}, {4, 4, 3}}, }, { "onepk:idx_v1", []interface{}{1}, []interface{}{4}, - []sql.Row{{1, 1, 1}, {2, 1, 2}, {3, 3, 3}, {4, 4, 3}}, + []sql.UntypedSqlRow{{1, 1, 1}, {2, 1, 2}, {3, 3, 3}, {4, 4, 3}}, }, { "twopk:primaryKey", []interface{}{1, 1}, []interface{}{1, 1}, - []sql.Row{{1, 1, 3, 3}}, + []sql.UntypedSqlRow{{1, 1, 3, 3}}, }, { "twopk:primaryKey", []interface{}{1, 1}, []interface{}{2, 1}, - []sql.Row{{1, 1, 3, 3}, {2, 1, 4, 4}}, + []sql.UntypedSqlRow{{1, 1, 3, 3}, {2, 1, 4, 4}}, }, { "twopk:primaryKey", []interface{}{1, 1}, []interface{}{2, 2}, - []sql.Row{{1, 1, 3, 3}, {1, 2, 3, 4}, {2, 1, 4, 4}, {2, 2, 4, 3}}, + []sql.UntypedSqlRow{{1, 1, 3, 3}, {1, 2, 3, 4}, {2, 1, 4, 4}, {2, 2, 4, 3}}, }, { "twopk:primaryKey", []interface{}{1, 1}, []interface{}{2, 5}, - []sql.Row{{1, 1, 3, 3}, {1, 2, 3, 4}, {2, 1, 4, 4}, {2, 2, 4, 3}}, + []sql.UntypedSqlRow{{1, 1, 3, 3}, {1, 2, 3, 4}, {2, 1, 4, 4}, {2, 2, 4, 3}}, }, { "twopk:idx_v2v1", []interface{}{3, 3}, []interface{}{3, 4}, - []sql.Row{{1, 1, 3, 3}, {2, 2, 4, 3}}, + []sql.UntypedSqlRow{{1, 1, 3, 3}, {2, 2, 4, 3}}, }, { "twopk:idx_v2v1", []interface{}{3, 4}, []interface{}{4, 4}, - []sql.Row{{2, 1, 4, 4}, {2, 2, 4, 3}}, + []sql.UntypedSqlRow{{2, 1, 4, 4}, {2, 2, 4, 3}}, }, { "twopk:idx_v2v1", []interface{}{3, 3}, []interface{}{4, 4}, - []sql.Row{{1, 1, 3, 3}, {1, 2, 3, 4}, {2, 1, 4, 4}, {2, 2, 4, 3}}, + []sql.UntypedSqlRow{{1, 1, 3, 3}, {1, 2, 3, 4}, {2, 1, 4, 4}, {2, 2, 4, 3}}, }, //{ // "twopk:idx_v2v1_PARTIAL_1", // []interface{}{3}, // []interface{}{3}, - // []sql.Row{{1, 1, 3, 3}, {2, 2, 4, 3}}, + // []sql.UntypedSqlRow{{1, 1, 3, 3}, {2, 2, 4, 3}}, //}, //{ // "twopk:idx_v2v1_PARTIAL_1", // []interface{}{4}, // []interface{}{4}, - // []sql.Row{{1, 2, 3, 4}, {2, 1, 4, 4}}, + // []sql.UntypedSqlRow{{1, 2, 3, 4}, {2, 1, 4, 4}}, //}, //{ // "twopk:idx_v2v1_PARTIAL_1", // []interface{}{3}, // []interface{}{4}, - // []sql.Row{{1, 1, 3, 3}, {1, 2, 3, 4}, {2, 1, 4, 4}, {2, 2, 4, 3}}, + // []sql.UntypedSqlRow{{1, 1, 3, 3}, {1, 2, 3, 4}, {2, 1, 4, 4}, {2, 2, 4, 3}}, //}, } @@ -997,14 +997,14 @@ func TestDoltIndexBetween(t *testing.T) { typesTest.indexName, typesTest.belowfirstValue, typesTest.firstValue, - []sql.Row{ + []sql.UntypedSqlRow{ typesTableRow1, }, }, doltIndexBetweenTestCase{ typesTest.indexName, typesTest.belowfirstValue, typesTest.secondValue, - []sql.Row{ + []sql.UntypedSqlRow{ typesTableRow1, typesTableRow2, }, @@ -1012,7 +1012,7 @@ func TestDoltIndexBetween(t *testing.T) { typesTest.indexName, typesTest.belowfirstValue, typesTest.thirdValue, - []sql.Row{ + []sql.UntypedSqlRow{ typesTableRow1, typesTableRow2, typesTableRow3, @@ -1021,14 +1021,14 @@ func TestDoltIndexBetween(t *testing.T) { typesTest.indexName, typesTest.secondValue, typesTest.secondValue, - []sql.Row{ + []sql.UntypedSqlRow{ typesTableRow2, }, }, doltIndexBetweenTestCase{ typesTest.indexName, typesTest.thirdValue, typesTest.fifthValue, - []sql.Row{ + []sql.UntypedSqlRow{ typesTableRow3, typesTableRow4, typesTableRow5, @@ -1037,7 +1037,7 @@ func TestDoltIndexBetween(t *testing.T) { typesTest.indexName, typesTest.fifthValue, typesTest.abovefifthValue, - []sql.Row{ + []sql.UntypedSqlRow{ typesTableRow5, }, }, doltIndexBetweenTestCase{ @@ -1082,7 +1082,7 @@ func TestDoltIndexBetween(t *testing.T) { } require.Equal(t, io.EOF, err) - requireUnorderedRowsEqual(t, pkSch.Schema, expectedRows, readRows) + requireUnorderedRowsEqual(t, pkSch.Schema, expectedRows, sql.RowsToUntyped(readRows)) }) } } @@ -1100,7 +1100,7 @@ func (t NoCacheTableable) DataCacheKey(ctx *sql.Context) (doltdb.DataCacheKey, b } type rowSlice struct { - rows []sql.Row + rows []sql.UntypedSqlRow sortErr error } @@ -1279,7 +1279,7 @@ func (r *rowSlice) Swap(i, j int) { r.rows[i], r.rows[j] = r.rows[j], r.rows[i] } -func requireUnorderedRowsEqual(t *testing.T, s sql.Schema, rows1, rows2 []sql.Row) { +func requireUnorderedRowsEqual(t *testing.T, s sql.Schema, rows1, rows2 []sql.UntypedSqlRow) { slice1 := &rowSlice{rows: rows1} sort.Stable(slice1) require.NoError(t, slice1.sortErr) @@ -1291,7 +1291,7 @@ func requireUnorderedRowsEqual(t *testing.T, s sql.Schema, rows1, rows2 []sql.Ro assert.True(t, slice1.equals(slice2, s)) } -func testDoltIndex(t *testing.T, ctx *sql.Context, root doltdb.RootValue, keys []interface{}, expectedRows []sql.Row, idx index.DoltIndex, cmp indexComp) { +func testDoltIndex(t *testing.T, ctx *sql.Context, root doltdb.RootValue, keys []interface{}, expectedRows []sql.UntypedSqlRow, idx index.DoltIndex, cmp indexComp) { ctx = sql.NewEmptyContext() exprs := idx.Expressions() builder := sql.NewMySQLIndexBuilder(idx) @@ -1333,7 +1333,7 @@ func testDoltIndex(t *testing.T, ctx *sql.Context, root doltdb.RootValue, keys [ } require.Equal(t, io.EOF, err) - requireUnorderedRowsEqual(t, pkSch.Schema, convertSqlRowToInt64(expectedRows), readRows) + requireUnorderedRowsEqual(t, pkSch.Schema, convertSqlRowToInt64(expectedRows), sql.RowsToUntyped(readRows)) } func doltIndexSetup(t *testing.T) (doltdb.RootValue, map[string]index.DoltIndex) { @@ -1428,13 +1428,13 @@ func mustDecimal(s string) decimal.Decimal { return d } -func convertSqlRowToInt64(sqlRows []sql.Row) []sql.Row { +func convertSqlRowToInt64(sqlRows []sql.UntypedSqlRow) []sql.UntypedSqlRow { if sqlRows == nil { return nil } - newSqlRows := make([]sql.Row, len(sqlRows)) + newSqlRows := make([]sql.UntypedSqlRow, len(sqlRows)) for i, sqlRow := range sqlRows { - newSqlRow := make(sql.Row, len(sqlRow)) + newSqlRow := make(sql.UntypedSqlRow, len(sqlRow)) for j := range sqlRow { switch v := sqlRow[j].(type) { case int: diff --git a/go/libraries/doltcore/sqle/index/dolt_map_iter.go b/go/libraries/doltcore/sqle/index/dolt_map_iter.go index aca8a9a7ea8..43643b10919 100644 --- a/go/libraries/doltcore/sqle/index/dolt_map_iter.go +++ b/go/libraries/doltcore/sqle/index/dolt_map_iter.go @@ -148,7 +148,7 @@ func (conv *KVToSqlRowConverter) ConvertKVTuplesToSqlRow(k, v types.Tuple) (sql. } } - return cols, nil + return sql.NewUntypedRow(cols...), nil } func (conv *KVToSqlRowConverter) processTuple(cols []interface{}, valsToFill int, maxTag uint64, tup types.Tuple, tupItr *types.TupleIterator) error { diff --git a/go/libraries/doltcore/sqle/index/doltgres_iter.go b/go/libraries/doltcore/sqle/index/doltgres_iter.go index 222af449eba..2f47991e71f 100644 --- a/go/libraries/doltcore/sqle/index/doltgres_iter.go +++ b/go/libraries/doltcore/sqle/index/doltgres_iter.go @@ -213,7 +213,7 @@ func NewDoltgresPartitionIter(ctx *sql.Context, lookup sql.IndexLookup) (sql.Par // doltgresProllyMapIterator returns a map iterator, which handles the contiguous iteration over the underlying map that // stores an index's data. This also handles filter expressions, if any are present. func doltgresProllyMapIterator(ctx *sql.Context, keyDesc val.TupleDesc, ns tree.NodeStore, root tree.Node, rang DoltgresRange) (prolly.MapIter, error) { - searchRow := make(sql.Row, len(keyDesc.Types)) + searchRow := make(sql.UntypedSqlRow, len(keyDesc.Types)) var findStartErr error findStart := func(nd tree.Node) int { return sort.Search(nd.Count(), func(i int) bool { @@ -290,11 +290,12 @@ func doltgresProllyMapIterator(ctx *sql.Context, keyDesc val.TupleDesc, ns tree. // doltgresMapSearchKeyToRow writes the given key into the given row. As all used functions are expressions, they expect // a sql.Row, and we must therefore convert the key tuple into the format expected of the expression. func doltgresMapSearchKeyToRow(ctx context.Context, key val.Tuple, keyDesc val.TupleDesc, ns tree.NodeStore, row sql.Row) (err error) { - for i := range row { - row[i], err = tree.GetField(ctx, keyDesc, i, key, ns) + for i := 0; i < row.Len(); i++ { + v, err := tree.GetField(ctx, keyDesc, i, key, ns) if err != nil { return err } + row.SetValue(i, v) } return } diff --git a/go/libraries/doltcore/sqle/index/mergeable_indexes_test.go b/go/libraries/doltcore/sqle/index/mergeable_indexes_test.go index 9b522728589..a73ef89f3ce 100644 --- a/go/libraries/doltcore/sqle/index/mergeable_indexes_test.go +++ b/go/libraries/doltcore/sqle/index/mergeable_indexes_test.go @@ -1326,8 +1326,8 @@ func TestMergeableIndexes(t *testing.T) { if assert.Equal(t, len(test.pks), len(res)) { for i, pk := range test.pks { - if assert.Equal(t, 1, len(res[i])) { - assert.Equal(t, pk, res[i][0]) + if assert.Equal(t, 1, res[i].Len()) { + assert.Equal(t, pk, res[i].GetValue(0)) } } } @@ -1532,8 +1532,8 @@ func TestMergeableIndexesNulls(t *testing.T) { require.NoError(t, err) if assert.Equal(t, len(test.pks), len(res)) { for i, pk := range test.pks { - if assert.Equal(t, 1, len(res[i])) { - assert.Equal(t, pk, res[i][0]) + if assert.Equal(t, 1, res[i].Len()) { + assert.Equal(t, pk, res[i].GetValue(0)) } } } diff --git a/go/libraries/doltcore/sqle/index/prolly_index_iter.go b/go/libraries/doltcore/sqle/index/prolly_index_iter.go index e3c302d79d2..905030569e7 100644 --- a/go/libraries/doltcore/sqle/index/prolly_index_iter.go +++ b/go/libraries/doltcore/sqle/index/prolly_index_iter.go @@ -99,7 +99,7 @@ func (p prollyIndexIter) Next(ctx *sql.Context) (sql.Row, error) { } pk := p.pkBld.Build(sharePool) - r := make(sql.Row, len(p.projections)) + r := make(sql.UntypedSqlRow, len(p.projections)) err = p.primary.Get(ctx, pk, func(key, value val.Tuple) error { return p.rowFromTuples(ctx, key, value, r) }) @@ -114,18 +114,20 @@ func (p prollyIndexIter) rowFromTuples(ctx context.Context, key, value val.Tuple for i, idx := range p.keyMap { outputIdx := p.ordMap[i] - r[outputIdx], err = tree.GetField(ctx, keyDesc, idx, key, p.primary.NodeStore()) + v, err := tree.GetField(ctx, keyDesc, idx, key, p.primary.NodeStore()) if err != nil { return err } + r.SetValue(outputIdx, v) } for i, idx := range p.valMap { outputIdx := p.ordMap[len(p.keyMap)+i] - r[outputIdx], err = tree.GetField(ctx, valDesc, idx, value, p.primary.NodeStore()) + v, err := tree.GetField(ctx, valDesc, idx, value, p.primary.NodeStore()) if err != nil { return err } + r.SetValue(outputIdx, v) } return @@ -218,7 +220,7 @@ func (p prollyCoveringIndexIter) Next(ctx *sql.Context) (sql.Row, error) { return nil, err } - r := make(sql.Row, len(p.projections)) + r := make(sql.UntypedSqlRow, len(p.projections)) if err := p.writeRowFromTuples(ctx, k, v, r); err != nil { return nil, err } @@ -229,18 +231,20 @@ func (p prollyCoveringIndexIter) Next(ctx *sql.Context) (sql.Row, error) { func (p prollyCoveringIndexIter) writeRowFromTuples(ctx context.Context, key, value val.Tuple, r sql.Row) (err error) { for i, idx := range p.keyMap { outputIdx := p.ordMap[i] - r[outputIdx], err = tree.GetField(ctx, p.keyDesc, idx, key, p.ns) + v, err := tree.GetField(ctx, p.keyDesc, idx, key, p.ns) if err != nil { return err } + r.SetValue(outputIdx, v) } for i, idx := range p.valMap { outputIdx := p.ordMap[len(p.keyMap)+i] - r[outputIdx], err = tree.GetField(ctx, p.valDesc, idx, value, p.ns) + v, err := tree.GetField(ctx, p.valDesc, idx, value, p.ns) if err != nil { return err } + r.SetValue(outputIdx, v) } return } @@ -398,14 +402,15 @@ func (p prollyKeylessIndexIter) queueRows(ctx context.Context) error { func (p prollyKeylessIndexIter) keylessRowsFromValueTuple(ctx context.Context, ns tree.NodeStore, value val.Tuple) (rows []sql.Row, err error) { card := val.ReadKeylessCardinality(value) rows = make([]sql.Row, card) - rows[0] = make(sql.Row, len(p.valueMap)) + rows[0] = make(sql.UntypedSqlRow, len(p.valueMap)) for i, idx := range p.valueMap { outputIdx := p.ordMap[i] - rows[0][outputIdx], err = tree.GetField(ctx, p.valueDesc, idx, value, ns) + v, err := tree.GetField(ctx, p.valueDesc, idx, value, ns) if err != nil { return nil, err } + rows[0].SetValue(outputIdx, v) } // duplicate row |card| times diff --git a/go/libraries/doltcore/sqle/index/prolly_row_iter.go b/go/libraries/doltcore/sqle/index/prolly_row_iter.go index 932a9a5723c..fe39b4ccecd 100644 --- a/go/libraries/doltcore/sqle/index/prolly_row_iter.go +++ b/go/libraries/doltcore/sqle/index/prolly_row_iter.go @@ -173,7 +173,7 @@ func (it prollyRowIter) Next(ctx *sql.Context) (sql.Row, error) { return nil, err } - row := make(sql.Row, it.rowLen) + row := make(sql.UntypedSqlRow, it.rowLen) for i, idx := range it.keyProj { outputIdx := it.ordProj[i] row[outputIdx], err = tree.GetField(ctx, it.keyDesc, idx, key, it.ns) @@ -231,14 +231,15 @@ func (it *prollyKeylessIter) nextTuple(ctx *sql.Context) error { } it.card = val.ReadKeylessCardinality(value) - it.curr = make(sql.Row, it.rowLen) + it.curr = make(sql.UntypedSqlRow, it.rowLen) for i, idx := range it.valProj { outputIdx := it.ordProj[i] - it.curr[outputIdx], err = tree.GetField(ctx, it.valDesc, idx, value, it.ns) + v, err := tree.GetField(ctx, it.valDesc, idx, value, it.ns) if err != nil { return err } + it.curr.SetValue(outputIdx, v) } return nil } diff --git a/go/libraries/doltcore/sqle/integration_test/database_revision_test.go b/go/libraries/doltcore/sqle/integration_test/database_revision_test.go index 42a08ac38eb..8411d879446 100644 --- a/go/libraries/doltcore/sqle/integration_test/database_revision_test.go +++ b/go/libraries/doltcore/sqle/integration_test/database_revision_test.go @@ -40,12 +40,12 @@ type DbRevisionTest struct { type testAssert struct { query string - rows []sql.Row + rows []sql.UntypedSqlRow } type dynamicAssert struct { query func() string - rows []sql.Row + rows []sql.UntypedSqlRow } func TestDbRevision(t *testing.T) { @@ -70,14 +70,14 @@ func TestDbRevision(t *testing.T) { asserts: []testAssert{ { query: "show databases", - rows: []sql.Row{ + rows: []sql.UntypedSqlRow{ {"dolt"}, {"information_schema"}, }, }, { query: "select * from myTable", - rows: []sql.Row{ + rows: []sql.UntypedSqlRow{ {int32(1), int32(1)}, {int32(9), int32(9)}, }, @@ -95,21 +95,21 @@ func TestDbRevision(t *testing.T) { asserts: []testAssert{ { query: "select * from dolt.myTable", - rows: []sql.Row{ + rows: []sql.UntypedSqlRow{ {int32(1), int32(1)}, {int32(19), int32(19)}, }, }, { query: "select * from `dolt/other`.myTable", - rows: []sql.Row{ + rows: []sql.UntypedSqlRow{ {int32(1), int32(1)}, {int32(19), int32(19)}, }, }, { query: "select * from `dolt/main`.myTable", - rows: []sql.Row{ + rows: []sql.UntypedSqlRow{ {int32(1), int32(1)}, {int32(9), int32(9)}, }, @@ -121,7 +121,7 @@ func TestDbRevision(t *testing.T) { query: func() string { return fmt.Sprintf("select * from `dolt/%s`.myTable", cm3.String()) }, - rows: []sql.Row{ + rows: []sql.UntypedSqlRow{ {int32(1), int32(1)}, {int32(19), int32(19)}, }, @@ -131,7 +131,7 @@ func TestDbRevision(t *testing.T) { query: func() string { return fmt.Sprintf("select * from `dolt/%s`.myTable", cm2.String()) }, - rows: []sql.Row{ + rows: []sql.UntypedSqlRow{ {int32(1), int32(1)}, }, }, @@ -191,14 +191,14 @@ func populateCommitHashes(t *testing.T, dEnv *env.DoltEnv, root doltdb.RootValue rows, err := sqle.ExecuteSelect(dEnv, root, q) require.NoError(t, err) assert.Len(t, rows, 4) - cm3 = hash.Parse(rows[0][0].(string)) - cm2 = hash.Parse(rows[1][0].(string)) - cm1 = hash.Parse(rows[2][0].(string)) + cm3 = hash.Parse(rows[0].GetValue(0).(string)) + cm2 = hash.Parse(rows[1].GetValue(0).(string)) + cm1 = hash.Parse(rows[2].GetValue(0).(string)) return } func makeTestAssertion(t *testing.T, a testAssert, dEnv *env.DoltEnv, root doltdb.RootValue) { actRows, err := sqle.ExecuteSelect(dEnv, root, a.query) require.NoError(t, err) - assert.Equal(t, a.rows, actRows) + assert.Equal(t, a.rows, sql.RowsToUntyped(actRows)) } diff --git a/go/libraries/doltcore/sqle/integration_test/history_table_test.go b/go/libraries/doltcore/sqle/integration_test/history_table_test.go index 54282e8e73c..25ca6f5de4c 100644 --- a/go/libraries/doltcore/sqle/integration_test/history_table_test.go +++ b/go/libraries/doltcore/sqle/integration_test/history_table_test.go @@ -54,7 +54,7 @@ type historyTableTest struct { name string setup []testCommand query string - rows []sql.Row + rows []sql.UntypedSqlRow } type testCommand struct { @@ -91,7 +91,7 @@ func historyTableTests() []historyTableTest { { name: "select pk, c0 from dolt_history_test", query: "select pk, c0 from dolt_history_test", - rows: []sql.Row{ + rows: []sql.UntypedSqlRow{ {int32(0), int32(10)}, {int32(1), int32(1)}, {int32(2), int32(12)}, @@ -107,7 +107,7 @@ func historyTableTests() []historyTableTest { { name: "select commit_hash from dolt_history_test", query: "select commit_hash from dolt_history_test", - rows: []sql.Row{ + rows: []sql.UntypedSqlRow{ {HEAD}, {HEAD}, {HEAD}, @@ -123,7 +123,7 @@ func historyTableTests() []historyTableTest { { name: "filter for a specific commit hash", query: fmt.Sprintf("select pk, c0, commit_hash from dolt_history_test where commit_hash = '%s';", HEAD_1), - rows: []sql.Row{ + rows: []sql.UntypedSqlRow{ {int32(0), int32(0), HEAD_1}, {int32(1), int32(1), HEAD_1}, {int32(2), int32(2), HEAD_1}, @@ -133,7 +133,7 @@ func historyTableTests() []historyTableTest { { name: "filter out a specific commit hash", query: fmt.Sprintf("select pk, c0, commit_hash from dolt_history_test where commit_hash != '%s';", HEAD_1), - rows: []sql.Row{ + rows: []sql.UntypedSqlRow{ {int32(0), int32(10), HEAD}, {int32(1), int32(1), HEAD}, {int32(2), int32(12), HEAD}, @@ -146,7 +146,7 @@ func historyTableTests() []historyTableTest { name: "compound or filter on commit hash", query: fmt.Sprintf("select pk, c0, commit_hash from dolt_history_test "+ "where commit_hash = '%s' or commit_hash = '%s';", HEAD_1, HEAD_2), - rows: []sql.Row{ + rows: []sql.UntypedSqlRow{ {int32(0), int32(0), HEAD_1}, {int32(1), int32(1), HEAD_1}, {int32(2), int32(2), HEAD_1}, @@ -159,7 +159,7 @@ func historyTableTests() []historyTableTest { name: "commit hash in value set", query: fmt.Sprintf("select pk, c0, commit_hash from dolt_history_test "+ "where commit_hash in ('%s', '%s');", HEAD_1, HEAD_2), - rows: []sql.Row{ + rows: []sql.UntypedSqlRow{ {int32(0), int32(0), HEAD_1}, {int32(1), int32(1), HEAD_1}, {int32(2), int32(2), HEAD_1}, @@ -172,7 +172,7 @@ func historyTableTests() []historyTableTest { name: "commit hash not in value set", query: fmt.Sprintf("select pk, c0, commit_hash from dolt_history_test "+ "where commit_hash not in ('%s','%s');", HEAD_1, HEAD_2), - rows: []sql.Row{ + rows: []sql.UntypedSqlRow{ {int32(0), int32(10), HEAD}, {int32(1), int32(1), HEAD}, {int32(2), int32(12), HEAD}, @@ -182,7 +182,7 @@ func historyTableTests() []historyTableTest { { name: "commit is not null", query: "select pk, c0, commit_hash from dolt_history_test where commit_hash is not null;", - rows: []sql.Row{ + rows: []sql.UntypedSqlRow{ {int32(0), int32(10), HEAD}, {int32(1), int32(1), HEAD}, {int32(2), int32(12), HEAD}, @@ -198,7 +198,7 @@ func historyTableTests() []historyTableTest { { name: "commit is null", query: "select * from dolt_history_test where commit_hash is null;", - rows: []sql.Row{}, + rows: []sql.UntypedSqlRow{}, }, } } @@ -228,11 +228,11 @@ func setupHistoryTests(t *testing.T) *env.DoltEnv { rows, err := sqle.ExecuteSelect(dEnv, root, q) require.NoError(t, err) require.Equal(t, 5, len(rows)) - HEAD = rows[0][0].(string) - HEAD_1 = rows[1][0].(string) - HEAD_2 = rows[2][0].(string) - HEAD_3 = rows[3][0].(string) - INIT = rows[4][0].(string) + HEAD = rows[0].GetValue(0).(string) + HEAD_1 = rows[1].GetValue(0).(string) + HEAD_2 = rows[2].GetValue(0).(string) + HEAD_3 = rows[3].GetValue(0).(string) + INIT = rows[4].GetValue(0).(string) return dEnv } diff --git a/go/libraries/doltcore/sqle/integration_test/json_value_test.go b/go/libraries/doltcore/sqle/integration_test/json_value_test.go index 1a693773719..b5b932870ab 100644 --- a/go/libraries/doltcore/sqle/integration_test/json_value_test.go +++ b/go/libraries/doltcore/sqle/integration_test/json_value_test.go @@ -41,7 +41,7 @@ type jsonValueTest struct { name string setup []testCommand query string - rows []sql.Row + rows []sql.UntypedSqlRow } func TestJsonValues(t *testing.T) { @@ -59,7 +59,7 @@ func TestJsonValues(t *testing.T) { name: "create JSON table", setup: []testCommand{}, query: "select * from js", - rows: []sql.Row{}, + rows: []sql.UntypedSqlRow{}, }, { name: "insert into a JSON table", @@ -67,7 +67,7 @@ func TestJsonValues(t *testing.T) { {cmd.SqlCmd{}, args{"-q", `insert into js values (1, '{"a":1}'), (2, '{"b":2}');`}}, }, query: "select * from js", - rows: []sql.Row{ + rows: []sql.UntypedSqlRow{ {int32(1), json.MustNomsJSON(`{"a":1}`)}, {int32(2), json.MustNomsJSON(`{"b":2}`)}, }, @@ -79,7 +79,7 @@ func TestJsonValues(t *testing.T) { {cmd.SqlCmd{}, args{"-q", `update js set js = '{"c":3}' where pk = 2;`}}, }, query: "select * from js", - rows: []sql.Row{ + rows: []sql.UntypedSqlRow{ {int32(1), json.MustNomsJSON(`{"a":1}`)}, {int32(2), json.MustNomsJSON(`{"c":3}`)}, }, @@ -91,7 +91,7 @@ func TestJsonValues(t *testing.T) { {cmd.SqlCmd{}, args{"-q", `delete from js where pk = 2;`}}, }, query: "select * from js", - rows: []sql.Row{ + rows: []sql.UntypedSqlRow{ {int32(1), json.MustNomsJSON(`{"a":1}`)}, }, }, @@ -110,7 +110,7 @@ func TestJsonValues(t *testing.T) { {cmd.MergeCmd{}, args{"other"}}, }, query: "select * from js", - rows: []sql.Row{ + rows: []sql.UntypedSqlRow{ {int32(1), json.MustNomsJSON(`{"a":11}`)}, {int32(2), json.MustNomsJSON(`{"b":22}`)}, }, @@ -144,9 +144,9 @@ func testJsonValue(t *testing.T, test jsonValueTest, setupCommon []testCommand) require.Equal(t, len(test.rows), len(actRows)) for i := range test.rows { - assert.Equal(t, len(test.rows[i]), len(actRows[i])) + assert.Equal(t, len(test.rows[i]), actRows[i].Len()) for j := range test.rows[i] { - exp, act := test.rows[i][j], actRows[i][j] + exp, act := test.rows[i][j], actRows[i].GetValue(j) // special logic for comparing JSONValues if js, ok := exp.(json.NomsJSON); ok { @@ -214,14 +214,14 @@ func TestLargeJsonObjects(t *testing.T) { // for each row/object: // - create an expected output rows // - add an insert tuple to the setup query - expected := make([]sql.Row, numRows) + expected := make([]sql.UntypedSqlRow, numRows) query := strings.Builder{} query.WriteString("insert into js values (") seenOne := false for i, val := range vals { - expected[i] = sql.NewRow(int32(i), json.MustNomsJSON(val)) + expected[i] = sql.NewUntypedRow(int32(i), json.MustNomsJSON(val)).(sql.UntypedSqlRow) if seenOne { query.WriteString("'),(") diff --git a/go/libraries/doltcore/sqle/kvexec/builder.go b/go/libraries/doltcore/sqle/kvexec/builder.go index e649e0e24cf..c786561081e 100644 --- a/go/libraries/doltcore/sqle/kvexec/builder.go +++ b/go/libraries/doltcore/sqle/kvexec/builder.go @@ -51,10 +51,10 @@ func (b Builder) Build(ctx *sql.Context, n sql.Node, r sql.Row) (sql.RowIter, er switch n := n.(type) { case *plan.JoinNode: switch { - case n.Op.IsPartial() || len(r) != 0: + case n.Op.IsPartial() || r.Len() != 0: return nil, nil case n.Op.IsLookup(): - if ita, ok := getIta(n.Right()); ok && len(r) == 0 && simpleLookupExpressions(ita.Expressions()) { + if ita, ok := getIta(n.Right()); ok && simpleLookupExpressions(ita.Expressions()) { if _, _, _, dstIter, _, _, dstTags, dstFilter, err := getSourceKv(ctx, n.Right(), false); err == nil && dstIter != nil { if srcMap, _, srcIter, _, srcSchema, _, srcTags, srcFilter, err := getSourceKv(ctx, n.Left(), true); err == nil && srcSchema != nil { if keyLookupMapper := newLookupKeyMapping(ctx, srcSchema, dstIter.InputKeyDesc(), ita.Expressions(), srcMap.NodeStore()); keyLookupMapper.valid() { @@ -242,10 +242,11 @@ func (m *prollyToSqlJoiner) buildRow(ctx context.Context, tuples ...val.Tuple) ( if len(tuples) != 2*len(m.desc) { panic("invalid KV count for prollyToSqlJoiner") } - row := make(sql.Row, m.outCnt) + row := make(sql.UntypedSqlRow, m.outCnt) split := 0 var err error var tup val.Tuple + var v interface{} for i, desc := range m.desc { tup = tuples[2*i] if tup == nil { @@ -258,18 +259,20 @@ func (m *prollyToSqlJoiner) buildRow(ctx context.Context, tuples ...val.Tuple) ( } for j, idx := range desc.keyMappings { outputIdx := m.ordMappings[split+j] - row[outputIdx], err = tree.GetField(ctx, desc.keyDesc, idx, tup, m.ns) + v, err = tree.GetField(ctx, desc.keyDesc, idx, tup, m.ns) if err != nil { return nil, err } + row.SetValue(outputIdx, v) } tup = tuples[2*i+1] for j, idx := range desc.valMappings { outputIdx := m.ordMappings[split+len(desc.keyMappings)+j] - row[outputIdx], err = tree.GetField(ctx, desc.valDesc, idx, tup, m.ns) + v, err = tree.GetField(ctx, desc.valDesc, idx, tup, m.ns) if err != nil { return nil, err } + row.SetValue(outputIdx, v) } } return row, nil diff --git a/go/libraries/doltcore/sqle/kvexec/count_agg.go b/go/libraries/doltcore/sqle/kvexec/count_agg.go index 9b368567188..ac0ed566690 100644 --- a/go/libraries/doltcore/sqle/kvexec/count_agg.go +++ b/go/libraries/doltcore/sqle/kvexec/count_agg.go @@ -93,5 +93,5 @@ func (l *countAggKvIter) Next(ctx *sql.Context) (sql.Row, error) { cnt++ } l.done = true - return sql.Row{cnt}, nil + return sql.UntypedSqlRow{cnt}, nil } diff --git a/go/libraries/doltcore/sqle/kvexec/lookup_join.go b/go/libraries/doltcore/sqle/kvexec/lookup_join.go index 65bfebc927a..b160e117fac 100644 --- a/go/libraries/doltcore/sqle/kvexec/lookup_join.go +++ b/go/libraries/doltcore/sqle/kvexec/lookup_join.go @@ -144,7 +144,7 @@ func (l *lookupJoinKvIter) Next(ctx *sql.Context) (sql.Row, error) { // side-specific filters are currently hoisted if l.srcFilter != nil { - res, err := sql.EvaluateCondition(ctx, l.srcFilter, ret[:l.joiner.kvSplits[0]]) + res, err := sql.EvaluateCondition(ctx, l.srcFilter, ret.Subslice(0, l.joiner.kvSplits[0])) if err != nil { return nil, err } @@ -155,7 +155,7 @@ func (l *lookupJoinKvIter) Next(ctx *sql.Context) (sql.Row, error) { } if l.dstFilter != nil && l.dstKey != nil { - res, err := sql.EvaluateCondition(ctx, l.dstFilter, ret[l.joiner.kvSplits[0]:]) + res, err := sql.EvaluateCondition(ctx, l.dstFilter, ret.Subslice(l.joiner.kvSplits[0], ret.Len())) if err != nil { return nil, err } diff --git a/go/libraries/doltcore/sqle/kvexec/merge_join.go b/go/libraries/doltcore/sqle/kvexec/merge_join.go index 1cdfaa67408..d7ced204182 100644 --- a/go/libraries/doltcore/sqle/kvexec/merge_join.go +++ b/go/libraries/doltcore/sqle/kvexec/merge_join.go @@ -279,7 +279,7 @@ func (l *mergeJoinKvIter) buildResultRow(ctx *sql.Context, leftKey, leftVal, rig rightKeyNil := rightKey == nil if l.leftFilter != nil { - res, err := sql.EvaluateCondition(ctx, l.leftFilter, candidate[:l.joiner.kvSplits[0]]) + res, err := sql.EvaluateCondition(ctx, l.leftFilter, candidate.Subslice(0, l.joiner.kvSplits[0])) if err != nil { return nil, false, err } @@ -289,7 +289,7 @@ func (l *mergeJoinKvIter) buildResultRow(ctx *sql.Context, leftKey, leftVal, rig } if l.rightFilter != nil && !rightKeyNil { - res, err := sql.EvaluateCondition(ctx, l.rightFilter, candidate[l.joiner.kvSplits[0]:]) + res, err := sql.EvaluateCondition(ctx, l.rightFilter, candidate.Subslice(l.joiner.kvSplits[0], candidate.Len())) if err != nil { return nil, false, err } diff --git a/go/libraries/doltcore/sqle/logictest/dolt/doltharness.go b/go/libraries/doltcore/sqle/logictest/dolt/doltharness.go index 55a82af0dce..5a3c6d49604 100644 --- a/go/libraries/doltcore/sqle/logictest/dolt/doltharness.go +++ b/go/libraries/doltcore/sqle/logictest/dolt/doltharness.go @@ -209,7 +209,7 @@ func rowsToResultStrings(ctx *sql.Context, iter sql.RowIter) ([]string, error) { drainIteratorIgnoreErrors(ctx, iter) return nil, err } else { - for _, col := range row { + for _, col := range row.Values() { results = append(results, toSqlString(col)) } } diff --git a/go/libraries/doltcore/sqle/procedures_table.go b/go/libraries/doltcore/sqle/procedures_table.go index d90c138b7ee..1968cd0436c 100644 --- a/go/libraries/doltcore/sqle/procedures_table.go +++ b/go/libraries/doltcore/sqle/procedures_table.go @@ -222,13 +222,13 @@ func migrateDoltProceduresSchema(ctx *sql.Context, db Database, oldTable *Writab return nil, err } - newRow := make(sql.Row, ProceduresTableSchema().GetAllCols().Size()) - newRow[0] = sqlRow[nameIdx] - newRow[1] = sqlRow[createStatementIdx] - newRow[2] = sqlRow[createdAtIdx] - newRow[3] = sqlRow[modifiedAtIdx] + newRow := make(sql.UntypedSqlRow, ProceduresTableSchema().GetAllCols().Size()) + newRow[0] = sqlRow.GetValue(nameIdx) + newRow[1] = sqlRow.GetValue(createStatementIdx) + newRow[2] = sqlRow.GetValue(createdAtIdx) + newRow[3] = sqlRow.GetValue(modifiedAtIdx) if sqlModeIdx >= 0 { - newRow[4] = sqlRow[sqlModeIdx] + newRow[4] = sqlRow.GetValue(sqlModeIdx) } newRows = append(newRows, newRow) } @@ -354,19 +354,19 @@ func DoltProceduresGetAll(ctx *sql.Context, db Database, procedureName string) ( var d sql.StoredProcedureDetails var ok bool - if d.Name, ok = sqlRow[0].(string); !ok { + if d.Name, ok = sqlRow.GetValue(0).(string); !ok { return nil, missingValue.New(doltdb.ProceduresTableNameCol, sqlRow) } - if d.CreateStatement, ok = sqlRow[1].(string); !ok { + if d.CreateStatement, ok = sqlRow.GetValue(1).(string); !ok { return nil, missingValue.New(doltdb.ProceduresTableCreateStmtCol, sqlRow) } - if d.CreatedAt, ok = sqlRow[2].(time.Time); !ok { + if d.CreatedAt, ok = sqlRow.GetValue(2).(time.Time); !ok { return nil, missingValue.New(doltdb.ProceduresTableCreatedAtCol, sqlRow) } - if d.ModifiedAt, ok = sqlRow[3].(time.Time); !ok { + if d.ModifiedAt, ok = sqlRow.GetValue(3).(time.Time); !ok { return nil, missingValue.New(doltdb.ProceduresTableModifiedAtCol, sqlRow) } - if s, ok := sqlRow[4].(string); ok { + if s, ok := sqlRow.GetValue(4).(string); ok { d.SqlMode = s } else { defaultSqlMode, err := loadDefaultSqlMode() @@ -401,7 +401,7 @@ func DoltProceduresAddProcedure(ctx *sql.Context, db Database, spd sql.StoredPro retErr = err } }() - return inserter.Insert(ctx, sql.Row{ + return inserter.Insert(ctx, sql.UntypedSqlRow{ strings.ToLower(spd.Name), spd.CreateStatement, spd.CreatedAt.UTC(), @@ -435,7 +435,7 @@ func DoltProceduresDropProcedure(ctx *sql.Context, db Database, name string) (re retErr = err } }() - return deleter.Delete(ctx, sql.Row{name}) + return deleter.Delete(ctx, sql.UntypedSqlRow{name}) } // DoltProceduresGetDetails returns the stored procedure with the given name from `dolt_procedures` if it exists. @@ -473,14 +473,14 @@ func DoltProceduresGetDetails(ctx *sql.Context, tbl *WritableDoltTable, name str sqlRow, err := rowIter.Next(ctx) if err == nil { - if len(sqlRow) != 5 { + if sqlRow.Len() != 5 { return sql.StoredProcedureDetails{}, false, fmt.Errorf("unexpected row in dolt_procedures:\n%v", sqlRow) } return sql.StoredProcedureDetails{ - Name: sqlRow[0].(string), - CreateStatement: sqlRow[1].(string), - CreatedAt: sqlRow[2].(time.Time), - ModifiedAt: sqlRow[3].(time.Time), + Name: sqlRow.GetValue(0).(string), + CreateStatement: sqlRow.GetValue(1).(string), + CreatedAt: sqlRow.GetValue(2).(time.Time), + ModifiedAt: sqlRow.GetValue(3).(time.Time), }, true, nil } else if err == io.EOF { return sql.StoredProcedureDetails{}, false, nil diff --git a/go/libraries/doltcore/sqle/procedures_table_test.go b/go/libraries/doltcore/sqle/procedures_table_test.go index 13cb86abd24..cc6e50aada3 100644 --- a/go/libraries/doltcore/sqle/procedures_table_test.go +++ b/go/libraries/doltcore/sqle/procedures_table_test.go @@ -50,7 +50,7 @@ func TestProceduresMigration(t *testing.T) { // Assert that the data was migrated correctly rows := readAllRows(ctx, t, tbl) - expectedRows := []sql.Row{ + expectedRows := []sql.UntypedSqlRow{ {"proc1", "create procedure proc1() SELECT 42 as pk from dual;", timestamp, timestamp, nil}, {"proc2", "create procedure proc2() SELECT 'HELLO' as greeting from dual;", timestamp, timestamp, nil}, } @@ -73,7 +73,7 @@ func TestProceduresMigration(t *testing.T) { require.NotNil(t, wrapper.backingTable) rows := readAllRows(ctx, t, wrapper.backingTable) - expectedRows := []sql.Row{ + expectedRows := []sql.UntypedSqlRow{ {"proc1", "create procedure proc1() SELECT 42 as pk from dual;", timestamp, timestamp, nil}, {"proc2", "create procedure proc2() SELECT 'HELLO' as greeting from dual;", timestamp, timestamp, nil}, } @@ -102,7 +102,7 @@ func TestProceduresMigration(t *testing.T) { require.NotNil(t, wrapper.backingTable) rows := readAllRows(ctx, t, wrapper.backingTable) - expectedRows := []sql.Row{ + expectedRows := []sql.UntypedSqlRow{ {"proc1", "create procedure proc1() SELECT 42 as pk from dual;", timestamp, timestamp, nil}, {"proc2", "create procedure proc2() SELECT 'HELLO' as greeting from dual;", timestamp, timestamp, nil}, {"proc3", "create procedure proc3() SELECT 47 as pk from dual;", timestamp, timestamp, "NO_ENGINE_SUBSTITUTION"}, @@ -138,8 +138,8 @@ func newDatabaseWithProcedures(t *testing.T, dEnv *env.DoltEnv, opts editor.Opti // Insert some test data for procedures inserter := wrapper.backingTable.Inserter(ctx) - require.NoError(t, inserter.Insert(ctx, sql.Row{"proc1", "create procedure proc1() SELECT 42 as pk from dual;", timestamp, timestamp})) - require.NoError(t, inserter.Insert(ctx, sql.Row{"proc2", "create procedure proc2() SELECT 'HELLO' as greeting from dual;", timestamp, timestamp})) + require.NoError(t, inserter.Insert(ctx, sql.UntypedSqlRow{"proc1", "create procedure proc1() SELECT 42 as pk from dual;", timestamp, timestamp})) + require.NoError(t, inserter.Insert(ctx, sql.UntypedSqlRow{"proc2", "create procedure proc2() SELECT 'HELLO' as greeting from dual;", timestamp, timestamp})) require.NoError(t, inserter.Close(ctx)) return ctx, &db diff --git a/go/libraries/doltcore/sqle/rows.go b/go/libraries/doltcore/sqle/rows.go index 430418f0ccb..b26aff33076 100644 --- a/go/libraries/doltcore/sqle/rows.go +++ b/go/libraries/doltcore/sqle/rows.go @@ -48,8 +48,8 @@ func (k *keylessRowIter) Next(ctx *sql.Context) (sql.Row, error) { return nil, err } - k.lastCard = r[k.cardIdx].(uint64) - k.lastRead = r[:k.nonCardCols] + k.lastCard = r.GetValue(k.cardIdx).(uint64) + k.lastRead = r.Subslice(0,k.nonCardCols) } k.lastCard-- diff --git a/go/libraries/doltcore/sqle/schema_override.go b/go/libraries/doltcore/sqle/schema_override.go index c64e975af96..0a35e87dede 100644 --- a/go/libraries/doltcore/sqle/schema_override.go +++ b/go/libraries/doltcore/sqle/schema_override.go @@ -192,7 +192,7 @@ func rowConverterByColTagAndName(srcSchema, targetSchema schema.Schema, projecte } return func(ctx *sql.Context, row sql.Row) (sql.Row, error) { - r := make(sql.Row, len(projectedColNames)) + r := make(sql.UntypedSqlRow, len(projectedColNames)) for i, tag := range projectedTags { // First try to find the column in the src schema with the matching tag // then fallback to a name match, since type changes will change the tag @@ -203,7 +203,7 @@ func rowConverterByColTagAndName(srcSchema, targetSchema schema.Schema, projecte if found { srcIndex := srcSchema.GetAllCols().IndexOf(srcColumn.Name) - temp := row[srcIndex] + temp := row.GetValue(srcIndex) conversionType := srcIndexToTargetType[srcIndex] @@ -212,7 +212,7 @@ func rowConverterByColTagAndName(srcSchema, targetSchema schema.Schema, projecte return nil, err } - r[i] = convertedValue + r.SetValue(i, convertedValue) } } return r, nil diff --git a/go/libraries/doltcore/sqle/schema_table.go b/go/libraries/doltcore/sqle/schema_table.go index 2369e5b66c9..0dc7f66b03c 100644 --- a/go/libraries/doltcore/sqle/schema_table.go +++ b/go/libraries/doltcore/sqle/schema_table.go @@ -303,15 +303,15 @@ func migrateOldSchemasTableToNew(ctx *sql.Context, db Database, schemasTable *Wr return nil, err } - newRow := make(sql.Row, SchemaTableSchema().GetAllCols().Size()) - newRow[0] = sqlRow[typeIdx] - newRow[1] = sqlRow[nameIdx] - newRow[2] = sqlRow[fragmentIdx] + newRow := make(sql.UntypedSqlRow, SchemaTableSchema().GetAllCols().Size()) + newRow[0] = sqlRow.GetValue(typeIdx) + newRow[1] = sqlRow.GetValue(nameIdx) + newRow[2] = sqlRow.GetValue(fragmentIdx) if extraIdx >= 0 { - newRow[3] = sqlRow[extraIdx] + newRow[3] = sqlRow.GetValue(extraIdx) } if sqlModeIdx >= 0 { - newRow[4] = sqlRow[sqlModeIdx] + newRow[4] = sqlRow.GetValue(sqlModeIdx) } newRows = append(newRows, newRow) @@ -394,7 +394,7 @@ func fragFromSchemasTable(ctx *sql.Context, tbl *WritableDoltTable, fragType str } // These columns are case insensitive, make sure to do a case-insensitive comparison - if strings.EqualFold(sqlRow[typeIdx].(string), fragType) && strings.EqualFold(sqlRow[nameIdx].(string), name) { + if strings.EqualFold(sqlRow.GetValue(typeIdx).(string), fragType) && strings.EqualFold(sqlRow.GetValue(nameIdx).(string), name) { return sqlRow, true, nil } } @@ -442,13 +442,13 @@ func getSchemaFragmentsOfType(ctx *sql.Context, tbl *WritableDoltTable, fragType return nil, err } - if sqlRow[typeIdx] != fragType { + if sqlRow.GetValue(typeIdx) != fragType { continue } sqlModeString := "" if sqlModeIdx >= 0 { - if s, ok := sqlRow[sqlModeIdx].(string); ok { + if s, ok := sqlRow.GetValue(sqlModeIdx).(string); ok { sqlModeString = s } } else { @@ -460,10 +460,10 @@ func getSchemaFragmentsOfType(ctx *sql.Context, tbl *WritableDoltTable, fragType } // For older tables, use 1 as the trigger creation time - if extraIdx < 0 || sqlRow[extraIdx] == nil { + if extraIdx < 0 || sqlRow.GetValue(extraIdx) == nil { frags = append(frags, schemaFragment{ - name: sqlRow[nameIdx].(string), - fragment: sqlRow[fragmentIdx].(string), + name: sqlRow.GetValue(nameIdx).(string), + fragment: sqlRow.GetValue(fragmentIdx).(string), created: time.Unix(1, 0).UTC(), // TablePlus editor thinks 0 is out of range sqlMode: sqlModeString, }) @@ -471,14 +471,14 @@ func getSchemaFragmentsOfType(ctx *sql.Context, tbl *WritableDoltTable, fragType } // Extract Created Time from JSON column - createdTime, err := getCreatedTime(ctx, sqlRow[extraIdx].(sql.JSONWrapper)) + createdTime, err := getCreatedTime(ctx, sqlRow.GetValue(extraIdx).(sql.JSONWrapper)) if err != nil { return nil, err } frags = append(frags, schemaFragment{ - name: sqlRow[nameIdx].(string), - fragment: sqlRow[fragmentIdx].(string), + name: sqlRow.GetValue(nameIdx).(string), + fragment: sqlRow.GetValue(fragmentIdx).(string), created: time.Unix(createdTime, 0).UTC(), sqlMode: sqlModeString, }) diff --git a/go/libraries/doltcore/sqle/schema_table_test.go b/go/libraries/doltcore/sqle/schema_table_test.go index 768e7f7cc77..018ef2efcdd 100644 --- a/go/libraries/doltcore/sqle/schema_table_test.go +++ b/go/libraries/doltcore/sqle/schema_table_test.go @@ -58,9 +58,9 @@ func TestAncientSchemaTableMigration(t *testing.T) { require.Equal(t, 3, len(wrapper.backingTable.Schema())) inserter := wrapper.backingTable.Inserter(ctx) - err = inserter.Insert(ctx, sql.Row{"view", "view1", "SELECT v1 FROM test;"}) + err = inserter.Insert(ctx, sql.UntypedSqlRow{"view", "view1", "SELECT v1 FROM test;"}) require.NoError(t, err) - err = inserter.Insert(ctx, sql.Row{"view", "view2", "SELECT v2 FROM test;"}) + err = inserter.Insert(ctx, sql.UntypedSqlRow{"view", "view2", "SELECT v2 FROM test;"}) require.NoError(t, err) err = inserter.Close(ctx) require.NoError(t, err) @@ -83,7 +83,7 @@ func TestAncientSchemaTableMigration(t *testing.T) { } require.NoError(t, iter.Close(ctx)) - expectedRows := []sql.Row{ + expectedRows := []sql.UntypedSqlRow{ {"view", "view1", "SELECT v1 FROM test;", nil, nil}, {"view", "view2", "SELECT v2 FROM test;", nil, nil}, } diff --git a/go/libraries/doltcore/sqle/show_create_table.go b/go/libraries/doltcore/sqle/show_create_table.go index deab24085c8..4b21b91fd44 100644 --- a/go/libraries/doltcore/sqle/show_create_table.go +++ b/go/libraries/doltcore/sqle/show_create_table.go @@ -50,10 +50,10 @@ func GetCreateTableStmt(ctx *sql.Context, engine *sqle.Engine, tableName string) if err != nil { return "", err } - if len(rows) != 1 || len(rows[0]) != 2 { + if len(rows) != 1 || rows[0].Len() != 2 { return "", fmt.Errorf("unexpected result from SHOW CREATE TABLE") } - stmt, ok := rows[0][1].(string) + stmt, ok := rows[0].GetValue(1).(string) if !ok { return "", fmt.Errorf("expected string statement from SHOW CREATE TABLE") } diff --git a/go/libraries/doltcore/sqle/sqldelete_test.go b/go/libraries/doltcore/sqle/sqldelete_test.go index b5e62b04359..a97b45126ad 100644 --- a/go/libraries/doltcore/sqle/sqldelete_test.go +++ b/go/libraries/doltcore/sqle/sqldelete_test.go @@ -41,7 +41,7 @@ type DeleteTest struct { // The schema of the result of the query, nil if an error is expected ExpectedSchema schema.Schema // The rows this query should return, nil if an error is expected - ExpectedRows []sql.Row + ExpectedRows []sql.UntypedSqlRow // An expected error string ExpectedErr string // Setup logic to run before executing this test, after initial tables have been created and populated @@ -193,7 +193,7 @@ var systemTableDeleteTests = []DeleteTest{ "INSERT INTO dolt_docs VALUES ('LICENSE.md','A license')"), DeleteQuery: "delete from dolt_docs where doc_name = 'LICENSE.md'", SelectQuery: "select * from dolt_docs", - ExpectedRows: []sql.Row{}, + ExpectedRows: []sql.UntypedSqlRow{}, ExpectedSchema: CompressSchema(doltdb.DocsSchema), }, { diff --git a/go/libraries/doltcore/sqle/sqlfmt/row_fmt.go b/go/libraries/doltcore/sqle/sqlfmt/row_fmt.go index 696271feef3..c772d41be66 100644 --- a/go/libraries/doltcore/sqle/sqlfmt/row_fmt.go +++ b/go/libraries/doltcore/sqle/sqlfmt/row_fmt.go @@ -259,12 +259,12 @@ func SqlRowAsCreateProcStmt(r sql.Row) (string, error) { b.WriteString(prefix) // Write procedure name - nameStr := r[0].(string) + nameStr := r.GetValue(0).(string) b.WriteString(QuoteIdentifier(nameStr)) b.WriteString(" ") // add a space // Write definition - defStmt, err := sqlparser.Parse(r[1].(string)) + defStmt, err := sqlparser.Parse(r.GetValue(1).(string)) if err != nil { return "", err } @@ -282,16 +282,16 @@ func SqlRowAsCreateFragStmt(r sql.Row) (string, error) { var b strings.Builder // If type is view, add DROP VIEW IF EXISTS statement before CREATE VIEW STATEMENT - typeStr := strings.ToUpper(r[0].(string)) + typeStr := strings.ToUpper(r.GetValue(0).(string)) if typeStr == "VIEW" { - nameStr := r[1].(string) + nameStr := r.GetValue(1).(string) dropStmt := fmt.Sprintf("DROP VIEW IF EXISTS `%s`", nameStr) b.WriteString(dropStmt) b.WriteString(";\n") } // Parse statement to extract definition (and remove any weird whitespace issues) - defStmt, err := sqlparser.Parse(r[2].(string)) + defStmt, err := sqlparser.Parse(r.GetValue(2).(string)) if err != nil { return "", err } @@ -300,7 +300,7 @@ func SqlRowAsCreateFragStmt(r sql.Row) (string, error) { // TODO: this is temporary fix for create statements if typeStr == "TRIGGER" { - nameStr := r[1].(string) + nameStr := r.GetValue(1).(string) defStr = fmt.Sprintf("CREATE TRIGGER `%s` %s", nameStr, defStr[len("CREATE TRIGGER ")+len(nameStr)+1:]) } else { defStr = strings.Replace(defStr, "create ", "CREATE ", -1) @@ -342,7 +342,7 @@ func SqlRowAsTupleString(r sql.Row, tableSch schema.Schema) (string, error) { b.WriteString("(") seenOne := false - for i, val := range r { + for i, val := range r.Values() { if seenOne { b.WriteRune(',') } @@ -366,9 +366,9 @@ func SqlRowAsTupleString(r sql.Row, tableSch schema.Schema) (string, error) { // SqlRowAsStrings returns the string representation for each column of |r| // which should have schema |sch|. func SqlRowAsStrings(r sql.Row, sch sql.Schema) ([]string, error) { - out := make([]string, len(r)) + out := make([]string, r.Len()) for i := range out { - v := r[i] + v := r.GetValue(i) sqlType := sch[i].Type s, err := sqlutil.SqlColToStr(sqlType, v) if err != nil { @@ -395,7 +395,7 @@ func SqlRowAsDeleteStmt(r sql.Row, tableName string, tableSch schema.Schema, lim if seenOne { b.WriteString(" AND ") } - sqlString, err := interfaceValueAsSqlString(col.TypeInfo, r[i]) + sqlString, err := interfaceValueAsSqlString(col.TypeInfo, r.GetValue(i)) if err != nil { return true, err } @@ -442,7 +442,7 @@ func SqlRowAsUpdateStmt(r sql.Row, tableName string, tableSch schema.Schema, col } seenOne = true - sqlString, err := interfaceValueAsSqlString(col.TypeInfo, r[i]) + sqlString, err := interfaceValueAsSqlString(col.TypeInfo, r.GetValue(i)) if err != nil { return true, err } @@ -469,7 +469,7 @@ func SqlRowAsUpdateStmt(r sql.Row, tableName string, tableSch schema.Schema, col } seenOne = true - sqlString, err := interfaceValueAsSqlString(col.TypeInfo, r[i]) + sqlString, err := interfaceValueAsSqlString(col.TypeInfo, r.GetValue(i)) if err != nil { return true, err } diff --git a/go/libraries/doltcore/sqle/sqlfmt/schema_fmt.go b/go/libraries/doltcore/sqle/sqlfmt/schema_fmt.go index fd174dbfc84..a64fe5cfb01 100644 --- a/go/libraries/doltcore/sqle/sqlfmt/schema_fmt.go +++ b/go/libraries/doltcore/sqle/sqlfmt/schema_fmt.go @@ -29,8 +29,8 @@ import ( // GenerateDataDiffStatement returns any data diff in SQL statements for given table including INSERT, UPDATE and DELETE row statements. func GenerateDataDiffStatement(tableName string, sch schema.Schema, row sql.Row, rowDiffType diff.ChangeType, colDiffTypes []diff.ChangeType) (string, error) { - if len(row) != len(colDiffTypes) { - return "", fmt.Errorf("expected the same size for columns and diff types, got %d and %d", len(row), len(colDiffTypes)) + if row.Len() != len(colDiffTypes) { + return "", fmt.Errorf("expected the same size for columns and diff types, got %d and %d", row.Len(), len(colDiffTypes)) } switch rowDiffType { @@ -221,7 +221,7 @@ func GenerateCreateTableIndentedColumnDefinition(col schema.Column, tableCollati // GenerateCreateTableIndexDefinition returns index definition for CREATE TABLE statement with indentation of 2 spaces func GenerateCreateTableIndexDefinition(index schema.Index) string { - return sql.GenerateCreateTableIndexDefinition(index.IsUnique(), index.IsSpatial(), index.IsFullText(), false, index.Name(), + return sql.GenerateCreateTableIndexDefinition(index.IsUnique(), index.IsSpatial(), index.IsFullText(), index.Name(), sql.QuoteIdentifiers(index.ColumnNames()), index.Comment()) } diff --git a/go/libraries/doltcore/sqle/sqlinsert_test.go b/go/libraries/doltcore/sqle/sqlinsert_test.go index e734516bfc8..151d69ff7ff 100644 --- a/go/libraries/doltcore/sqle/sqlinsert_test.go +++ b/go/libraries/doltcore/sqle/sqlinsert_test.go @@ -46,7 +46,7 @@ type InsertTest struct { // The schema of the result of the query, nil if an error is expected ExpectedSchema schema.Schema // The rows this query should return, nil if an error is expected - ExpectedRows []sql.Row + ExpectedRows []sql.UntypedSqlRow // An expected error string ExpectedErr string // Setup logic to run before executing this test, after initial tables have been created and populated @@ -380,7 +380,7 @@ var systemTableInsertTests = []InsertTest{ AdditionalSetup: CreateTableFn("dolt_docs", doltdb.DocsSchema, ""), InsertQuery: "insert into dolt_docs (doc_name, doc_text) values ('README.md', 'Some text')", SelectQuery: "select * from dolt_docs", - ExpectedRows: []sql.Row{{"README.md", "Some text"}}, + ExpectedRows: []sql.UntypedSqlRow{{"README.md", "Some text"}}, ExpectedSchema: CompressSchema(doltdb.DocsSchema), }, { diff --git a/go/libraries/doltcore/sqle/sqlpersist_test.go b/go/libraries/doltcore/sqle/sqlpersist_test.go index b0eb9a00c7e..baafee23e66 100644 --- a/go/libraries/doltcore/sqle/sqlpersist_test.go +++ b/go/libraries/doltcore/sqle/sqlpersist_test.go @@ -39,7 +39,7 @@ type PersistTest struct { // The schema of the result of the query, nil if an error is expected ExpectedSchema schema.Schema // The rows this query should return, nil if an error is expected - ExpectedRows []sql.Row + ExpectedRows []sql.UntypedSqlRow // The rows this query should return, nil if an error is expected ExpectedConfig map[string]string // An expected error string diff --git a/go/libraries/doltcore/sqle/sqlreplace_test.go b/go/libraries/doltcore/sqle/sqlreplace_test.go index 790abd85ff3..65772dbe191 100644 --- a/go/libraries/doltcore/sqle/sqlreplace_test.go +++ b/go/libraries/doltcore/sqle/sqlreplace_test.go @@ -43,7 +43,7 @@ type ReplaceTest struct { // The schema of the result of the query, nil if an error is expected ExpectedSchema schema.Schema // The rows this query should return, nil if an error is expected - ExpectedRows []sql.Row + ExpectedRows []sql.UntypedSqlRow // An expected error string ExpectedErr string // Setup logic to run before executing this test, after initial tables have been created and populated @@ -256,7 +256,7 @@ var systemTableReplaceTests = []ReplaceTest{ "INSERT INTO dolt_docs VALUES ('LICENSE.md','A license')"), ReplaceQuery: "replace into dolt_docs (doc_name, doc_text) values ('LICENSE.md', 'Some text')", SelectQuery: "select * from dolt_docs", - ExpectedRows: []sql.Row{{"LICENSE.md", "Some text"}}, + ExpectedRows: []sql.UntypedSqlRow{{"LICENSE.md", "Some text"}}, ExpectedSchema: CompressSchema(doltdb.DocsSchema), }, { diff --git a/go/libraries/doltcore/sqle/sqlselect_test.go b/go/libraries/doltcore/sqle/sqlselect_test.go index 7f8fc08464d..4254e4a5782 100644 --- a/go/libraries/doltcore/sqle/sqlselect_test.go +++ b/go/libraries/doltcore/sqle/sqlselect_test.go @@ -55,7 +55,7 @@ type SelectTest struct { // the schema is difficult to specify with dolt schemas. ExpectedSqlSchema sql.Schema // The rows this query should return, nil if an error is expected - ExpectedRows []sql.Row + ExpectedRows []sql.UntypedSqlRow // An expected error string ExpectedErr string // Setup logic to run before executing this test, after initial tables have been created and populated @@ -463,7 +463,7 @@ func BasicSelectTests() []SelectTest { { Name: "and expression in select", Query: "select is_married and age >= 40 from people where last_name = 'Simpson' order by id limit 2", - ExpectedRows: []sql.Row{{true}, {false}}, + ExpectedRows: []sql.UntypedSqlRow{{true}, {false}}, ExpectedSqlSchema: sql.Schema{ &sql.Column{Name: "is_married and age >= 40", Type: gmstypes.Boolean}, }, @@ -471,7 +471,7 @@ func BasicSelectTests() []SelectTest { { Name: "or expression in select", Query: "select first_name, age <= 10 or age >= 40 as not_marge from people where last_name = 'Simpson' order by id desc", - ExpectedRows: []sql.Row{ + ExpectedRows: []sql.UntypedSqlRow{ {"Lisa", true}, {"Bart", true}, {"Marge", false}, @@ -600,7 +600,7 @@ func BasicSelectTests() []SelectTest { { Name: "column selected more than once", Query: "select first_name, first_name from people where age >= 40 order by id", - ExpectedRows: []sql.Row{ + ExpectedRows: []sql.UntypedSqlRow{ {"Homer", "Homer"}, {"Moe", "Moe"}, {"Barney", "Barney"}, @@ -720,7 +720,7 @@ func BasicSelectTests() []SelectTest { Type: gmstypes.Int8, }, }, - ExpectedRows: []sql.Row{{int8(1)}}, + ExpectedRows: []sql.UntypedSqlRow{{int8(1)}}, }, { Name: "unknown column in where", @@ -746,7 +746,7 @@ func BasicSelectTests() []SelectTest { { Name: "select * from log system table", Query: "select * from dolt_log", - ExpectedRows: []sql.Row{ + ExpectedRows: []sql.UntypedSqlRow{ { headCommitHash, "billy bob", @@ -766,7 +766,7 @@ func BasicSelectTests() []SelectTest { { Name: "select * from conflicts system table", Query: "select * from dolt_conflicts", - ExpectedRows: []sql.Row{}, + ExpectedRows: []sql.UntypedSqlRow{}, ExpectedSqlSchema: sql.Schema{ &sql.Column{Name: "table", Type: gmstypes.Text}, &sql.Column{Name: "num_conflicts", Type: gmstypes.Uint64}, @@ -775,7 +775,7 @@ func BasicSelectTests() []SelectTest { { Name: "select * from branches system table", Query: "select * from dolt_branches", - ExpectedRows: []sql.Row{ + ExpectedRows: []sql.UntypedSqlRow{ { env.DefaultInitBranch, headCommitHash, @@ -987,7 +987,7 @@ var AsOfTests = []SelectTest{ AdditionalSetup: CreateTableFn("dolt_docs", doltdb.DocsSchema, "INSERT INTO dolt_docs VALUES ('LICENSE.md','A license')"), Query: "select * from dolt_docs as of 'main'", - ExpectedRows: []sql.Row{{"LICENSE.md", "A license"}}, + ExpectedRows: []sql.UntypedSqlRow{{"LICENSE.md", "A license"}}, ExpectedSchema: CompressSchema(doltdb.DocsSchema), }, } @@ -1292,7 +1292,7 @@ var systemTableSelectTests = []SelectTest{ AdditionalSetup: CreateTableFn("dolt_docs", doltdb.DocsSchema, "INSERT INTO dolt_docs VALUES ('LICENSE.md','A license')"), Query: "select * from dolt_docs", - ExpectedRows: []sql.Row{{"LICENSE.md", "A license"}}, + ExpectedRows: []sql.UntypedSqlRow{{"LICENSE.md", "A license"}}, ExpectedSchema: CompressSchema(doltdb.DocsSchema), }, { @@ -1310,7 +1310,7 @@ var systemTableSelectTests = []SelectTest{ AdditionalSetup: CreateTableFn(doltdb.SchemasTableName, SchemaTableSchema(), `CREATE VIEW name as select 2+2 from dual`), Query: "select * from dolt_schemas", - ExpectedRows: []sql.Row{{"view", "name", "CREATE VIEW name as select 2+2 from dual", ignoreVal, "NO_ENGINE_SUBSTITUTION,ONLY_FULL_GROUP_BY,STRICT_TRANS_TABLES"}}, + ExpectedRows: []sql.UntypedSqlRow{{"view", "name", "CREATE VIEW name as select 2+2 from dual", ignoreVal, "NO_ENGINE_SUBSTITUTION,ONLY_FULL_GROUP_BY,STRICT_TRANS_TABLES"}}, ExpectedSchema: CompressSchema(SchemaTableSchema()), }, } diff --git a/go/libraries/doltcore/sqle/sqlupdate_test.go b/go/libraries/doltcore/sqle/sqlupdate_test.go index 2ca58d78858..757f3bff060 100644 --- a/go/libraries/doltcore/sqle/sqlupdate_test.go +++ b/go/libraries/doltcore/sqle/sqlupdate_test.go @@ -47,7 +47,7 @@ type UpdateTest struct { // The schema of the result of the query, nil if an error is expected ExpectedSchema schema.Schema // The rows this query should return, nil if an error is expected - ExpectedRows []sql.Row + ExpectedRows []sql.UntypedSqlRow // An expected error string ExpectedErr string // Setup logic to run before executing this test, after initial tables have been created and populated @@ -364,7 +364,7 @@ var systemTableUpdateTests = []UpdateTest{ "INSERT INTO dolt_docs VALUES ('LICENSE.md','A license')"), UpdateQuery: "update dolt_docs set doc_text = 'Some text';", SelectQuery: "select * from dolt_docs", - ExpectedRows: []sql.Row{{"LICENSE.md", "Some text"}}, + ExpectedRows: []sql.UntypedSqlRow{{"LICENSE.md", "Some text"}}, ExpectedSchema: CompressSchema(doltdb.DocsSchema), }, { @@ -373,7 +373,7 @@ var systemTableUpdateTests = []UpdateTest{ "INSERT INTO dolt_query_catalog VALUES ('abc123', 1, 'example', 'select 2+2 from dual', 'description')"), UpdateQuery: "update dolt_query_catalog set display_order = display_order + 1", SelectQuery: "select * from dolt_query_catalog", - ExpectedRows: []sql.Row{{"abc123", uint64(2), "example", "select 2+2 from dual", "description"}}, + ExpectedRows: []sql.UntypedSqlRow{{"abc123", uint64(2), "example", "select 2+2 from dual", "description"}}, ExpectedSchema: CompressSchema(dtables.DoltQueryCatalogSchema), }, } diff --git a/go/libraries/doltcore/sqle/sqlutil/sql_row.go b/go/libraries/doltcore/sqle/sqlutil/sql_row.go index 7ef3eeebe1c..8a7870b0f0c 100644 --- a/go/libraries/doltcore/sqle/sqlutil/sql_row.go +++ b/go/libraries/doltcore/sqle/sqlutil/sql_row.go @@ -34,7 +34,7 @@ func DoltRowToSqlRow(doltRow row.Row, sch schema.Schema) (sql.Row, error) { return nil, nil } - colVals := make(sql.Row, sch.GetAllCols().Size()) + colVals := make(sql.UntypedSqlRow, sch.GetAllCols().Size()) i := 0 _, err := doltRow.IterSchema(sch, func(tag uint64, val types.Value) (stop bool, err error) { @@ -73,7 +73,7 @@ func DoltKeyValueAndMappingFromSqlRow(ctx context.Context, vrw types.ValueReadWr pkVals := vals[numNonPKVals:] for i, c := range doltSchema.GetAllCols().GetColumns() { - val := r[i] + val := r.GetValue(i) if val == nil { continue } @@ -139,13 +139,13 @@ func DoltKeyAndMappingFromSqlRow(ctx context.Context, vrw types.ValueReadWriter, pkVals := make([]types.Value, numPKCols*2) tagToVal := make(map[uint64]types.Value, numCols) - if len(r) < numCols { - numCols = len(r) + if r.Len() < numCols { + numCols = r.Len() } for i := 0; i < numCols; i++ { schCol := allCols.GetByIndex(i) - val := r[i] + val := r.GetValue(i) if val == nil { continue } @@ -163,7 +163,7 @@ func DoltKeyAndMappingFromSqlRow(ctx context.Context, vrw types.ValueReadWriter, pkOrds := doltSchema.GetPkOrdinals() for i, pkCol := range pkCols.GetColumns() { ord := pkOrds[i] - val := r[ord] + val := r.GetValue(ord) if val == nil { return types.Tuple{}, nil, errors.New("not all pk columns have a value") } @@ -184,7 +184,7 @@ func DoltKeyAndMappingFromSqlRow(ctx context.Context, vrw types.ValueReadWriter, func pkDoltRowFromSqlRow(ctx context.Context, vrw types.ValueReadWriter, r sql.Row, doltSchema schema.Schema) (row.Row, error) { taggedVals := make(row.TaggedValues) allCols := doltSchema.GetAllCols() - for i, val := range r { + for i, val := range r.Values() { tag := allCols.Tags[i] schCol := allCols.TagToCol[tag] if val != nil { @@ -202,7 +202,7 @@ func keylessDoltRowFromSqlRow(ctx context.Context, vrw types.ValueReadWriter, sq j := 0 vals := make([]types.Value, sch.GetAllCols().Size()*2) - for idx, val := range sqlRow { + for idx, val := range sqlRow.Values() { if val != nil { col := sch.GetAllCols().GetByIndex(idx) nv, err := col.TypeInfo.ConvertValueToNomsValue(ctx, vrw, val) diff --git a/go/libraries/doltcore/sqle/statsnoms/iter.go b/go/libraries/doltcore/sqle/statsnoms/iter.go index 59b9456eed6..b1396281a72 100644 --- a/go/libraries/doltcore/sqle/statsnoms/iter.go +++ b/go/libraries/doltcore/sqle/statsnoms/iter.go @@ -83,13 +83,13 @@ func (s *statsIter) Next(ctx *sql.Context) (sql.Row, error) { return nil, fmt.Errorf("%w: write version %d does not match read version %d", ErrIncompatibleVersion, version, schema.StatsVersion) } - var row sql.Row + var row sql.Row = new(sql.UntypedSqlRow) for i := 0; i < s.kb.Desc.Count(); i++ { f, err := tree.GetField(ctx, s.kb.Desc, i, k, s.ns) if err != nil { return nil, err } - row = append(row, f) + row = row.Append(sql.NewUntypedRow(f)) } for i := 0; i < s.vb.Desc.Count(); i++ { @@ -97,23 +97,23 @@ func (s *statsIter) Next(ctx *sql.Context) (sql.Row, error) { if err != nil { return nil, err } - row = append(row, f) + row = row.Append(sql.NewUntypedRow(f)) } - dbName := row[schema.StatsDbTag].(string) - tableName := row[schema.StatsTableTag].(string) - indexName := row[schema.StatsIndexTag].(string) - position := row[schema.StatsPositionTag].(int64) - _ = row[schema.StatsVersionTag] - commit := hash.Parse(row[schema.StatsCommitHashTag].(string)) - rowCount := row[schema.StatsRowCountTag].(int64) - distinctCount := row[schema.StatsDistinctCountTag].(int64) - nullCount := row[schema.StatsNullCountTag].(int64) - columnsStr := row[schema.StatsColumnsTag].(string) - typesStr := row[schema.StatsTypesTag].(string) - upperBoundStr := row[schema.StatsUpperBoundTag].(string) - upperBoundCnt := row[schema.StatsUpperBoundCntTag].(int64) - createdAt := row[schema.StatsCreatedAtTag].(time.Time) + dbName := row.GetValue(int(schema.StatsDbTag)).(string) + tableName := row.GetValue(int(schema.StatsTableTag)).(string) + indexName := row.GetValue(int(schema.StatsIndexTag)).(string) + position := row.GetValue(int(schema.StatsPositionTag)).(int64) + _ = row.GetValue(int(schema.StatsVersionTag)) + commit := hash.Parse(row.GetValue(int(schema.StatsCommitHashTag)).(string)) + rowCount := row.GetValue(int(schema.StatsRowCountTag)).(int64) + distinctCount := row.GetValue(int(schema.StatsDistinctCountTag)).(int64) + nullCount := row.GetValue(int(schema.StatsNullCountTag)).(int64) + columnsStr := row.GetValue(int(schema.StatsColumnsTag)).(string) + typesStr := row.GetValue(int(schema.StatsTypesTag)).(string) + upperBoundStr := row.GetValue(int(schema.StatsUpperBoundTag)).(string) + upperBoundCnt := row.GetValue(int(schema.StatsUpperBoundCntTag)).(int64) + createdAt := row.GetValue(int(schema.StatsCreatedAtTag)).(time.Time) typs := strings.Split(typesStr, "\n") for i, t := range typs { @@ -129,17 +129,17 @@ func (s *statsIter) Next(ctx *sql.Context) (sql.Row, error) { } } - mcvCountsStr := row[schema.StatsMcvCountsTag].(string) + mcvCountsStr := row.GetValue(int(schema.StatsMcvCountsTag)).(string) numMcvs := schema.StatsMcvCountsTag - schema.StatsMcv1Tag mcvs := make([]string, numMcvs) - for i, v := range row[schema.StatsMcv1Tag:schema.StatsMcvCountsTag] { + for i, v := range row.Subslice(int(schema.StatsMcv1Tag), int(schema.StatsMcvCountsTag)).Values() { if v != nil { mcvs[i] = v.(string) } } - return sql.Row{ + return sql.UntypedSqlRow{ dbName, tableName, indexName, @@ -166,7 +166,7 @@ func (s *statsIter) ParseRow(rowStr string) (sql.Row, error) { if err != nil { return nil, err } - row = append(row, val) + row = row.Append(sql.NewUntypedRow(val)) } return row, nil } diff --git a/go/libraries/doltcore/sqle/statsnoms/load.go b/go/libraries/doltcore/sqle/statsnoms/load.go index 55b438b1cab..241aadadfb5 100644 --- a/go/libraries/doltcore/sqle/statsnoms/load.go +++ b/go/libraries/doltcore/sqle/statsnoms/load.go @@ -54,19 +54,19 @@ func loadStats(ctx *sql.Context, db dsess.SqlDatabase, m prolly.Map) (map[sql.St } // deserialize K, V - dbName := row[schema.StatsDbTag].(string) - tableName := row[schema.StatsTableTag].(string) - indexName := row[schema.StatsIndexTag].(string) - _ = row[schema.StatsVersionTag] - commit := hash.Parse(row[schema.StatsCommitHashTag].(string)) - rowCount := row[schema.StatsRowCountTag].(uint64) - distinctCount := row[schema.StatsDistinctCountTag].(uint64) - nullCount := row[schema.StatsNullCountTag].(uint64) - columns := strings.Split(row[schema.StatsColumnsTag].(string), ",") - typesStr := row[schema.StatsTypesTag].(string) - boundRowStr := row[schema.StatsUpperBoundTag].(string) - upperBoundCnt := row[schema.StatsUpperBoundCntTag].(uint64) - createdAt := row[schema.StatsCreatedAtTag].(time.Time) + dbName := row.GetValue(int(schema.StatsDbTag)).(string) + tableName := row.GetValue(int(schema.StatsTableTag)).(string) + indexName := row.GetValue(int(schema.StatsIndexTag)).(string) + _ = row.GetValue(int(schema.StatsVersionTag)) + commit := hash.Parse(row.GetValue(int(schema.StatsCommitHashTag)).(string)) + rowCount := row.GetValue(int(schema.StatsRowCountTag)).(uint64) + distinctCount := row.GetValue(int(schema.StatsDistinctCountTag)).(uint64) + nullCount := row.GetValue(int(schema.StatsNullCountTag)).(uint64) + columns := strings.Split(row.GetValue(int(schema.StatsColumnsTag)).(string), ",") + typesStr := row.GetValue(int(schema.StatsTypesTag)).(string) + boundRowStr := row.GetValue(int(schema.StatsUpperBoundTag)).(string) + upperBoundCnt := row.GetValue(int(schema.StatsUpperBoundCntTag)).(uint64) + createdAt := row.GetValue(int(schema.StatsCreatedAtTag)).(time.Time) typs := strings.Split(typesStr, "\n") for i, t := range typs { @@ -101,7 +101,7 @@ func loadStats(ctx *sql.Context, db dsess.SqlDatabase, m prolly.Map) (map[sql.St numMcvs := schema.StatsMcvCountsTag - schema.StatsMcv1Tag - mcvCountsStr := strings.Split(row[schema.StatsMcvCountsTag].(string), ",") + mcvCountsStr := strings.Split(row.GetValue(int(schema.StatsMcvCountsTag)).(string), ",") mcvCnts := make([]uint64, numMcvs) for i, v := range mcvCountsStr { if v == "" { @@ -115,7 +115,7 @@ func loadStats(ctx *sql.Context, db dsess.SqlDatabase, m prolly.Map) (map[sql.St } mcvs := make([]sql.Row, numMcvs) - for i, v := range row[schema.StatsMcv1Tag:schema.StatsMcvCountsTag] { + for i, v := range row.Subslice(int(schema.StatsMcv1Tag), int(schema.StatsMcvCountsTag)).Values() { if v != nil && v != "" { row, err := DecodeRow(ctx, m.NodeStore(), v.(string), currentStat.Tb) if err != nil { @@ -153,10 +153,10 @@ func loadStats(ctx *sql.Context, db dsess.SqlDatabase, m prolly.Map) (map[sql.St RowCnt: uint64(rowCount), DistinctCnt: uint64(distinctCount), NullCnt: uint64(nullCount), - McvVals: mcvs, + McvVals: sql.RowsToUntyped(mcvs), McvsCnt: mcvCnts, BoundCnt: upperBoundCnt, - BoundVal: boundRow, + BoundVal: boundRow.Values(), }, } @@ -237,7 +237,7 @@ func loadLowerBound(ctx *sql.Context, db dsess.SqlDatabase, qual sql.StatQualifi } firstKey := keyBuilder.Build(buffPool) - firstRow := make(sql.Row, keyBuilder.Desc.Count()) + firstRow := make(sql.UntypedSqlRow, keyBuilder.Desc.Count()) for i := 0; i < keyBuilder.Desc.Count(); i++ { firstRow[i], err = tree.GetField(ctx, prollyMap.KeyDesc(), i, firstKey, prollyMap.NodeStore()) if err != nil { diff --git a/go/libraries/doltcore/sqle/statsnoms/write.go b/go/libraries/doltcore/sqle/statsnoms/write.go index c23e1d93dc8..27fea187bc1 100644 --- a/go/libraries/doltcore/sqle/statsnoms/write.go +++ b/go/libraries/doltcore/sqle/statsnoms/write.go @@ -141,9 +141,9 @@ func putIndexRows(ctx context.Context, statsMap *prolly.MutableMap, dStats *stat } valueBuilder.PutString(10+i, string(mcvRow)) } - var mcvCntsRow sql.Row + var mcvCntsRow sql.Row = new(sql.UntypedSqlRow) for _, v := range h.McvCounts() { - mcvCntsRow = append(mcvCntsRow, int(v)) + mcvCntsRow = mcvCntsRow.Append(sql.NewUntypedRow(int(v))) } valueBuilder.PutString(14, stats.StringifyKey(mcvCntsRow, mcvsTypes)) @@ -156,7 +156,7 @@ func putIndexRows(ctx context.Context, statsMap *prolly.MutableMap, dStats *stat } func EncodeRow(ctx context.Context, ns tree.NodeStore, r sql.Row, tb *val.TupleBuilder) ([]byte, error) { - for i, v := range r { + for i, v := range r.Values() { if v == nil { continue } @@ -169,13 +169,15 @@ func EncodeRow(ctx context.Context, ns tree.NodeStore, r sql.Row, tb *val.TupleB func DecodeRow(ctx context.Context, ns tree.NodeStore, s string, tb *val.TupleBuilder) (sql.Row, error) { tup := []byte(s) - r := make(sql.Row, tb.Desc.Count()) + r := make(sql.UntypedSqlRow, tb.Desc.Count()) var err error + var v interface{} for i, _ := range r { - r[i], err = tree.GetField(ctx, tb.Desc, i, tup, ns) + v, err = tree.GetField(ctx, tb.Desc, i, tup, ns) if err != nil { return nil, err } + r.SetValue(i, v) } return r, nil } diff --git a/go/libraries/doltcore/sqle/statspro/dolt_stats.go b/go/libraries/doltcore/sqle/statspro/dolt_stats.go index 4c5d43250c9..c62d26bf512 100644 --- a/go/libraries/doltcore/sqle/statspro/dolt_stats.go +++ b/go/libraries/doltcore/sqle/statspro/dolt_stats.go @@ -265,8 +265,8 @@ func DoltHistFromSql(hist sql.Histogram, types []sql.Type) (sql.Histogram, error ret := make(sql.Histogram, len(hist)) var err error for i, b := range hist { - upperBound := make(sql.Row, len(b.UpperBound())) - for i, v := range b.UpperBound() { + upperBound := make(sql.UntypedSqlRow, b.UpperBound().Len()) + for i, v := range b.UpperBound().Values() { upperBound[i], _, err = types[i].Convert(v) if err != nil { return nil, fmt.Errorf("failed to convert %v to type %s", v, types[i].String()) @@ -274,12 +274,13 @@ func DoltHistFromSql(hist sql.Histogram, types []sql.Type) (sql.Histogram, error } mcvs := make([]sql.Row, len(b.Mcvs())) for i, mcv := range b.Mcvs() { - for _, v := range mcv { + mcvs[i] = make(sql.UntypedSqlRow, mcv.Len()) + for j, v := range mcv.Values() { conv, _, err := types[i].Convert(v) if err != nil { return nil, fmt.Errorf("failed to convert %v to type %s", v, types[i].String()) } - mcvs[i] = append(mcvs[i], conv) + mcvs[i].SetValue(j, conv) } } ret[i] = DoltBucket{ diff --git a/go/libraries/doltcore/sqle/statspro/update.go b/go/libraries/doltcore/sqle/statspro/update.go index 562e82c5679..c251fc73db2 100644 --- a/go/libraries/doltcore/sqle/statspro/update.go +++ b/go/libraries/doltcore/sqle/statspro/update.go @@ -209,7 +209,7 @@ func firstRowForIndex(ctx *sql.Context, prollyMap prolly.Map, keyBuilder *val.Tu } firstKey := keyBuilder.BuildPrefixNoRecycle(buffPool, prefixLen) - firstRow := make(sql.Row, prefixLen) + firstRow := make(sql.UntypedSqlRow, prefixLen) for i := 0; i < prefixLen; i++ { firstRow[i], err = tree.GetField(ctx, prollyMap.KeyDesc(), i, firstKey, prollyMap.NodeStore()) if err != nil { @@ -278,7 +278,7 @@ func (u *bucketBuilder) finalize(ctx context.Context, ns tree.NodeStore) (DoltBu if err != nil { return DoltBucket{}, err } - upperBound := make(sql.Row, u.prefixLen) + upperBound := make(sql.UntypedSqlRow, u.prefixLen) if u.currentKey != nil { for i := 0; i < u.prefixLen; i++ { upperBound[i], err = tree.GetField(ctx, u.tupleDesc, i, u.currentKey, ns) @@ -292,7 +292,7 @@ func (u *bucketBuilder) finalize(ctx context.Context, ns tree.NodeStore) (DoltBu RowCnt: uint64(u.count), DistinctCnt: uint64(u.distinct), BoundCnt: uint64(u.currentCnt), - McvVals: mcvRows, + McvVals: sql.RowsToUntyped(mcvRows), McvsCnt: u.mcvs.Counts(), BoundVal: upperBound, NullCnt: uint64(u.nulls), @@ -391,15 +391,17 @@ func (m *mcvHeap) Truncate(cutoff float64) { func (m mcvHeap) Values(ctx context.Context, keyDesc val.TupleDesc, ns tree.NodeStore, prefixLen int) ([]sql.Row, error) { ret := make([]sql.Row, len(m)) + var v interface{} for i, mcv := range m { // todo build sql.Row - row := make(sql.Row, prefixLen) + row := make(sql.UntypedSqlRow, prefixLen) var err error for i := 0; i < prefixLen; i++ { - row[i], err = tree.GetField(ctx, keyDesc, i, mcv.val, ns) + v, err = tree.GetField(ctx, keyDesc, i, mcv.val, ns) if err != nil { return nil, err } + row.SetValue(i, v) } ret[i] = row } diff --git a/go/libraries/doltcore/sqle/statspro/update_test.go b/go/libraries/doltcore/sqle/statspro/update_test.go index ef670e19c8b..c3200a7f9fe 100644 --- a/go/libraries/doltcore/sqle/statspro/update_test.go +++ b/go/libraries/doltcore/sqle/statspro/update_test.go @@ -59,27 +59,27 @@ func TestMcvHeap(t *testing.T) { func TestBucketBuilder(t *testing.T) { tests := []struct { name string - keys []sql.Row + keys []sql.UntypedSqlRow keyDesc val.TupleDesc bucket DoltBucket }{ { name: "ints", - keys: []sql.Row{{1}, {1}, {1}, {2}, {2}, {2}, {2}, {3}, {3}, {3}, {4}, {4}, {4}, {5}, {5}}, + keys: []sql.UntypedSqlRow{{1}, {1}, {1}, {2}, {2}, {2}, {2}, {3}, {3}, {3}, {4}, {4}, {4}, {5}, {5}}, keyDesc: val.NewTupleDescriptor(val.Type{Enc: val.Int64Enc, Nullable: false}), bucket: DoltBucket{Bucket: &stats.Bucket{ RowCnt: 15, DistinctCnt: 5, McvVals: []sql.Row{}, McvsCnt: []uint64{}, - BoundVal: sql.Row{int64(5)}, + BoundVal: sql.UntypedSqlRow{int64(5)}, BoundCnt: 2, }}, }, { // technically nulls should be at beginning name: "ints with middle nulls", - keys: []sql.Row{{1}, {1}, {1}, {2}, {2}, {2}, {2}, {nil}, {nil}, {nil}, {3}, {4}, {4}, {4}, {5}, {5}}, + keys: []sql.UntypedSqlRow{{1}, {1}, {1}, {2}, {2}, {2}, {2}, {nil}, {nil}, {nil}, {3}, {4}, {4}, {4}, {5}, {5}}, keyDesc: val.NewTupleDescriptor(val.Type{Enc: val.Int64Enc, Nullable: true}), bucket: DoltBucket{Bucket: &stats.Bucket{ RowCnt: 16, @@ -87,13 +87,13 @@ func TestBucketBuilder(t *testing.T) { NullCnt: 3, McvVals: []sql.Row{}, McvsCnt: []uint64{}, - BoundVal: sql.Row{int64(5)}, + BoundVal: sql.UntypedSqlRow{int64(5)}, BoundCnt: 2, }}, }, { name: "ints with beginning nulls", - keys: []sql.Row{{nil}, {nil}, {1}, {2}, {2}, {2}, {2}, {3}, {3}, {3}, {4}, {4}, {4}, {5}, {5}}, + keys: []sql.UntypedSqlRow{{nil}, {nil}, {1}, {2}, {2}, {2}, {2}, {3}, {3}, {3}, {4}, {4}, {4}, {5}, {5}}, keyDesc: val.NewTupleDescriptor(val.Type{Enc: val.Int64Enc, Nullable: true}), bucket: DoltBucket{Bucket: &stats.Bucket{ RowCnt: 15, @@ -101,13 +101,13 @@ func TestBucketBuilder(t *testing.T) { NullCnt: 2, McvVals: []sql.Row{}, McvsCnt: []uint64{}, - BoundVal: sql.Row{int64(5)}, + BoundVal: sql.UntypedSqlRow{int64(5)}, BoundCnt: 2, }}, }, { name: "more ints", - keys: []sql.Row{{1}, {1}, {1}, {2}, {2}, {2}, {2}, {3}, {3}, {3}, {4}, {4}, {4}, {5}, {5}, {5}, {5}, {6}, {6}, {6}, {6}, {7}}, + keys: []sql.UntypedSqlRow{{1}, {1}, {1}, {2}, {2}, {2}, {2}, {3}, {3}, {3}, {4}, {4}, {4}, {5}, {5}, {5}, {5}, {6}, {6}, {6}, {6}, {7}}, keyDesc: val.NewTupleDescriptor(val.Type{Enc: val.Int64Enc, Nullable: false}), bucket: DoltBucket{Bucket: &stats.Bucket{ RowCnt: 22, @@ -115,25 +115,25 @@ func TestBucketBuilder(t *testing.T) { BoundCnt: 1, McvVals: []sql.Row{}, McvsCnt: []uint64{}, - BoundVal: sql.Row{int64(7)}, + BoundVal: sql.UntypedSqlRow{int64(7)}, }}, }, { name: "2-ints", - keys: []sql.Row{{1, 1}, {1, 1}, {1, 2}, {2, 1}, {2, 2}, {2, 3}, {2, 3}, {3, 1}, {3, 2}, {3, 3}, {4, 1}, {4, 1}, {4, 1}, {5, 1}, {5, 2}}, + keys: []sql.UntypedSqlRow{{1, 1}, {1, 1}, {1, 2}, {2, 1}, {2, 2}, {2, 3}, {2, 3}, {3, 1}, {3, 2}, {3, 3}, {4, 1}, {4, 1}, {4, 1}, {5, 1}, {5, 2}}, keyDesc: val.NewTupleDescriptor(val.Type{Enc: val.Int64Enc, Nullable: false}, val.Type{Enc: val.Int64Enc, Nullable: false}), bucket: DoltBucket{Bucket: &stats.Bucket{ RowCnt: 15, DistinctCnt: 11, - McvVals: []sql.Row{{int64(4), int64(1)}}, + McvVals: []sql.Row{sql.UntypedSqlRow{int64(4), int64(1)}}, McvsCnt: []uint64{3}, - BoundVal: sql.Row{int64(5), int64(2)}, + BoundVal: sql.UntypedSqlRow{int64(5), int64(2)}, BoundCnt: 1, }}, }, { name: "2-ints with nulls", - keys: []sql.Row{{nil, 1}, {1, nil}, {1, 2}, {2, nil}, {2, 2}}, + keys: []sql.UntypedSqlRow{{nil, 1}, {1, nil}, {1, 2}, {2, nil}, {2, 2}}, keyDesc: val.NewTupleDescriptor(val.Type{Enc: val.Int64Enc, Nullable: true}, val.Type{Enc: val.Int64Enc, Nullable: true}), bucket: DoltBucket{Bucket: &stats.Bucket{ RowCnt: 5, @@ -141,46 +141,46 @@ func TestBucketBuilder(t *testing.T) { NullCnt: 3, McvVals: []sql.Row{}, McvsCnt: []uint64{}, - BoundVal: sql.Row{int64(2), int64(2)}, + BoundVal: sql.UntypedSqlRow{int64(2), int64(2)}, BoundCnt: 1}, }, }, { name: "varchars", - keys: []sql.Row{{"a"}, {"b"}, {"c"}, {"d"}, {"e"}, {"e"}, {"f"}, {"g"}, {"g"}, {"g"}, {"h"}, {"h"}, {"h"}, {"i"}, {"i"}}, + keys: []sql.UntypedSqlRow{{"a"}, {"b"}, {"c"}, {"d"}, {"e"}, {"e"}, {"f"}, {"g"}, {"g"}, {"g"}, {"h"}, {"h"}, {"h"}, {"i"}, {"i"}}, keyDesc: val.NewTupleDescriptor(val.Type{Enc: val.StringEnc, Nullable: false}), bucket: DoltBucket{Bucket: &stats.Bucket{ RowCnt: 15, DistinctCnt: 9, McvVals: []sql.Row{}, McvsCnt: []uint64{}, - BoundVal: sql.Row{"i"}, + BoundVal: sql.UntypedSqlRow{"i"}, BoundCnt: 2, }}, }, { name: "varchar-ints", - keys: []sql.Row{{"a", 1}, {"b", 1}, {"c", 1}, {"d", 1}, {"e", 1}, {"e", 2}, {"f", 1}, {"g", 1}, {"g", 2}, {"g", 2}, {"h", 1}, {"h", 1}, {"h", 2}, {"i", 1}, {"i", 1}}, + keys: []sql.UntypedSqlRow{{"a", 1}, {"b", 1}, {"c", 1}, {"d", 1}, {"e", 1}, {"e", 2}, {"f", 1}, {"g", 1}, {"g", 2}, {"g", 2}, {"h", 1}, {"h", 1}, {"h", 2}, {"i", 1}, {"i", 1}}, keyDesc: val.NewTupleDescriptor(val.Type{Enc: val.StringEnc, Nullable: false}, val.Type{Enc: val.Int64Enc, Nullable: false}), bucket: DoltBucket{Bucket: &stats.Bucket{ RowCnt: 15, DistinctCnt: 12, McvVals: []sql.Row{}, McvsCnt: []uint64{}, - BoundVal: sql.Row{"i", int64(1)}, + BoundVal: sql.UntypedSqlRow{"i", int64(1)}, BoundCnt: 2, }}, }, { name: "mcvs", - keys: []sql.Row{{1}, {2}, {3}, {4}, {5}, {6}, {7}, {7}, {7}, {7}, {8}, {9}, {10}, {10}, {10}, {11}, {12}, {13}, {14}, {15}, {20}, {21}, {22}}, + keys: []sql.UntypedSqlRow{{1}, {2}, {3}, {4}, {5}, {6}, {7}, {7}, {7}, {7}, {8}, {9}, {10}, {10}, {10}, {11}, {12}, {13}, {14}, {15}, {20}, {21}, {22}}, keyDesc: val.NewTupleDescriptor(val.Type{Enc: val.Int64Enc, Nullable: false}), bucket: DoltBucket{Bucket: &stats.Bucket{ RowCnt: 23, DistinctCnt: 18, - McvVals: []sql.Row{{int64(10)}, {int64(7)}}, + McvVals: []sql.Row{sql.UntypedSqlRow{int64(10)}, sql.UntypedSqlRow{int64(7)}}, McvsCnt: []uint64{3, 4}, - BoundVal: sql.Row{int64(22)}, + BoundVal: sql.UntypedSqlRow{int64(22)}, BoundCnt: 1, }}, }, diff --git a/go/libraries/doltcore/sqle/table_editor_fk_test.go b/go/libraries/doltcore/sqle/table_editor_fk_test.go index a468aba4cba..8d08e62507f 100644 --- a/go/libraries/doltcore/sqle/table_editor_fk_test.go +++ b/go/libraries/doltcore/sqle/table_editor_fk_test.go @@ -78,9 +78,9 @@ func TestTableEditorForeignKeyCascade(t *testing.T) { tests := []struct { name string sqlStatement string - expectedOne []sql.Row - expectedTwo []sql.Row - expectedThree []sql.Row + expectedOne []sql.UntypedSqlRow + expectedTwo []sql.UntypedSqlRow + expectedThree []sql.UntypedSqlRow }{ { "cascade updates", @@ -89,9 +89,9 @@ func TestTableEditorForeignKeyCascade(t *testing.T) { INSERT INTO three VALUES (3, 1, 1), (4, 2, 2), (5, 3, 3), (6, 4, 4); UPDATE one SET v1 = v1 + v2; UPDATE two SET v2 = v1 - 2;`, - []sql.Row{{1, 5, 4}, {2, 7, 5}, {3, 9, 6}, {4, 9, 5}}, - []sql.Row{{2, 5, 3}, {3, 7, 5}, {4, 9, 7}, {5, 9, 7}}, - []sql.Row{{3, 5, 3}, {4, 7, 5}, {5, 9, 7}, {6, 9, 7}}, + []sql.UntypedSqlRow{{1, 5, 4}, {2, 7, 5}, {3, 9, 6}, {4, 9, 5}}, + []sql.UntypedSqlRow{{2, 5, 3}, {3, 7, 5}, {4, 9, 7}, {5, 9, 7}}, + []sql.UntypedSqlRow{{3, 5, 3}, {4, 7, 5}, {5, 9, 7}, {6, 9, 7}}, }, { "cascade updates and deletes", @@ -101,17 +101,17 @@ func TestTableEditorForeignKeyCascade(t *testing.T) { UPDATE one SET v1 = v1 + v2; DELETE FROM one WHERE pk = 3; UPDATE two SET v2 = v1 - 2;`, - []sql.Row{{1, 5, 4}, {2, 7, 5}, {4, 9, 5}}, - []sql.Row{{2, 5, 3}, {3, 7, 5}}, - []sql.Row{{3, 5, 3}, {4, 7, 5}}, + []sql.UntypedSqlRow{{1, 5, 4}, {2, 7, 5}, {4, 9, 5}}, + []sql.UntypedSqlRow{{2, 5, 3}, {3, 7, 5}}, + []sql.UntypedSqlRow{{3, 5, 3}, {4, 7, 5}}, }, { "cascade insertions", `INSERT INTO three VALUES (1, NULL, NULL), (2, NULL, 2), (3, 3, NULL); INSERT INTO two VALUES (1, NULL, 1);`, - []sql.Row{}, - []sql.Row{{1, nil, 1}}, - []sql.Row{{1, nil, nil}, {2, nil, 2}, {3, 3, nil}}, + []sql.UntypedSqlRow{}, + []sql.UntypedSqlRow{{1, nil, 1}}, + []sql.UntypedSqlRow{{1, nil, nil}, {2, nil, 2}, {3, 3, nil}}, }, { "cascade updates and deletes after table and column renames", @@ -124,18 +124,18 @@ func TestTableEditorForeignKeyCascade(t *testing.T) { DELETE FROM new WHERE pk = 3; UPDATE two SET v2 = v1 - 2; RENAME TABLE new TO one;`, - []sql.Row{{1, 5, 4}, {2, 7, 5}, {4, 9, 5}}, - []sql.Row{{2, 5, 3}, {3, 7, 5}}, - []sql.Row{{3, 5, 3}, {4, 7, 5}}, + []sql.UntypedSqlRow{{1, 5, 4}, {2, 7, 5}, {4, 9, 5}}, + []sql.UntypedSqlRow{{2, 5, 3}, {3, 7, 5}}, + []sql.UntypedSqlRow{{3, 5, 3}, {4, 7, 5}}, }, { "cascade inserts and deletes", `INSERT INTO one VALUES (1, 1, 1), (2, 2, 2), (3, 3, 3); INSERT INTO two VALUES (1, 1, 1), (2, 2, 2), (3, 3, 3); DELETE FROM one;`, - []sql.Row{}, - []sql.Row{}, - []sql.Row{}, + []sql.UntypedSqlRow{}, + []sql.UntypedSqlRow{}, + []sql.UntypedSqlRow{}, }, { "cascade inserts and deletes (ep. 2)", @@ -144,9 +144,9 @@ func TestTableEditorForeignKeyCascade(t *testing.T) { INSERT INTO three VALUES (1, NULL, 1), (2, NULL, 2); DELETE FROM one; DELETE FROM two WHERE pk = 2`, - []sql.Row{}, - []sql.Row{{1, nil, 1}}, - []sql.Row{{1, nil, 1}, {2, nil, 2}}, + []sql.UntypedSqlRow{}, + []sql.UntypedSqlRow{{1, nil, 1}}, + []sql.UntypedSqlRow{{1, nil, 1}, {2, nil, 2}}, }, } @@ -178,8 +178,8 @@ ALTER TABLE three ADD FOREIGN KEY (v1, v2) REFERENCES two(v1, v2) ON DELETE CASC func TestTableEditorForeignKeySetNull(t *testing.T) { tests := []struct { sqlStatement string - expectedOne []sql.Row - expectedTwo []sql.Row + expectedOne []sql.UntypedSqlRow + expectedTwo []sql.UntypedSqlRow }{ { `INSERT INTO one VALUES (1, 1, 1), (2, 2, 2), (3, 3, 3); @@ -188,15 +188,15 @@ func TestTableEditorForeignKeySetNull(t *testing.T) { INSERT INTO one VALUES (4, 4, 4); INSERT INTO two VALUES (4, 4, 4); UPDATE one SET v2 = v1 * v2;`, - []sql.Row{{1, 1, 1}, {2, 4, 8}, {3, 9, 27}, {4, 4, 16}}, - []sql.Row{{1, 1, 1}, {2, nil, 2}, {3, nil, 3}, {4, 4, 4}}, + []sql.UntypedSqlRow{{1, 1, 1}, {2, 4, 8}, {3, 9, 27}, {4, 4, 16}}, + []sql.UntypedSqlRow{{1, 1, 1}, {2, nil, 2}, {3, nil, 3}, {4, 4, 4}}, }, { `INSERT INTO one VALUES (1, 1, 1), (2, 2, 2), (3, 3, 3), (4, 4, 4), (5, 5, 5); INSERT INTO two VALUES (1, 1, 1), (2, 2, 2), (4, 4, 4), (5, 5, 5); DELETE FROM one WHERE pk BETWEEN 3 AND 4;`, - []sql.Row{{1, 1, 1}, {2, 2, 2}, {5, 5, 5}}, - []sql.Row{{1, 1, 1}, {2, 2, 2}, {4, nil, 4}, {5, 5, 5}}, + []sql.UntypedSqlRow{{1, 1, 1}, {2, 2, 2}, {5, 5, 5}}, + []sql.UntypedSqlRow{{1, 1, 1}, {2, 2, 2}, {4, nil, 4}, {5, 5, 5}}, }, } @@ -387,52 +387,52 @@ func TestTableEditorSelfReferentialForeignKeyRestrict(t *testing.T) { sequentialTests := []struct { statement string - currentTbl []sql.Row + currentTbl []sql.UntypedSqlRow expectedErr bool }{ { "ALTER TABLE parent ADD CONSTRAINT fk_named FOREIGN KEY (v2) REFERENCES parent(v1);", - []sql.Row{}, + []sql.UntypedSqlRow{}, false, }, { "INSERT INTO parent VALUES (1,1,1), (2, 2, 1), (3, 3, NULL);", - []sql.Row{{1, 1, 1}, {2, 2, 1}, {3, 3, nil}}, + []sql.UntypedSqlRow{{1, 1, 1}, {2, 2, 1}, {3, 3, nil}}, false, }, { "UPDATE parent SET v1 = 1 WHERE id = 1;", - []sql.Row{{1, 1, 1}, {2, 2, 1}, {3, 3, nil}}, + []sql.UntypedSqlRow{{1, 1, 1}, {2, 2, 1}, {3, 3, nil}}, false, }, { "UPDATE parent SET v1 = 4 WHERE id = 3;", - []sql.Row{{1, 1, 1}, {2, 2, 1}, {3, 4, nil}}, + []sql.UntypedSqlRow{{1, 1, 1}, {2, 2, 1}, {3, 4, nil}}, false, }, { "DELETE FROM parent WHERE id = 3;", - []sql.Row{{1, 1, 1}, {2, 2, 1}}, + []sql.UntypedSqlRow{{1, 1, 1}, {2, 2, 1}}, false, }, { "DELETE FROM parent WHERE v1 = 1;", - []sql.Row{}, + []sql.UntypedSqlRow{}, true, }, { "UPDATE parent SET v1 = 2;", - []sql.Row{}, + []sql.UntypedSqlRow{}, true, }, { "REPLACE INTO parent VALUES (1, 1, 1);", - []sql.Row{}, + []sql.UntypedSqlRow{}, true, }, { "UPDATE parent SET v1 = 3, v2 = 3 WHERE id = 2;", - []sql.Row{{1, 1, 1}, {2, 3, 3}}, + []sql.UntypedSqlRow{{1, 1, 1}, {2, 3, 3}}, false, }, } @@ -458,82 +458,82 @@ func TestTableEditorSelfReferentialForeignKeyCascade(t *testing.T) { sequentialTests := []struct { statement string - currentTbl []sql.Row + currentTbl []sql.UntypedSqlRow expectedErr bool }{ { "ALTER TABLE parent ADD CONSTRAINT fk_named FOREIGN KEY (v2) REFERENCES parent(v1) ON UPDATE CASCADE ON DELETE CASCADE;", - []sql.Row{}, + []sql.UntypedSqlRow{}, false, }, { "INSERT INTO parent VALUES (1,1,1), (2, 2, 1), (3, 3, NULL);", - []sql.Row{{1, 1, 1}, {2, 2, 1}, {3, 3, nil}}, + []sql.UntypedSqlRow{{1, 1, 1}, {2, 2, 1}, {3, 3, nil}}, false, }, { "UPDATE parent SET v1 = 1 WHERE id = 1;", - []sql.Row{{1, 1, 1}, {2, 2, 1}, {3, 3, nil}}, + []sql.UntypedSqlRow{{1, 1, 1}, {2, 2, 1}, {3, 3, nil}}, false, }, { "UPDATE parent SET v1 = 4 WHERE id = 3;", - []sql.Row{{1, 1, 1}, {2, 2, 1}, {3, 4, nil}}, + []sql.UntypedSqlRow{{1, 1, 1}, {2, 2, 1}, {3, 4, nil}}, false, }, { "DELETE FROM parent WHERE id = 3;", - []sql.Row{{1, 1, 1}, {2, 2, 1}}, + []sql.UntypedSqlRow{{1, 1, 1}, {2, 2, 1}}, false, }, { "UPDATE parent SET v1 = 2;", - []sql.Row{}, + []sql.UntypedSqlRow{}, true, }, { "REPLACE INTO parent VALUES (1, 1, 1), (2, 2, 2);", - []sql.Row{{1, 1, 1}, {2, 2, 2}}, + []sql.UntypedSqlRow{{1, 1, 1}, {2, 2, 2}}, false, }, { // Repeated UPDATE ensures that it still fails even with changed data "UPDATE parent SET v1 = 2;", - []sql.Row{}, + []sql.UntypedSqlRow{}, true, }, { "UPDATE parent SET v1 = 2 WHERE id = 1;", - []sql.Row{}, + []sql.UntypedSqlRow{}, true, }, { "REPLACE INTO parent VALUES (1,1,2), (2,2,1);", - []sql.Row{}, + []sql.UntypedSqlRow{}, true, }, { "UPDATE parent SET v2 = 2 WHERE id = 1;", - []sql.Row{{1, 1, 2}, {2, 2, 2}}, + []sql.UntypedSqlRow{{1, 1, 2}, {2, 2, 2}}, false, }, { "UPDATE parent SET v2 = 1 WHERE id = 2;", - []sql.Row{{1, 1, 2}, {2, 2, 1}}, + []sql.UntypedSqlRow{{1, 1, 2}, {2, 2, 1}}, false, }, { // Repeated UPDATE ensures that it still fails even with changed data "UPDATE parent SET v1 = 2;", - []sql.Row{}, + []sql.UntypedSqlRow{}, true, }, { "UPDATE parent SET v1 = 2 WHERE id = 1;", - []sql.Row{}, + []sql.UntypedSqlRow{}, true, }, { "DELETE FROM parent WHERE v1 = 1;", - []sql.Row{}, + []sql.UntypedSqlRow{}, false, }, } @@ -559,82 +559,82 @@ func TestTableEditorSelfReferentialForeignKeySetNull(t *testing.T) { sequentialTests := []struct { statement string - currentTbl []sql.Row + currentTbl []sql.UntypedSqlRow expectedErr bool }{ { "ALTER TABLE parent ADD CONSTRAINT fk_named FOREIGN KEY (v2) REFERENCES parent(v1) ON UPDATE SET NULL ON DELETE SET NULL;", - []sql.Row{}, + []sql.UntypedSqlRow{}, false, }, { "INSERT INTO parent VALUES (1,1,1), (2, 2, 1), (3, 3, NULL);", - []sql.Row{{1, 1, 1}, {2, 2, 1}, {3, 3, nil}}, + []sql.UntypedSqlRow{{1, 1, 1}, {2, 2, 1}, {3, 3, nil}}, false, }, { "UPDATE parent SET v1 = 1 WHERE id = 1;", - []sql.Row{{1, 1, 1}, {2, 2, 1}, {3, 3, nil}}, + []sql.UntypedSqlRow{{1, 1, 1}, {2, 2, 1}, {3, 3, nil}}, false, }, { "UPDATE parent SET v1 = 4 WHERE id = 3;", - []sql.Row{{1, 1, 1}, {2, 2, 1}, {3, 4, nil}}, + []sql.UntypedSqlRow{{1, 1, 1}, {2, 2, 1}, {3, 4, nil}}, false, }, { "DELETE FROM parent WHERE id = 3;", - []sql.Row{{1, 1, 1}, {2, 2, 1}}, + []sql.UntypedSqlRow{{1, 1, 1}, {2, 2, 1}}, false, }, { "UPDATE parent SET v1 = 2;", - []sql.Row{}, + []sql.UntypedSqlRow{}, true, }, { "REPLACE INTO parent VALUES (1, 1, 1), (2, 2, 2);", - []sql.Row{{1, 1, 1}, {2, 2, 2}}, + []sql.UntypedSqlRow{{1, 1, 1}, {2, 2, 2}}, false, }, { // Repeated UPDATE ensures that it still fails even with changed data "UPDATE parent SET v1 = 2;", - []sql.Row{}, + []sql.UntypedSqlRow{}, true, }, { "UPDATE parent SET v1 = 2 WHERE id = 1;", - []sql.Row{}, + []sql.UntypedSqlRow{}, true, }, { "REPLACE INTO parent VALUES (1,1,2), (2,2,1);", - []sql.Row{{1, 1, nil}, {2, 2, 1}}, + []sql.UntypedSqlRow{{1, 1, nil}, {2, 2, 1}}, false, }, { "UPDATE parent SET v2 = 2 WHERE id = 1;", - []sql.Row{{1, 1, 2}, {2, 2, 1}}, + []sql.UntypedSqlRow{{1, 1, 2}, {2, 2, 1}}, false, }, { "UPDATE parent SET v2 = 1 WHERE id = 2;", - []sql.Row{{1, 1, 2}, {2, 2, 1}}, + []sql.UntypedSqlRow{{1, 1, 2}, {2, 2, 1}}, false, }, { // Repeated UPDATE ensures that it still fails even with changed data "UPDATE parent SET v1 = 2;", - []sql.Row{}, + []sql.UntypedSqlRow{}, true, }, { "UPDATE parent SET v1 = 2 WHERE id = 1;", - []sql.Row{}, + []sql.UntypedSqlRow{}, true, }, { "DELETE FROM parent WHERE v1 = 1;", - []sql.Row{{2, 2, nil}}, + []sql.UntypedSqlRow{{2, 2, nil}}, false, }, } @@ -651,7 +651,7 @@ func TestTableEditorSelfReferentialForeignKeySetNull(t *testing.T) { } } -func assertTableEditorRows(t *testing.T, root doltdb.RootValue, expected []sql.Row, tableName string) { +func assertTableEditorRows(t *testing.T, root doltdb.RootValue, expected []sql.UntypedSqlRow, tableName string) { tbl, ok, err := root.GetTable(context.Background(), doltdb.TableName{Name: tableName}) require.NoError(t, err) require.True(t, ok) @@ -662,7 +662,7 @@ func assertTableEditorRows(t *testing.T, root doltdb.RootValue, expected []sql.R rows, err := tbl.GetRowData(context.Background()) require.NoError(t, err) - var sqlRows []sql.Row + var sqlRows []sql.UntypedSqlRow if len(expected) > 0 { sqlRows, err = SqlRowsFromDurableIndex(rows, sch) require.NoError(t, err) @@ -692,9 +692,9 @@ func assertTableEditorRows(t *testing.T, root doltdb.RootValue, expected []sql.R } } - expectedIndexRows := make([]sql.Row, len(expected)) + expectedIndexRows := make([]sql.UntypedSqlRow, len(expected)) for rowIndex, expectedRow := range expected { - expectedIndex := make(sql.Row, len(index.AllTags())) + expectedIndex := make(sql.UntypedSqlRow, len(index.AllTags())) for colIndex, val := range expectedRow { colPlacement := colPlacements[colIndex] if colPlacement != -1 { @@ -720,7 +720,7 @@ func assertTableEditorRows(t *testing.T, root doltdb.RootValue, expected []sql.R } } -func sortInt64Rows(rows []sql.Row) []sql.Row { +func sortInt64Rows(rows []sql.UntypedSqlRow) []sql.UntypedSqlRow { sort.Slice(rows, func(l, r int) bool { a, b := rows[l], rows[r] for i := range a { @@ -789,9 +789,9 @@ func TestTableEditorKeylessFKCascade(t *testing.T) { tests := []struct { name string sqlStatement string - expectedOne []sql.Row - expectedTwo []sql.Row - expectedThree []sql.Row + expectedOne []sql.UntypedSqlRow + expectedTwo []sql.UntypedSqlRow + expectedThree []sql.UntypedSqlRow }{ { "cascade updates", @@ -800,9 +800,9 @@ func TestTableEditorKeylessFKCascade(t *testing.T) { INSERT INTO three VALUES (3, 1, 1), (4, 2, 2), (5, 3, 3), (6, 4, 4); UPDATE one SET v1 = v1 + v2; UPDATE two SET v2 = v1 - 2;`, - []sql.Row{{1, 5, 4}, {4, 9, 5}, {2, 7, 5}, {3, 9, 6}}, - []sql.Row{{3, 7, 5}, {2, 5, 3}, {5, 9, 7}, {4, 9, 7}}, - []sql.Row{{5, 9, 7}, {6, 9, 7}, {4, 7, 5}, {3, 5, 3}}, + []sql.UntypedSqlRow{{1, 5, 4}, {4, 9, 5}, {2, 7, 5}, {3, 9, 6}}, + []sql.UntypedSqlRow{{3, 7, 5}, {2, 5, 3}, {5, 9, 7}, {4, 9, 7}}, + []sql.UntypedSqlRow{{5, 9, 7}, {6, 9, 7}, {4, 7, 5}, {3, 5, 3}}, }, { "cascade updates and deletes", @@ -812,17 +812,17 @@ func TestTableEditorKeylessFKCascade(t *testing.T) { UPDATE one SET v1 = v1 + v2; DELETE FROM one WHERE pk = 3; UPDATE two SET v2 = v1 - 2;`, - []sql.Row{{1, 5, 4}, {4, 9, 5}, {2, 7, 5}}, - []sql.Row{{3, 7, 5}, {2, 5, 3}}, - []sql.Row{{4, 7, 5}, {3, 5, 3}}, + []sql.UntypedSqlRow{{1, 5, 4}, {4, 9, 5}, {2, 7, 5}}, + []sql.UntypedSqlRow{{3, 7, 5}, {2, 5, 3}}, + []sql.UntypedSqlRow{{4, 7, 5}, {3, 5, 3}}, }, { "cascade insertions", `INSERT INTO three VALUES (1, NULL, NULL), (2, NULL, 2), (3, 3, NULL); INSERT INTO two VALUES (1, NULL, 1);`, - []sql.Row{}, - []sql.Row{{1, nil, 1}}, - []sql.Row{{3, 3, nil}, {2, nil, 2}, {1, nil, nil}}, + []sql.UntypedSqlRow{}, + []sql.UntypedSqlRow{{1, nil, 1}}, + []sql.UntypedSqlRow{{3, 3, nil}, {2, nil, 2}, {1, nil, nil}}, }, { "cascade updates and deletes after table and column renames", @@ -835,18 +835,18 @@ func TestTableEditorKeylessFKCascade(t *testing.T) { DELETE FROM new WHERE pk = 3; UPDATE two SET v2 = v1 - 2; RENAME TABLE new TO one;`, - []sql.Row{{1, 5, 4}, {4, 9, 5}, {2, 7, 5}}, - []sql.Row{{3, 7, 5}, {2, 5, 3}}, - []sql.Row{{4, 7, 5}, {3, 5, 3}}, + []sql.UntypedSqlRow{{1, 5, 4}, {4, 9, 5}, {2, 7, 5}}, + []sql.UntypedSqlRow{{3, 7, 5}, {2, 5, 3}}, + []sql.UntypedSqlRow{{4, 7, 5}, {3, 5, 3}}, }, { "cascade inserts and deletes", `INSERT INTO one VALUES (1, 1, 1), (2, 2, 2), (3, 3, 3); INSERT INTO two VALUES (1, 1, 1), (2, 2, 2), (3, 3, 3); DELETE FROM one;`, - []sql.Row{}, - []sql.Row{}, - []sql.Row{}, + []sql.UntypedSqlRow{}, + []sql.UntypedSqlRow{}, + []sql.UntypedSqlRow{}, }, { "cascade inserts and deletes (ep. 2)", @@ -855,9 +855,9 @@ func TestTableEditorKeylessFKCascade(t *testing.T) { INSERT INTO three VALUES (1, NULL, 1), (2, NULL, 2); DELETE FROM one; DELETE FROM two WHERE pk = 2`, - []sql.Row{}, - []sql.Row{{1, nil, 1}}, - []sql.Row{{2, nil, 2}, {1, nil, 1}}, + []sql.UntypedSqlRow{}, + []sql.UntypedSqlRow{{1, nil, 1}}, + []sql.UntypedSqlRow{{2, nil, 2}, {1, nil, 1}}, }, } diff --git a/go/libraries/doltcore/sqle/table_editor_index_test.go b/go/libraries/doltcore/sqle/table_editor_index_test.go index 46b31e32175..660276e4e1c 100644 --- a/go/libraries/doltcore/sqle/table_editor_index_test.go +++ b/go/libraries/doltcore/sqle/table_editor_index_test.go @@ -75,16 +75,16 @@ CREATE UNIQUE INDEX idx_v1v2 ON twouni(v1, v2); func TestTableEditorIndexResults(t *testing.T) { tests := []struct { sqlStatement string - expectedIdxv1 []sql.Row - expectedIdxv2v1 []sql.Row + expectedIdxv1 []sql.UntypedSqlRow + expectedIdxv2v1 []sql.UntypedSqlRow }{ { ` INSERT INTO onepk VALUES (1, 2, 3), (4, 5, 6), (7, 8, 9); INSERT INTO onepk VALUES (3, 2, 1), (6, 5, 4), (9, 8, 7); `, - []sql.Row{{2, 1}, {2, 3}, {5, 4}, {5, 6}, {8, 7}, {8, 9}}, - []sql.Row{}, + []sql.UntypedSqlRow{{2, 1}, {2, 3}, {5, 4}, {5, 6}, {8, 7}, {8, 9}}, + []sql.UntypedSqlRow{}, }, { ` @@ -92,8 +92,8 @@ INSERT INTO onepk VALUES (1, 11, 111), (2, 22, 222), (3, 33, 333); UPDATE onepk SET v1 = v1 - 1 WHERE pk1 > 1; REPLACE INTO onepk VALUES (3, 55, 555), (4, 44, 444); `, - []sql.Row{{11, 1}, {21, 2}, {44, 4}, {55, 3}}, - []sql.Row{}, + []sql.UntypedSqlRow{{11, 1}, {21, 2}, {44, 4}, {55, 3}}, + []sql.UntypedSqlRow{}, }, { ` @@ -102,8 +102,8 @@ INSERT INTO twopk VALUES (4, 44, 444, 4444); REPLACE INTO twopk VALUES (4, 44, 111, 4444), (5, 55, 222, 5555), (6, 66, 333, 6666); DELETE FROM onepk WHERE v2 = 222; `, - []sql.Row{{11, 1}, {33, 3}}, - []sql.Row{{4444, 111, 4, 44}, {5555, 222, 5, 55}, {6666, 333, 6, 66}}, + []sql.UntypedSqlRow{{11, 1}, {33, 3}}, + []sql.UntypedSqlRow{{4444, 111, 4, 44}, {5555, 222, 5, 55}, {6666, 333, 6, 66}}, }, { ` @@ -112,8 +112,8 @@ DELETE FROM onepk WHERE pk1 % 2 = 1; REPLACE INTO onepk VALUES (3, 6, 2), (-1, 4, -3); UPDATE onepk SET pk1 = v1 + pk1 ORDER BY pk1 DESC; `, - []sql.Row{{2, 4}, {4, 3}, {6, 9}}, - []sql.Row{}, + []sql.UntypedSqlRow{{2, 4}, {4, 3}, {6, 9}}, + []sql.UntypedSqlRow{}, }, } @@ -186,8 +186,8 @@ UPDATE onepk SET pk1 = v1 + pk1 ORDER BY pk1 DESC; func TestTableEditorUniqueIndexResults(t *testing.T) { tests := []struct { sqlStatement string - expectedIdxv1 []sql.Row - expectedIdxv1v2 []sql.Row + expectedIdxv1 []sql.UntypedSqlRow + expectedIdxv1v2 []sql.UntypedSqlRow expectedErr bool }{ { @@ -195,8 +195,8 @@ func TestTableEditorUniqueIndexResults(t *testing.T) { INSERT INTO oneuni VALUES (1, 3, 2), (4, 6, 5), (7, 9, 8); INSERT INTO oneuni VALUES (3, 1, 2), (6, 4, 5), (9, 7, 8); `, - []sql.Row{{1, 3}, {3, 1}, {4, 6}, {6, 4}, {7, 9}, {9, 7}}, - []sql.Row{}, + []sql.UntypedSqlRow{{1, 3}, {3, 1}, {4, 6}, {6, 4}, {7, 9}, {9, 7}}, + []sql.UntypedSqlRow{}, false, }, { @@ -205,8 +205,8 @@ INSERT INTO oneuni VALUES (1, 11, 111), (2, 22, 222), (3, 33, 333); UPDATE oneuni SET v1 = v1 - 1 WHERE pk1 > 1; REPLACE INTO oneuni VALUES (3, 55, 555), (4, 44, 444); `, - []sql.Row{{11, 1}, {21, 2}, {44, 4}, {55, 3}}, - []sql.Row{}, + []sql.UntypedSqlRow{{11, 1}, {21, 2}, {44, 4}, {55, 3}}, + []sql.UntypedSqlRow{}, false, }, { @@ -217,8 +217,8 @@ INSERT INTO twouni VALUES (4, 44, 444, 4444); REPLACE INTO twouni VALUES (4, 44, 111, 4444), (5, 55, 222, 5555), (6, 66, 333, 6666); DELETE FROM oneuni WHERE v1 = 22; `, - []sql.Row{{11, 1}, {33, 3}}, - []sql.Row{{111, 4444, 4, 44}, {222, 5555, 5, 55}, {333, 6666, 6, 66}}, + []sql.UntypedSqlRow{{11, 1}, {33, 3}}, + []sql.UntypedSqlRow{{111, 4444, 4, 44}, {222, 5555, 5, 55}, {333, 6666, 6, 66}}, false, }, { @@ -228,8 +228,8 @@ DELETE FROM oneuni WHERE pk1 % 2 = 1; REPLACE INTO oneuni VALUES (3, 6, 2), (-1, 4, -3); UPDATE oneuni SET pk1 = v1 + v2; `, - []sql.Row{{2, 4}, {4, 1}, {6, 8}}, - []sql.Row{}, + []sql.UntypedSqlRow{{2, 4}, {4, 1}, {6, 8}}, + []sql.UntypedSqlRow{}, false, }, { @@ -238,8 +238,8 @@ INSERT INTO oneuni VALUES (1, 1, 1), (2, 2, 2), (3, 3, 3); DELETE FROM oneuni WHERE v1 < 3; REPLACE INTO oneuni VALUES (4, 2, 2), (5, 3, 3), (3, 1, 1); `, - []sql.Row{{1, 3}, {2, 4}, {3, 5}}, - []sql.Row{}, + []sql.UntypedSqlRow{{1, 3}, {2, 4}, {3, 5}}, + []sql.UntypedSqlRow{}, false, }, { @@ -248,8 +248,8 @@ INSERT INTO oneuni VALUES (1, 1, 1), (2, 2, 2), (3, 3, 3); DELETE FROM oneuni WHERE v1 < 3; REPLACE INTO oneuni VALUES (4, 2, 2), (5, 2, 3), (3, 1, 1); `, - []sql.Row{{1, 3}, {2, 5}}, - []sql.Row{}, + []sql.UntypedSqlRow{{1, 3}, {2, 5}}, + []sql.UntypedSqlRow{}, false, }, { @@ -257,16 +257,16 @@ REPLACE INTO oneuni VALUES (4, 2, 2), (5, 2, 3), (3, 1, 1); INSERT INTO oneuni VALUES (1, 1, 1), (2, 2, 2), (3, 3, 3); REPLACE INTO oneuni VALUES (1, 1, 1), (2, 2, 2), (3, 2, 3); `, - []sql.Row{{1, 1}, {2, 3}}, - []sql.Row{}, + []sql.UntypedSqlRow{{1, 1}, {2, 3}}, + []sql.UntypedSqlRow{}, false, }, { ` INSERT INTO oneuni VALUES (1, 1, 1), (2, 1, 2), (3, 3, 3); `, - []sql.Row{}, - []sql.Row{}, + []sql.UntypedSqlRow{}, + []sql.UntypedSqlRow{}, true, }, { @@ -274,8 +274,8 @@ INSERT INTO oneuni VALUES (1, 1, 1), (2, 1, 2), (3, 3, 3); INSERT INTO oneuni VALUES (1, 2, 3), (2, 1, 4); UPDATE oneuni SET v1 = v1 + pk1; `, - []sql.Row{}, - []sql.Row{}, + []sql.UntypedSqlRow{}, + []sql.UntypedSqlRow{}, true, }, } @@ -353,15 +353,15 @@ UPDATE oneuni SET v1 = v1 + pk1; } } -func convertSqlRowToInt64(sqlRows []sql.Row) []sql.Row { +func convertSqlRowToInt64(sqlRows []sql.UntypedSqlRow) []sql.UntypedSqlRow { if sqlRows == nil { return nil } - newSqlRows := make([]sql.Row, len(sqlRows)) + newSqlRows := make([]sql.UntypedSqlRow, len(sqlRows)) for i, sqlRow := range sqlRows { - newSqlRow := make(sql.Row, len(sqlRow)) + newSqlRow := make(sql.UntypedSqlRow, len(sqlRow)) for j := range sqlRow { - switch v := sqlRow[j].(type) { + switch v := sqlRow.GetValue(j).(type) { case int: newSqlRow[j] = int64(v) case int8: diff --git a/go/libraries/doltcore/sqle/tables.go b/go/libraries/doltcore/sqle/tables.go index c7bbe80f495..2a13dc8e1c4 100644 --- a/go/libraries/doltcore/sqle/tables.go +++ b/go/libraries/doltcore/sqle/tables.go @@ -2413,12 +2413,12 @@ func (t *AlterableDoltTable) getFirstAutoIncrementValue( return 0, err } - cmp, err := columnType.Compare(initialValue, r[colIdx]) + cmp, err := columnType.Compare(initialValue, r.GetValue(colIdx)) if err != nil { return 0, err } if cmp < 0 { - initialValue = r[colIdx] + initialValue = r.GetValue(colIdx) } } diff --git a/go/libraries/doltcore/sqle/testdata.go b/go/libraries/doltcore/sqle/testdata.go index 993b5c45386..389ca9daae0 100644 --- a/go/libraries/doltcore/sqle/testdata.go +++ b/go/libraries/doltcore/sqle/testdata.go @@ -308,7 +308,7 @@ func MutateRow(sch schema.Schema, r row.Row, tagsAndVals ...interface{}) row.Row return mutated } -func GetAllRows(root doltdb.RootValue, tableName string) ([]sql.Row, error) { +func GetAllRows(root doltdb.RootValue, tableName string) ([]sql.UntypedSqlRow, error) { ctx := context.Background() table, _, err := root.GetTable(ctx, doltdb.TableName{Name: tableName}) if err != nil { diff --git a/go/libraries/doltcore/sqle/testutil.go b/go/libraries/doltcore/sqle/testutil.go index aa6276acbf2..ea21749fe51 100644 --- a/go/libraries/doltcore/sqle/testutil.go +++ b/go/libraries/doltcore/sqle/testutil.go @@ -187,11 +187,12 @@ func ExecuteSelect(dEnv *env.DoltEnv, root doltdb.RootValue, query string) ([]sq // Returns the dolt rows given transformed to sql rows. Exactly the columns in the schema provided are present in the // final output rows, even if the input rows contain different columns. The tag numbers for columns in the row and // schema given must match. -func ToSqlRows(sch schema.Schema, rs ...row.Row) []sql.Row { - sqlRows := make([]sql.Row, len(rs)) +func ToSqlRows(sch schema.Schema, rs ...row.Row) []sql.UntypedSqlRow { + sqlRows := make([]sql.UntypedSqlRow, len(rs)) compressedSch := CompressSchema(sch) for i := range rs { - sqlRows[i], _ = sqlutil.DoltRowToSqlRow(CompressRow(sch, rs[i]), compressedSch) + r, _ := sqlutil.DoltRowToSqlRow(CompressRow(sch, rs[i]), compressedSch) + sqlRows[i] = r.Values() } return sqlRows } @@ -499,9 +500,9 @@ func CreateTestDatabase() (*env.DoltEnv, error) { return dEnv, nil } -func SqlRowsFromDurableIndex(idx durable.Index, sch schema.Schema) ([]sql.Row, error) { +func SqlRowsFromDurableIndex(idx durable.Index, sch schema.Schema) ([]sql.UntypedSqlRow, error) { ctx := context.Background() - var sqlRows []sql.Row + var sqlRows []sql.UntypedSqlRow if types.Format_Default == types.Format_DOLT { rowData := durable.ProllyMapFromIndex(idx) kd, vd := rowData.Descriptors() @@ -521,7 +522,7 @@ func SqlRowsFromDurableIndex(idx durable.Index, sch schema.Schema) ([]sql.Row, e if err != nil { return nil, err } - sqlRows = append(sqlRows, sqlRow) + sqlRows = append(sqlRows, sqlRow.Values()) } } else { @@ -536,7 +537,7 @@ func SqlRowsFromDurableIndex(idx durable.Index, sch schema.Schema) ([]sql.Row, e if err != nil { return err } - sqlRows = append(sqlRows, sqlRow) + sqlRows = append(sqlRows, sqlRow.Values()) return nil }) } @@ -546,16 +547,18 @@ func SqlRowsFromDurableIndex(idx durable.Index, sch schema.Schema) ([]sql.Row, e func sqlRowFromTuples(sch schema.Schema, kd, vd val.TupleDesc, k, v val.Tuple) (sql.Row, error) { var err error ctx := context.Background() - r := make(sql.Row, sch.GetAllCols().Size()) + r := make(sql.UntypedSqlRow, sch.GetAllCols().Size()) keyless := schema.IsKeyless(sch) for i, col := range sch.GetAllCols().GetColumns() { pos, ok := sch.GetPKCols().TagToIdx[col.Tag] if ok { - r[i], err = tree.GetField(ctx, kd, pos, k, nil) + var val interface{} + val, err = tree.GetField(ctx, kd, pos, k, nil) if err != nil { return nil, err } + r.SetValue(i, val) } pos, ok = sch.GetNonPKCols().TagToIdx[col.Tag] @@ -563,10 +566,12 @@ func sqlRowFromTuples(sch schema.Schema, kd, vd val.TupleDesc, k, v val.Tuple) ( pos += 1 // compensate for cardinality field } if ok { - r[i], err = tree.GetField(ctx, vd, pos, v, nil) + var val interface{} + val, err = tree.GetField(ctx, vd, pos, v, nil) if err != nil { return nil, err } + r.SetValue(i, val) } } return r, nil diff --git a/go/libraries/doltcore/sqle/views_test.go b/go/libraries/doltcore/sqle/views_test.go index 8e82f1229b6..a079ff60181 100644 --- a/go/libraries/doltcore/sqle/views_test.go +++ b/go/libraries/doltcore/sqle/views_test.go @@ -43,7 +43,7 @@ func TestViews(t *testing.T) { root, err = ExecuteSql(dEnv, root, "create view plus1 as select a + 1 from test") require.NoError(t, err) - expectedRows := []sql.Row{ + expectedRows := []sql.UntypedSqlRow{ {int64(2)}, {int64(3)}, {int64(4)}, diff --git a/go/libraries/doltcore/sqle/writer/noms_table_writer_test.go b/go/libraries/doltcore/sqle/writer/noms_table_writer_test.go index 92cb8f69ce1..8f19b156e04 100644 --- a/go/libraries/doltcore/sqle/writer/noms_table_writer_test.go +++ b/go/libraries/doltcore/sqle/writer/noms_table_writer_test.go @@ -39,7 +39,7 @@ type tableEditorTest struct { // The select query to run to verify the results selectQuery string // The rows this query should return, nil if an error is expected - expectedRows []sql.Row + expectedRows []sql.UntypedSqlRow } func TestTableEditor(t *testing.T) { diff --git a/go/libraries/doltcore/sqle/writer/prolly_fk_indexer.go b/go/libraries/doltcore/sqle/writer/prolly_fk_indexer.go index 0e6631ac6b1..56dd276bcba 100644 --- a/go/libraries/doltcore/sqle/writer/prolly_fk_indexer.go +++ b/go/libraries/doltcore/sqle/writer/prolly_fk_indexer.go @@ -159,7 +159,7 @@ func (iter prollyFkPkRowIter) Next(ctx *sql.Context) (sql.Row, error) { return nil, nil } - nextRow := make(sql.Row, len(iter.primary.keyMap)+len(iter.primary.valMap)) + nextRow := make(sql.UntypedSqlRow, len(iter.primary.keyMap)+len(iter.primary.valMap)) for from := range iter.primary.keyMap { to := iter.primary.keyMap.MapOrdinal(from) if nextRow[to], err = tree.GetField(ctx, iter.primary.keyBld.Desc, from, tblKey, iter.primary.mut.NodeStore()); err != nil { @@ -203,7 +203,7 @@ func (iter prollyFkKeylessRowIter) Next(ctx *sql.Context) (sql.Row, error) { iter.primary.keyBld.PutHash128(0, hashId) primaryKey := iter.primary.keyBld.Build(sharePool) - nextRow := make(sql.Row, len(iter.primary.valMap)) + nextRow := make(sql.UntypedSqlRow, len(iter.primary.valMap)) err = iter.primary.mut.Get(ctx, primaryKey, func(tblKey, tblVal val.Tuple) error { for from := range iter.primary.valMap { to := iter.primary.valMap.MapOrdinal(from) diff --git a/go/libraries/doltcore/sqle/writer/prolly_index_writer.go b/go/libraries/doltcore/sqle/writer/prolly_index_writer.go index af3928f877d..8616e3e0907 100644 --- a/go/libraries/doltcore/sqle/writer/prolly_index_writer.go +++ b/go/libraries/doltcore/sqle/writer/prolly_index_writer.go @@ -108,7 +108,7 @@ func (m prollyIndexWriter) Map(ctx context.Context) (prolly.MapInterface, error) func (m prollyIndexWriter) keyFromRow(ctx context.Context, sqlRow sql.Row) (val.Tuple, error) { for to := range m.keyMap { from := m.keyMap.MapOrdinal(to) - if err := tree.PutField(ctx, m.mut.NodeStore(), m.keyBld, to, sqlRow[from]); err != nil { + if err := tree.PutField(ctx, m.mut.NodeStore(), m.keyBld, to, sqlRow.GetValue(from)); err != nil { return nil, err } } @@ -139,7 +139,7 @@ func (m prollyIndexWriter) Insert(ctx context.Context, sqlRow sql.Row) error { for to := range m.valMap { from := m.valMap.MapOrdinal(to) - if err := tree.PutField(ctx, m.mut.NodeStore(), m.valBld, to, sqlRow[from]); err != nil { + if err := tree.PutField(ctx, m.mut.NodeStore(), m.valBld, to, sqlRow.GetValue(from)); err != nil { return err } } @@ -188,7 +188,7 @@ func (m prollyIndexWriter) Update(ctx context.Context, oldRow sql.Row, newRow sq for to := range m.valMap { from := m.valMap.MapOrdinal(to) - if err = tree.PutField(ctx, m.mut.NodeStore(), m.valBld, to, newRow[from]); err != nil { + if err = tree.PutField(ctx, m.mut.NodeStore(), m.valBld, to, newRow.GetValue(from)); err != nil { return err } } @@ -221,7 +221,7 @@ func (m prollyIndexWriter) errForSecondaryUniqueKeyError(ctx context.Context, er // uniqueKeyError builds a sql.UniqueKeyError. It fetches the existing row using // |key| and passes it as the |existing| row. func (m prollyIndexWriter) uniqueKeyError(ctx context.Context, keyStr string, key val.Tuple, isPk bool) error { - existing := make(sql.Row, len(m.keyMap)+len(m.valMap)) + existing := make(sql.UntypedSqlRow, len(m.keyMap)+len(m.valMap)) _ = m.mut.Get(ctx, key, func(key, value val.Tuple) (err error) { kd := m.keyBld.Desc @@ -298,7 +298,7 @@ func (m prollySecondaryIndexWriter) trimKeyPart(to int, keyPart interface{}) int func (m prollySecondaryIndexWriter) keyFromRow(ctx context.Context, sqlRow sql.Row) (val.Tuple, error) { for to := range m.keyMap { from := m.keyMap.MapOrdinal(to) - keyPart := m.trimKeyPart(to, sqlRow[from]) + keyPart := m.trimKeyPart(to, sqlRow.GetValue(from)) if err := tree.PutField(ctx, m.mut.NodeStore(), m.keyBld, to, keyPart); err != nil { return nil, err } @@ -318,13 +318,13 @@ func (m prollySecondaryIndexWriter) checkForUniqueKeyErr(ctx context.Context, sq ns := m.mut.NodeStore() for to := range m.keyMap[:m.idxCols] { from := m.keyMap.MapOrdinal(to) - if sqlRow[from] == nil { + if sqlRow.GetValue(from) == nil { // NULL is incomparable and cannot // trigger a UNIQUE KEY violation m.keyBld.Recycle() return nil } - keyPart := m.trimKeyPart(to, sqlRow[from]) + keyPart := m.trimKeyPart(to, sqlRow.GetValue(from)) if err := tree.PutField(ctx, ns, m.keyBld, to, keyPart); err != nil { return err } diff --git a/go/libraries/doltcore/sqle/writer/prolly_index_writer_keyless.go b/go/libraries/doltcore/sqle/writer/prolly_index_writer_keyless.go index 83c438e2e61..5da2c82af11 100644 --- a/go/libraries/doltcore/sqle/writer/prolly_index_writer_keyless.go +++ b/go/libraries/doltcore/sqle/writer/prolly_index_writer_keyless.go @@ -137,7 +137,7 @@ func (k prollyKeylessWriter) tuplesFromRow(ctx context.Context, sqlRow sql.Row) for to := range k.valMap { from := k.valMap.MapOrdinal(to) - if err = tree.PutField(ctx, k.mut.NodeStore(), k.valBld, to+1, sqlRow[from]); err != nil { + if err = tree.PutField(ctx, k.mut.NodeStore(), k.valBld, to+1, sqlRow.GetValue(from)); err != nil { return nil, nil, err } } @@ -154,7 +154,7 @@ func (k prollyKeylessWriter) errForSecondaryUniqueKeyError(ctx context.Context, // UniqueKeyError builds a sql.UniqueKeyError. It fetches the existing row using // |key| and passes it as the |existing| row. func (k prollyKeylessWriter) uniqueKeyError(ctx context.Context, keyStr string, key val.Tuple, isPk bool) error { - existing := make(sql.Row, len(k.valMap)) + existing := make(sql.UntypedSqlRow, len(k.valMap)) _ = k.mut.Get(ctx, key, func(key, value val.Tuple) (err error) { vd := k.valBld.Desc @@ -238,7 +238,7 @@ func (writer prollyKeylessSecondaryWriter) trimKeyPart(to int, keyPart interface func (writer prollyKeylessSecondaryWriter) Insert(ctx context.Context, sqlRow sql.Row) error { for to := range writer.keyMap { from := writer.keyMap.MapOrdinal(to) - keyPart := writer.trimKeyPart(to, sqlRow[from]) + keyPart := writer.trimKeyPart(to, sqlRow.GetValue(from)) if err := tree.PutField(ctx, writer.mut.NodeStore(), writer.keyBld, to, keyPart); err != nil { return err } @@ -312,7 +312,7 @@ func (writer prollyKeylessSecondaryWriter) Delete(ctx context.Context, sqlRow sq for to := range writer.keyMap { from := writer.keyMap.MapOrdinal(to) - keyPart := writer.trimKeyPart(to, sqlRow[from]) + keyPart := writer.trimKeyPart(to, sqlRow.GetValue(from)) if err := tree.PutField(ctx, writer.mut.NodeStore(), writer.keyBld, to, keyPart); err != nil { return err } diff --git a/go/libraries/doltcore/table/table_iterator_test.go b/go/libraries/doltcore/table/table_iterator_test.go index 486cce37fc7..7b04e71348e 100644 --- a/go/libraries/doltcore/table/table_iterator_test.go +++ b/go/libraries/doltcore/table/table_iterator_test.go @@ -106,7 +106,7 @@ func tuplesToRows(t *testing.T, kvs [][2]val.Tuple) (rows []sql.Row) { require.NoError(t, err) v2, err := tree.GetField(context.Background(), kd, 0, kv[1], nil) require.NoError(t, err) - rows[i] = sql.Row{v1, v2} + rows[i] = sql.UntypedSqlRow{v1, v2} } return diff --git a/go/libraries/doltcore/table/typed/json/json_diff_writer.go b/go/libraries/doltcore/table/typed/json/json_diff_writer.go index 4e94b2cc845..723e056327c 100755 --- a/go/libraries/doltcore/table/typed/json/json_diff_writer.go +++ b/go/libraries/doltcore/table/typed/json/json_diff_writer.go @@ -54,8 +54,8 @@ func (j *jsonRowDiffWriter) WriteRow( rowDiffType diff.ChangeType, colDiffTypes []diff.ChangeType, ) error { - if len(row) != len(colDiffTypes) { - return fmt.Errorf("expected the same size for columns and diff types, got %d and %d", len(row), len(colDiffTypes)) + if row.Len() != len(colDiffTypes) { + return fmt.Errorf("expected the same size for columns and diff types, got %d and %d", row.Len(), len(colDiffTypes)) } prefix := "" diff --git a/go/libraries/doltcore/table/typed/json/reader.go b/go/libraries/doltcore/table/typed/json/reader.go index c938ae008df..f06eee39763 100644 --- a/go/libraries/doltcore/table/typed/json/reader.go +++ b/go/libraries/doltcore/table/typed/json/reader.go @@ -129,7 +129,7 @@ func (r *JSONReader) ReadSqlRow(ctx context.Context) (sql.Row, error) { func (r *JSONReader) convToSqlRow(rowMap map[string]interface{}) (sql.Row, error) { allCols := r.sch.GetAllCols() - ret := make(sql.Row, allCols.Size()) + ret := make(sql.UntypedSqlRow, allCols.Size()) for k, v := range rowMap { col, ok := allCols.GetByName(k) if !ok { diff --git a/go/libraries/doltcore/table/typed/json/reader_test.go b/go/libraries/doltcore/table/typed/json/reader_test.go index 4fc9cd01f42..e76d4293a11 100644 --- a/go/libraries/doltcore/table/typed/json/reader_test.go +++ b/go/libraries/doltcore/table/typed/json/reader_test.go @@ -86,7 +86,7 @@ func testGoodJSON(t *testing.T, getReader func(types.ValueReadWriter, schema.Sch rows = append(rows, r) } - expectedRows := []sql.Row{ + expectedRows := []sql.UntypedSqlRow{ {0, "tim", "sehn"}, {1, "brian", "hendriks"}, } diff --git a/go/libraries/doltcore/table/typed/json/writer.go b/go/libraries/doltcore/table/typed/json/writer.go index 64ce808e690..f46b32967be 100644 --- a/go/libraries/doltcore/table/typed/json/writer.go +++ b/go/libraries/doltcore/table/typed/json/writer.go @@ -134,7 +134,7 @@ func (j *RowWriter) jsonDataForSchema(row sql.Row) ([]byte, error) { allCols := j.sch.GetAllCols() colValMap := make(map[string]interface{}, allCols.Size()) if err := allCols.Iter(func(tag uint64, col schema.Column) (stop bool, err error) { - val := row[allCols.TagToIdx[tag]] + val := row.GetValue(allCols.TagToIdx[tag]) if val == nil { return false, nil } @@ -194,7 +194,7 @@ func (j *RowWriter) jsonDataForSchema(row sql.Row) ([]byte, error) { func (j *RowWriter) jsonDataForSqlSchema(row sql.Row) ([]byte, error) { colValMap := make(map[string]interface{}, len(j.sqlSch)) for i, col := range j.sqlSch { - val := row[i] + val := row.GetValue(i) if val == nil { continue } diff --git a/go/libraries/doltcore/table/typed/noms/range_reader.go b/go/libraries/doltcore/table/typed/noms/range_reader.go index 9b0c9d2f6e6..221e6498a71 100644 --- a/go/libraries/doltcore/table/typed/noms/range_reader.go +++ b/go/libraries/doltcore/table/typed/noms/range_reader.go @@ -258,7 +258,7 @@ func (nrr *NomsRangeReader) Close(ctx context.Context) error { // SqlRowFromTuples constructs a go-mysql-server/sql.Row from Noms tuples. func SqlRowFromTuples(sch schema.Schema, key, val types.Tuple) (sql.Row, error) { allCols := sch.GetAllCols() - colVals := make(sql.Row, allCols.Size()) + colVals := make(sql.UntypedSqlRow, allCols.Size()) keySl, err := key.AsSlice() if err != nil { diff --git a/go/libraries/doltcore/table/typed/parquet/reader.go b/go/libraries/doltcore/table/typed/parquet/reader.go index 81a66f7915e..d24e3fc879c 100644 --- a/go/libraries/doltcore/table/typed/parquet/reader.go +++ b/go/libraries/doltcore/table/typed/parquet/reader.go @@ -134,7 +134,7 @@ func (pr *ParquetReader) ReadSqlRow(ctx context.Context) (sql.Row, error) { } allCols := pr.sch.GetAllCols() - row := make(sql.Row, allCols.Size()) + row := make(sql.UntypedSqlRow, allCols.Size()) allCols.Iter(func(tag uint64, col schema.Column) (stop bool, err error) { val := pr.fileData[col.Name][pr.rowReadCounter] if val != nil { @@ -151,7 +151,7 @@ func (pr *ParquetReader) ReadSqlRow(ctx context.Context) (sql.Row, error) { val = DecimalByteArrayToString([]byte(val.(string)), int(prec), int(scale)) } - row[allCols.TagToIdx[tag]] = val + row.SetValue(allCols.TagToIdx[tag], val) return false, nil }) diff --git a/go/libraries/doltcore/table/typed/parquet/writer.go b/go/libraries/doltcore/table/typed/parquet/writer.go index 022f2140569..93a041661fe 100644 --- a/go/libraries/doltcore/table/typed/parquet/writer.go +++ b/go/libraries/doltcore/table/typed/parquet/writer.go @@ -86,7 +86,7 @@ func NewParquetRowWriterForFile(outSch schema.Schema, destName string) (*Parquet func (pwr *ParquetRowWriter) WriteSqlRow(_ context.Context, r sql.Row) error { colValStrs := make([]*string, len(pwr.sch)) - for i, val := range r { + for i, val := range r.Values() { colT := pwr.sch[i] if val == nil { colValStrs[i] = nil diff --git a/go/libraries/doltcore/table/typed/parquet/writer_test.go b/go/libraries/doltcore/table/typed/parquet/writer_test.go index 5427b735746..3a6b9730604 100755 --- a/go/libraries/doltcore/table/typed/parquet/writer_test.go +++ b/go/libraries/doltcore/table/typed/parquet/writer_test.go @@ -54,8 +54,8 @@ type Person struct { Title string `parquet:"name=title, type=BYTE_ARRAY, convertedtype=UTF8, repetitiontype=OPTIONAL"` } -func getSampleRows() []sql.Row { - return []sql.Row{ +func getSampleRows() []sql.UntypedSqlRow { + return []sql.UntypedSqlRow{ {"Bill Billerson", 32, "Senior Dufus"}, {"Rob Robertson", 25, "Dufus"}, {"John Johnson", 21, ""}, @@ -63,7 +63,7 @@ func getSampleRows() []sql.Row { } } -func writeToParquet(pWr *ParquetRowWriter, rows []sql.Row, t *testing.T) { +func writeToParquet(pWr *ParquetRowWriter, rows []sql.UntypedSqlRow, t *testing.T) { func() { defer func() { err := pWr.Close(context.Background()) diff --git a/go/libraries/doltcore/table/untyped/csv/reader.go b/go/libraries/doltcore/table/untyped/csv/reader.go index 7ae7f2519d6..235cf68c0be 100644 --- a/go/libraries/doltcore/table/untyped/csv/reader.go +++ b/go/libraries/doltcore/table/untyped/csv/reader.go @@ -239,7 +239,7 @@ func (csvr *CSVReader) ReadSqlRow(crx context.Context) (sql.Row, error) { } func rowValsToSQLRows(rowVals []*string) sql.Row { - var sqlRow sql.Row + var sqlRow sql.UntypedSqlRow for _, rowVal := range rowVals { if rowVal == nil { sqlRow = append(sqlRow, nil) diff --git a/go/libraries/doltcore/table/untyped/csv/writer.go b/go/libraries/doltcore/table/untyped/csv/writer.go index ec19cc68bea..ea92b2089cd 100644 --- a/go/libraries/doltcore/table/untyped/csv/writer.go +++ b/go/libraries/doltcore/table/untyped/csv/writer.go @@ -143,7 +143,7 @@ func toCsvString(colType sql.Type, val interface{}) (string, error) { func (csvw *CSVWriter) processRowWithSchema(r sql.Row) ([]*string, error) { colValStrs := make([]*string, csvw.sch.GetAllCols().Size()) - for i, val := range r { + for i, val := range r.Values() { if val == nil { colValStrs[i] = nil } else { @@ -160,7 +160,7 @@ func (csvw *CSVWriter) processRowWithSchema(r sql.Row) ([]*string, error) { func (csvw *CSVWriter) processRowWithSqlSchema(r sql.Row) ([]*string, error) { colValStrs := make([]*string, len(csvw.sqlSch)) - for i, val := range r { + for i, val := range r.Values() { if val == nil { colValStrs[i] = nil } else { diff --git a/go/libraries/doltcore/table/untyped/csv/writer_test.go b/go/libraries/doltcore/table/untyped/csv/writer_test.go index 747bc08d378..d75ccd512df 100644 --- a/go/libraries/doltcore/table/untyped/csv/writer_test.go +++ b/go/libraries/doltcore/table/untyped/csv/writer_test.go @@ -44,8 +44,8 @@ var inCols = []schema.Column{ var colColl = schema.NewColCollection(inCols...) var rowSch = schema.MustSchemaFromCols(colColl) -func getSampleRows() []sql.Row { - return []sql.Row{ +func getSampleRows() []sql.UntypedSqlRow { + return []sql.UntypedSqlRow{ {"Bill Billerson", 32, "Senior Dufus"}, {"Rob Robertson", 25, "Dufus"}, {"John Johnson", 21, ""}, @@ -53,7 +53,7 @@ func getSampleRows() []sql.Row { } } -func writeToCSV(csvWr *CSVWriter, rows []sql.Row, t *testing.T) { +func writeToCSV(csvWr *CSVWriter, rows []sql.UntypedSqlRow, t *testing.T) { func() { defer csvWr.Close(context.Background()) diff --git a/go/libraries/doltcore/table/untyped/sqlexport/sqlwriter_test.go b/go/libraries/doltcore/table/untyped/sqlexport/sqlwriter_test.go index 0332d7576ef..619c4d42b01 100644 --- a/go/libraries/doltcore/table/untyped/sqlexport/sqlwriter_test.go +++ b/go/libraries/doltcore/table/untyped/sqlexport/sqlwriter_test.go @@ -58,7 +58,7 @@ func TestEndToEnd(t *testing.T) { type test struct { name string - rows []sql.Row + rows []sql.UntypedSqlRow sch schema.Schema expectedOutput string } @@ -66,7 +66,7 @@ func TestEndToEnd(t *testing.T) { tests := []test{ { name: "two rows", - rows: []sql.Row{ + rows: []sql.UntypedSqlRow{ {"00000000-0000-0000-0000-000000000000", "some guy", 100, 0, "normie"}, {"00000000-0000-0000-0000-000000000000", "guy personson", 0, 1, "officially a person"}, }, diff --git a/go/libraries/doltcore/table/untyped/tabular/fixedwidth_conflict_tablewriter.go b/go/libraries/doltcore/table/untyped/tabular/fixedwidth_conflict_tablewriter.go index 034cf50055f..887410b9e93 100644 --- a/go/libraries/doltcore/table/untyped/tabular/fixedwidth_conflict_tablewriter.go +++ b/go/libraries/doltcore/table/untyped/tabular/fixedwidth_conflict_tablewriter.go @@ -70,8 +70,8 @@ func (w FixedWidthConflictTableWriter) WriteRow( diffMarker = " * " } - newRow := append(sql.Row{diffMarker, version}, row...) - return w.tableWriter.WriteColoredSqlRow(ctx, newRow, rowColorsForDiffType(rowDiffType, 2, len(row))) + newRow := sql.UntypedSqlRow{diffMarker, version}.Append(row) + return w.tableWriter.WriteColoredSqlRow(ctx, newRow, rowColorsForDiffType(rowDiffType, 2, row.Len())) } func (w FixedWidthConflictTableWriter) Close(ctx context.Context) error { diff --git a/go/libraries/doltcore/table/untyped/tabular/fixedwidth_diff_tablewriter.go b/go/libraries/doltcore/table/untyped/tabular/fixedwidth_diff_tablewriter.go index 98ec9095244..34c76754b22 100755 --- a/go/libraries/doltcore/table/untyped/tabular/fixedwidth_diff_tablewriter.go +++ b/go/libraries/doltcore/table/untyped/tabular/fixedwidth_diff_tablewriter.go @@ -56,8 +56,8 @@ func (w FixedWidthDiffTableWriter) WriteRow( rowDiffType diff.ChangeType, colDiffTypes []diff.ChangeType, ) error { - if len(row) != len(colDiffTypes) { - return fmt.Errorf("expected the same size for columns and diff types, got %d and %d", len(row), len(colDiffTypes)) + if row.Len() != len(colDiffTypes) { + return fmt.Errorf("expected the same size for columns and diff types, got %d and %d", row.Len(), len(colDiffTypes)) } diffMarker := "" @@ -72,14 +72,14 @@ func (w FixedWidthDiffTableWriter) WriteRow( diffMarker = ">" } - newRow := append(sql.Row{diffMarker}, row...) + newRow := sql.UntypedSqlRow{diffMarker}.Append(row) newColDiffTypes := append([]diff.ChangeType{rowDiffType}, colDiffTypes...) return w.tableWriter.WriteColoredSqlRow(ctx, newRow, colorsForDiffTypes(newColDiffTypes)) } func (w FixedWidthDiffTableWriter) WriteCombinedRow(ctx context.Context, oldRow, newRow sql.Row, mode diff.Mode) error { - combinedRow := make([]string, len(oldRow)+1) + combinedRow := make([]string, oldRow.Len()+1) oldRowStrs := make([]string, len(combinedRow)) newRowStrs := make([]string, len(combinedRow)) columnDiffs := make([]bool, len(combinedRow)) @@ -92,13 +92,13 @@ func (w FixedWidthDiffTableWriter) WriteCombinedRow(ctx context.Context, oldRow, columnDiffs[0] = true widths[0] = NewFixedWidthString(combinedRow[0]) - for i := range oldRow { + for i := 0; i < oldRow.Len(); i++ { var err error - oldRowStrs[i+1], err = w.tableWriter.stringValue(i+1, oldRow[i]) + oldRowStrs[i+1], err = w.tableWriter.stringValue(i+1, oldRow.GetValue(i)) if err != nil { return err } - newRowStrs[i+1], err = w.tableWriter.stringValue(i+1, newRow[i]) + newRowStrs[i+1], err = w.tableWriter.stringValue(i+1, newRow.GetValue(i)) if err != nil { return err } diff --git a/go/libraries/doltcore/table/untyped/tabular/fixedwidth_tablewriter.go b/go/libraries/doltcore/table/untyped/tabular/fixedwidth_tablewriter.go index b4c509db1c9..0dc1ed4f296 100644 --- a/go/libraries/doltcore/table/untyped/tabular/fixedwidth_tablewriter.go +++ b/go/libraries/doltcore/table/untyped/tabular/fixedwidth_tablewriter.go @@ -124,9 +124,9 @@ func (w *FixedWidthTableWriter) WriteSqlRow(ctx context.Context, r sql.Row) erro // WriteColoredSqlRow writes the given SQL row to the buffer. If colors are nil, then uses the default color. func (w *FixedWidthTableWriter) WriteColoredSqlRow(ctx context.Context, r sql.Row, colors []*color.Color) error { - strRow := make([]string, len(r)) - for i := range r { - str, err := w.stringValue(i, r[i]) + strRow := make([]string, r.Len()) + for i, v := range r.Values() { + str, err := w.stringValue(i, v) if err != nil { return err } @@ -263,15 +263,15 @@ func (w *FixedWidthTableWriter) writeRow(row tableRow) error { func (w *FixedWidthTableWriter) rowToTableRow(row sql.Row, colors []*color.Color) (tableRow, error) { tRow := tableRow{ - columns: make([]string, len(row)), + columns: make([]string, row.Len()), colors: colors, - widths: make([]FixedWidthString, len(row)), + widths: make([]FixedWidthString, row.Len()), height: 1, } var err error - for i := range row { - tRow.columns[i], err = w.stringValue(i, row[i]) + for i, v := range row.Values() { + tRow.columns[i], err = w.stringValue(i, v) if err != nil { return tableRow{}, err } diff --git a/go/libraries/doltcore/table/untyped/tabular/fixedwidth_tablewriter_test.go b/go/libraries/doltcore/table/untyped/tabular/fixedwidth_tablewriter_test.go index cf106422169..e69f8c4839b 100755 --- a/go/libraries/doltcore/table/untyped/tabular/fixedwidth_tablewriter_test.go +++ b/go/libraries/doltcore/table/untyped/tabular/fixedwidth_tablewriter_test.go @@ -66,7 +66,7 @@ func TestFixedWidthWriter(t *testing.T) { rows := make([]sql.Row, len(ages)) for i := range ages { - rows[i] = sql.Row{names[i], ages[i], titles[i]} + rows[i] = sql.UntypedSqlRow{names[i], ages[i], titles[i]} } t.Run("Column names bigger than row data", func(t *testing.T) { @@ -187,7 +187,7 @@ func TestFixedWidthWriter(t *testing.T) { if title != nil { title = strings.Replace(title.(string), " ", "\n", -1) } - err := tableWr.WriteSqlRow(context.Background(), sql.Row{name, ages[i], title}) + err := tableWr.WriteSqlRow(context.Background(), sql.UntypedSqlRow{name, ages[i], title}) assert.NoError(t, err) } diff --git a/go/libraries/doltcore/table/untyped/xlsx/marshaling.go b/go/libraries/doltcore/table/untyped/xlsx/marshaling.go index 0cca68b1731..5bea93b5ffe 100644 --- a/go/libraries/doltcore/table/untyped/xlsx/marshaling.go +++ b/go/libraries/doltcore/table/untyped/xlsx/marshaling.go @@ -74,7 +74,7 @@ func decodeXLSXRows(xlData [][][]string, sch schema.Schema) ([]sql.Row, error) { for j := 0; j < numSheets; j++ { for i := 0; i < numRows; i++ { - var row sql.Row + row := sql.UntypedSqlRow{} for k, v := range header { if _, found := sch.GetAllCols().NameToCol[v]; !found { return nil, errors.New(v + " is not a valid column") diff --git a/go/libraries/doltcore/table/untyped/xlsx/marshaling_test.go b/go/libraries/doltcore/table/untyped/xlsx/marshaling_test.go index 99105459337..370523053cf 100644 --- a/go/libraries/doltcore/table/untyped/xlsx/marshaling_test.go +++ b/go/libraries/doltcore/table/untyped/xlsx/marshaling_test.go @@ -42,7 +42,7 @@ func TestDecodeXLSXRows(t *testing.T) { } assert.NoError(t, err) - newRow := sql.Row{"1", "oshieza", "otori", 24} + newRow := sql.UntypedSqlRow{"1", "oshieza", "otori", 24} if !reflect.DeepEqual(decoded[0], newRow) { t.Log("error!") diff --git a/go/libraries/doltcore/table/untyped/xlsx/reader.go b/go/libraries/doltcore/table/untyped/xlsx/reader.go index 1460a478760..6c108d3a8e4 100644 --- a/go/libraries/doltcore/table/untyped/xlsx/reader.go +++ b/go/libraries/doltcore/table/untyped/xlsx/reader.go @@ -152,7 +152,7 @@ func (xlsxr *XLSXReader) ReadRow(ctx context.Context) (row.Row, error) { sqlRow := xlsxr.rows[xlsxr.ind] allCols.Iter(func(tag uint64, col schema.Column) (stop bool, err error) { - taggedVals[tag], err = col.TypeInfo.ConvertValueToNomsValue(ctx, xlsxr.vrw, sqlRow[allCols.TagToIdx[tag]]) + taggedVals[tag], err = col.TypeInfo.ConvertValueToNomsValue(ctx, xlsxr.vrw, sqlRow.GetValue(allCols.TagToIdx[tag])) return false, err })