check for failure on that mysql query (#2105)

This commit is contained in:
Kevin Goess 2016-11-17 06:59:27 -08:00 committed by Jeff Mitchell
parent ddb9a0ce52
commit 33bf26f320
1 changed files with 3 additions and 0 deletions

View File

@ -173,6 +173,9 @@ func (m *MySQLBackend) List(prefix string) ([]string, error) {
// Add the % wildcard to the prefix to do the prefix search
likePrefix := prefix + "%"
rows, err := m.statements["list"].Query(likePrefix)
if err != nil {
return nil, fmt.Errorf("failed to execute statement: %v", err)
}
var keys []string
for rows.Next() {