Skip to content

Commit

Permalink
updated foreign check switch
Browse files Browse the repository at this point in the history
  • Loading branch information
adrianwit@gmail.com authored and adrianwit@gmail.com committed Sep 17, 2019
1 parent fc74519 commit b973413
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions service.go
Original file line number Diff line number Diff line change
Expand Up @@ -508,9 +508,13 @@ func (s *service) prepareWithRequest(request *PrepareRequest, response *PrepareR
func (s *service) enableForeignKeyCheck(datastore string, connection dsc.Connection) error {
dialect := GetDatastoreDialect(datastore, s.registry)
manager := s.registry.Get(datastore)
adminManager, err := s.getAdminManager(datastore)
if err != nil {
return err
adminManager := manager
var err error
if ! dialect.IsKeyCheckSwitchSessionLevel() {
adminManager, err = s.getAdminManager(datastore)
if err != nil {
return err
}
}
if manager != adminManager {
defer connection.Close()
Expand Down

0 comments on commit b973413

Please sign in to comment.