Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
87 commits
Select commit Hold shift + click to select a range
cc8def0
moving config creation to same place
Jul 12, 2022
735b4de
merge with main
Jul 12, 2022
df7c21e
working so far, non server needs to check password
Jul 12, 2022
c4df29e
merge with other branch
Jul 14, 2022
c9855cf
Merge branch 'james/local-user' into james/users
Jul 15, 2022
9f4684d
not sure what to do next
Jul 15, 2022
4788d90
Merge branch 'main' into james/users
Jul 15, 2022
4cc1789
Merge branch 'main' into james/users
Jul 15, 2022
9e5ec16
probably good enough
Jul 15, 2022
40a4139
fixing docs
Jul 15, 2022
e75f92e
deleting comment
Jul 15, 2022
9764c53
Merge branch 'main' into james/users
Jul 15, 2022
a3d429f
changing superuser to just be local
Jul 15, 2022
9f9f5a6
fixing logic
Jul 15, 2022
743c9fc
need to add user to sql -q
Jul 18, 2022
8b713b0
missed a user
Jul 18, 2022
59661c3
only start iff user exists
Jul 18, 2022
c2f9923
adding tests
Jul 18, 2022
d063419
tests hang??
Jul 19, 2022
0bedf7c
only immediately persist if it is dolt sql-server
Jul 19, 2022
49af15f
aaaaaaaaa
Jul 19, 2022
6b6b7d8
Merge branch 'main' into james/users
Jul 20, 2022
30220ee
remove hanging test for now, and remove password argument for local s…
Jul 20, 2022
5029d66
fixed?
Jul 20, 2022
ea1dcc2
aaaaaaaaaaaa
Jul 20, 2022
39dda18
Merge branch 'main' into james/users
Jul 20, 2022
edc9c13
asdfasdfasdf
Jul 20, 2022
e86839a
skipping tests to see
Jul 20, 2022
b7f1d74
this is probably the bad test
Jul 20, 2022
dfcf0ff
removing bad test
Jul 20, 2022
ed99c7f
working for local, but server somehow lost mysql
Jul 21, 2022
c732b8e
aaaaa
Jul 21, 2022
6cd8ec6
[ga-format-pr] Run go/utils/repofmt/format_repo.sh and go/Godeps/upda…
jcor11599 Jul 21, 2022
5b2ea1c
Merge branch 'main' into james/users
Jul 21, 2022
01036a2
merge with main
Jul 21, 2022
7762bde
Merge branch 'main' into james/users
Jul 21, 2022
c530431
see what works, need to write more tests
Jul 21, 2022
bbcb3e2
go bump, please work thanks
Jul 21, 2022
1de9a13
fixed sql-privs
Jul 21, 2022
18207ee
adding tests for config files not existing till needed
Jul 21, 2022
9a5754f
fixing the other tests
Jul 21, 2022
1b5e7bd
add superuser in engine code
Jul 22, 2022
3932b3d
k that was a bad idea
Jul 22, 2022
02af0b5
another attempt, will probably break something
Jul 22, 2022
f07615f
manual format
Jul 22, 2022
7f1af08
fixing go mod
Jul 22, 2022
24b2964
Merge branch 'main' into james/users
jycor Jul 22, 2022
3b1c41c
this is a useful commit message
Jul 22, 2022
9d7fd4f
Merge branch 'james/users' of https://github.com/dolthub/dolt into ja…
Jul 22, 2022
c2ce94f
someday this will work
Jul 22, 2022
4fee331
idk how but this commit disappeared last time
Jul 22, 2022
5ce1f08
don't break please
Jul 22, 2022
8570c71
sure whatever
Jul 22, 2022
832d27b
just delete the failing tests :)
Jul 22, 2022
c50fb31
yaml default user is root
Jul 24, 2022
d44ed8a
fixing another test
Jul 25, 2022
18bd0d8
aaaaaaaa
Jul 25, 2022
b7487f3
adtrkjgnsjdtg
Jul 25, 2022
c76c1d3
idk how to make it work
Jul 25, 2022
9ee406d
asdfasdfa
Jul 25, 2022
160ae55
asdfas
Jul 25, 2022
d35df20
what the heck is going on
Jul 25, 2022
d3770c4
adding back user length check
Jul 25, 2022
3c5b211
adding error for sql-client missing user argument
Jul 25, 2022
9dad81d
changing message
Jul 25, 2022
d1766a3
aa
Jul 25, 2022
d54123b
adding tests
Jul 25, 2022
4f7300f
merging with main
Jul 25, 2022
9981501
[ga-format-pr] Run go/utils/repofmt/format_repo.sh and go/Godeps/upda…
jcor11599 Jul 25, 2022
29525e9
yeah yeah yeah
Jul 25, 2022
d7ed044
Merge branch 'james/users' of https://github.com/dolthub/dolt into ja…
Jul 25, 2022
a1235c9
adding tests
Jul 26, 2022
7e9ddee
adding test
Jul 26, 2022
3bf7ad5
more conflicts woo
Jul 26, 2022
d90e637
changing fail message
Jul 26, 2022
05028f7
replacing serverhost with %
Jul 26, 2022
9b27046
let's see what tests fail now
Jul 26, 2022
3a244ac
more conflicts
Jul 26, 2022
7972b60
aa
Jul 26, 2022
3d56d93
unskip
Jul 26, 2022
69e16d3
Merge branch 'main' into james/users
Jul 26, 2022
0c27290
merge with main again
Jul 26, 2022
e97debe
aaaaaaaaaaaaaaaaa
Jul 27, 2022
38fc8b1
feedback
Jul 27, 2022
ee474de
adding test for logging in with bad user
Jul 27, 2022
14075c3
mac grep is weird
Jul 27, 2022
7ca169e
maybe sleeping is the answer
Jul 27, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 7 additions & 11 deletions go/cmd/dolt/commands/engine/sqlengine.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,11 @@ type SqlEngineConfig struct {
InitialDb string
IsReadOnly bool
IsServerLocked bool
DoltCfgDirPath string
PrivFilePath string
ServerUser string
ServerPass string
ServerHost string
Autocommit bool
Bulk bool
JwksConfig []JwksConfig
Expand Down Expand Up @@ -91,24 +93,16 @@ func NewSqlEngine(
pro := dsqle.NewDoltDatabaseProvider(b, mrEnv.FileSystem(), all...).WithRemoteDialer(mrEnv.RemoteDialProvider())

// Load in privileges from file, if it exists
persister := mysql_file_handler.NewPersister(config.PrivFilePath)
persister := mysql_file_handler.NewPersister(config.PrivFilePath, config.DoltCfgDirPath)
data, err := persister.LoadData()
if err != nil {
return nil, err
}

// Create temporary users if no privileges in config
var tempUsers []gms.TemporaryUser
if len(data) == 0 && len(config.ServerUser) > 0 {
tempUsers = append(tempUsers, gms.TemporaryUser{
Username: config.ServerUser,
Password: config.ServerPass,
})
}

// Set up engine
engine := gms.New(analyzer.NewBuilder(pro).WithParallelism(parallelism).Build(), &gms.Config{IsReadOnly: config.IsReadOnly, TemporaryUsers: tempUsers, IsServerLocked: config.IsServerLocked}).WithBackgroundThreads(bThreads)
engine := gms.New(analyzer.NewBuilder(pro).WithParallelism(parallelism).Build(), &gms.Config{IsReadOnly: config.IsReadOnly, IsServerLocked: config.IsServerLocked}).WithBackgroundThreads(bThreads)
engine.Analyzer.Catalog.MySQLDb.SetPersister(persister)

engine.Analyzer.Catalog.MySQLDb.SetPlugins(map[string]mysql_db.PlaintextAuthPlugin{
"authentication_dolt_jwt": NewAuthenticateDoltJWTPlugin(config.JwksConfig),
})
Expand Down Expand Up @@ -400,6 +394,8 @@ func NewSqlEngineForEnv(ctx context.Context, dEnv *env.DoltEnv) (*SqlEngine, err
InitialDb: dbName,
IsReadOnly: false,
ServerUser: "root",
ServerPass: "",
ServerHost: "localhost",
Autocommit: false,
},
)
Expand Down
Loading