Skip to content

Commit 68e36a6

Browse files
committed
fixup: testing out a hack to see if this fixes the mysqldb issues
1 parent dab809f commit 68e36a6

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

eventscheduler/event_scheduler.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,9 +107,14 @@ func InitEventScheduler(
107107
// account that cannot be directly used to log in) so that the event scheduler can read events
108108
// from all databases.
109109
func initializeEventSchedulerSuperUser(mySQLDb *mysql_db.MySQLDb) {
110+
wasEnabled := mySQLDb.Enabled()
111+
110112
ed := mySQLDb.Editor()
111113
defer ed.Close()
112114
mySQLDb.AddLockedSuperUser(ed, eventSchedulerSuperUserName, "localhost", "")
115+
116+
// TODO: This is kind of a hack... but it may work?
117+
mySQLDb.SetEnabled(wasEnabled)
113118
}
114119

115120
// Close closes the EventScheduler.

sql/mysql_db/mysql_db.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -521,6 +521,8 @@ func (db *MySQLDb) AddRootAccount() {
521521
// and password. The superuser account will only exist for the lifetime of the server process; once
522522
// the server is restarted, this superuser account will not be present.
523523
func (db *MySQLDb) AddEphemeralSuperUser(ed *Editor, username string, host string, password string) {
524+
db.SetEnabled(true)
525+
524526
if len(password) > 0 {
525527
hash := sha1.New()
526528
hash.Write([]byte(password))
@@ -542,6 +544,8 @@ func (db *MySQLDb) AddEphemeralSuperUser(ed *Editor, username string, host strin
542544
// AddSuperUser adds the given username and password to the list of accounts. This is a temporary function, which is
543545
// meant to replace the "auth.New..." functions while the remaining functions are added.
544546
func (db *MySQLDb) AddSuperUser(ed *Editor, username string, host string, password string) {
547+
db.SetEnabled(true)
548+
545549
//TODO: remove this function and the called function
546550
if len(password) > 0 {
547551
hash := sha1.New()

0 commit comments

Comments
 (0)