Move the parameter down to where the statement is executed.
This commit is contained in:
parent
08fb1a30d4
commit
2e828383e0
|
@ -238,14 +238,13 @@ func testAccStepReadCreds(t *testing.T, b logical.Backend, s logical.Storage, na
|
||||||
}
|
}
|
||||||
|
|
||||||
returnedRows := func() int {
|
returnedRows := func() int {
|
||||||
stmt, err := db.Prepare("SELECT DISTINCT schemaname FROM pg_tables WHERE has_table_privilege($1, 'information_schema.role_column_grants', 'select');",
|
stmt, err := db.Prepare("SELECT DISTINCT schemaname FROM pg_tables WHERE has_table_privilege($1, 'information_schema.role_column_grants', 'select');")
|
||||||
d.Username)
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return -1
|
return -1
|
||||||
}
|
}
|
||||||
defer stmt.Close()
|
defer stmt.Close()
|
||||||
|
|
||||||
rows, err := stmt.Query()
|
rows, err := stmt.Query(d.Username)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return -1
|
return -1
|
||||||
}
|
}
|
||||||
|
|
|
@ -112,13 +112,13 @@ func (b *backend) secretCredsRevoke(
|
||||||
// the role
|
// the role
|
||||||
// This isn't done in a transaction because even if we fail along the way,
|
// This isn't done in a transaction because even if we fail along the way,
|
||||||
// we want to remove as much access as possible
|
// we want to remove as much access as possible
|
||||||
stmt, err := db.Prepare("SELECT DISTINCT table_schema FROM information_schema.role_column_grants WHERE grantee=$1;", username)
|
stmt, err := db.Prepare("SELECT DISTINCT table_schema FROM information_schema.role_column_grants WHERE grantee=$1;")
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
defer stmt.Close()
|
defer stmt.Close()
|
||||||
|
|
||||||
rows, err := stmt.Query()
|
rows, err := stmt.Query(username)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue