Skip to content

Commit

Permalink
Merge branch 'main' into nicktobey/autoinclock
Browse files Browse the repository at this point in the history
  • Loading branch information
nicktobey committed Apr 10, 2024
2 parents e4b3856 + a6ce239 commit 5ba740f
Show file tree
Hide file tree
Showing 5 changed files with 54 additions and 22 deletions.
4 changes: 3 additions & 1 deletion .github/workflows/cd-release-pgo.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
name: Release PGO Dolt

on:
workflow_dispatch:
inputs:
Expand Down Expand Up @@ -59,7 +61,7 @@ jobs:
- name: Update dolt version command
run: sed -i -e 's/ Version = ".*"/ Version = "'"$NEW_VERSION"'"/' "$FILE"
env:
FILE: ${{ format('{0}/go/cmd/dolt/dolt.go', github.workspace) }}
FILE: ${{ format('{0}/go/cmd/dolt/doltversion/version.go', github.workspace) }}
NEW_VERSION: ${{ needs.format-version.outputs.version }}
- name: Set minver TBD to version
run: sed -i -e 's/minver:"TBD"/minver:"'"$NEW_VERSION"'"/' "$FILE"
Expand Down
11 changes: 10 additions & 1 deletion go/cmd/dolt/commands/version.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ The out-of-date check can be disabled by running {{.EmphasisLeft}}dolt config --
}

type VersionCmd struct {
BinaryName string
VersionStr string
}

Expand Down Expand Up @@ -90,7 +91,15 @@ func (cmd VersionCmd) Exec(ctx context.Context, commandStr string, args []string
help, usage := cli.HelpAndUsagePrinters(cli.CommandDocsForCommandString(commandStr, versionDocs, ap))
apr := cli.ParseArgsOrDie(ap, args, help)

cli.Println("dolt version", cmd.VersionStr)
return cmd.ExecWithArgParser(ctx, apr, usage, dEnv)
}

func (cmd VersionCmd) ExecWithArgParser(ctx context.Context, apr *argparser.ArgParseResults, usage cli.UsagePrinter, dEnv *env.DoltEnv) int {
binName := "dolt"
if cmd.BinaryName != "" {
binName = cmd.BinaryName
}
cli.Printf("%s version %s\n", binName, cmd.VersionStr)

versionCheckDisabled := dEnv.Config.GetStringOrDefault(config.VersionCheckDisabled, "false")
if versionCheckDisabled == "false" {
Expand Down
31 changes: 14 additions & 17 deletions go/cmd/dolt/dolt.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ import (
"github.com/dolthub/dolt/go/cmd/dolt/commands/sqlserver"
"github.com/dolthub/dolt/go/cmd/dolt/commands/stashcmds"
"github.com/dolthub/dolt/go/cmd/dolt/commands/tblcmds"
"github.com/dolthub/dolt/go/cmd/dolt/doltversion"
"github.com/dolthub/dolt/go/libraries/doltcore/dbfactory"
"github.com/dolthub/dolt/go/libraries/doltcore/dconfig"
"github.com/dolthub/dolt/go/libraries/doltcore/doltdb"
Expand All @@ -66,10 +67,6 @@ import (
"github.com/dolthub/dolt/go/store/util/tempfiles"
)

const (
Version = "1.35.8"
)

var dumpDocsCommand = &commands.DumpDocsCmd{}
var dumpZshCommand = &commands.GenZshCompCmd{}

Expand All @@ -81,9 +78,9 @@ var doltSubCommands = []cli.Command{
commands.ResetCmd{},
commands.CleanCmd{},
commands.CommitCmd{},
commands.SqlCmd{VersionStr: Version},
commands.SqlCmd{VersionStr: doltversion.Version},
admin.Commands,
sqlserver.SqlServerCmd{VersionStr: Version},
sqlserver.SqlServerCmd{VersionStr: doltversion.Version},
commands.LogCmd{},
commands.ShowCmd{},
commands.BranchCmd{},
Expand Down Expand Up @@ -115,7 +112,7 @@ var doltSubCommands = []cli.Command{
commands.FilterBranchCmd{},
commands.MergeBaseCmd{},
commands.RootsCmd{},
commands.VersionCmd{VersionStr: Version},
commands.VersionCmd{VersionStr: doltversion.Version},
commands.DumpCmd{},
commands.InspectCmd{},
dumpDocsCommand,
Expand All @@ -131,7 +128,7 @@ var doltSubCommands = []cli.Command{

var commandsWithoutCliCtx = []cli.Command{
admin.Commands,
sqlserver.SqlServerCmd{VersionStr: Version},
sqlserver.SqlServerCmd{VersionStr: doltversion.Version},
commands.CloneCmd{},
commands.RemoteCmd{},
commands.BackupCmd{},
Expand All @@ -145,7 +142,7 @@ var commandsWithoutCliCtx = []cli.Command{
commands.ReadTablesCmd{},
commands.FilterBranchCmd{},
commands.RootsCmd{},
commands.VersionCmd{VersionStr: Version},
commands.VersionCmd{VersionStr: doltversion.Version},
commands.DumpCmd{},
commands.InspectCmd{},
dumpDocsCommand,
Expand All @@ -163,14 +160,14 @@ var commandsWithoutGlobalArgSupport = []cli.Command{
commands.ReadTablesCmd{},
commands.LoginCmd{},
credcmds.Commands,
sqlserver.SqlServerCmd{VersionStr: Version},
commands.VersionCmd{VersionStr: Version},
sqlserver.SqlServerCmd{VersionStr: doltversion.Version},
commands.VersionCmd{VersionStr: doltversion.Version},
commands.ConfigCmd{},
}

// commands that do not need write access for the current directory
var commandsWithoutCurrentDirWrites = []cli.Command{
commands.VersionCmd{VersionStr: Version},
commands.VersionCmd{VersionStr: doltversion.Version},
commands.ConfigCmd{},
commands.ProfileCmd{},
}
Expand Down Expand Up @@ -220,7 +217,7 @@ func init() {
dumpDocsCommand.GlobalDocs = globalDocs
dumpDocsCommand.GlobalSpecialMsg = globalSpecialMsg
dumpZshCommand.DoltCommand = doltCommand
dfunctions.VersionString = Version
dfunctions.VersionString = doltversion.Version
if _, ok := os.LookupEnv(disableEventFlushEnvVar); ok {
eventFlushDisabled = true
}
Expand Down Expand Up @@ -469,7 +466,7 @@ func runMain() int {

var fs filesys.Filesys
fs = filesys.LocalFS
dEnv := env.Load(ctx, env.GetCurrentUserHomeDir, fs, doltdb.LocalDirDoltDB, Version)
dEnv := env.Load(ctx, env.GetCurrentUserHomeDir, fs, doltdb.LocalDirDoltDB, doltversion.Version)

homeDir, err := env.GetCurrentUserHomeDir()
if err != nil {
Expand All @@ -485,7 +482,7 @@ func runMain() int {
metricsEmitter = events.NullEmitter{}
}

events.SetGlobalCollector(events.NewCollector(Version, metricsEmitter))
events.SetGlobalCollector(events.NewCollector(doltversion.Version, metricsEmitter))

if dEnv.CfgLoadErr != nil {
cli.PrintErrln(color.RedString("Failed to load the global config. %v", dEnv.CfgLoadErr))
Expand Down Expand Up @@ -817,7 +814,7 @@ func emitUsageEvents(emitter events.Emitter, args []string) {
// write events
collector := events.GlobalCollector()
ctx := context.Background()
_ = emitter.LogEvents(ctx, Version, collector.Close())
_ = emitter.LogEvents(ctx, doltversion.Version, collector.Close())

// flush events
if !eventFlushDisabled && len(args) > 0 && shouldFlushEvents(args[0]) {
Expand Down Expand Up @@ -861,7 +858,7 @@ func interceptSendMetrics(ctx context.Context, args []string) (bool, int) {
if len(args) < 1 || args[0] != commands.SendMetricsCommand {
return false, 0
}
dEnv := env.LoadWithoutDB(ctx, env.GetCurrentUserHomeDir, filesys.LocalFS, Version)
dEnv := env.LoadWithoutDB(ctx, env.GetCurrentUserHomeDir, filesys.LocalFS, doltversion.Version)
return true, doltCommand.Exec(ctx, "dolt", args, dEnv, nil)
}

Expand Down
20 changes: 20 additions & 0 deletions go/cmd/dolt/doltversion/version.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
// Copyright 2024 Dolthub, Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

// dolt is the command line tool for working with Dolt databases.
package doltversion

const (
Version = "1.35.8"
)
10 changes: 7 additions & 3 deletions go/libraries/doltcore/sqle/enginetest/dolt_procedure_queries.go
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,10 @@ end
"create table t(a int primary key auto_increment, b int);",
"create table t2(a int primary key auto_increment, b int);",
"call dolt_commit('-Am', 'new table');",
`create trigger branch_trigger after insert on t for each row
},
Assertions: []queries.ScriptTestAssertion{
{
Query: `create trigger branch_trigger after insert on t for each row
begin
declare i int default 1;
commits: loop
Expand All @@ -248,8 +251,9 @@ begin
end loop commits;
end
`,
},
Assertions: []queries.ScriptTestAssertion{
Skip: true, // See https://github.com/dolthub/go-mysql-server/pull/2442
SkipResultsCheck: true,
},
{
Query: "insert into t values (1, 1);",
Skip: true,
Expand Down

0 comments on commit 5ba740f

Please sign in to comment.