Run prepare on the transaction, not the db

This commit is contained in:
Jeff Mitchell
2016-06-29 17:20:41 -04:00
parent f24a17f343
commit fb9a4a15c5
3 changed files with 6 additions and 8 deletions

View File

@@ -64,7 +64,7 @@ func (b *backend) pathCredsCreateRead(
return nil, err
}
// Get our connection
// Get our handle
db, err := b.DB(req.Storage)
if err != nil {
return nil, err
@@ -83,7 +83,7 @@ func (b *backend) pathCredsCreateRead(
// Execute each query
for _, query := range SplitSQL(roleSQL) {
stmt, err := db.Prepare(Query(query, map[string]string{
stmt, err := tx.Prepare(Query(query, map[string]string{
"name": username,
"password": password,
}))