1
0
Fork 0
forked from forgejo/forgejo

go-sqlite3 gomod version (#12490)

This commit is contained in:
techknowlogick 2020-08-13 21:54:46 -04:00 committed by GitHub
parent b37c7dd384
commit 8a0049bb03
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
32 changed files with 13260 additions and 7349 deletions

View file

@ -119,13 +119,16 @@ func (h *mySQL) afterLoad(q queryable) error {
}
func (h *mySQL) getChecksum(q queryable, tableName string) (int64, error) {
sql := fmt.Sprintf("CHECKSUM TABLE %s", h.quoteKeyword(tableName))
query := fmt.Sprintf("CHECKSUM TABLE %s", h.quoteKeyword(tableName))
var (
table string
checksum int64
checksum sql.NullInt64
)
if err := q.QueryRow(sql).Scan(&table, &checksum); err != nil {
if err := q.QueryRow(query).Scan(&table, &checksum); err != nil {
return 0, err
}
return checksum, nil
if !checksum.Valid {
return 0, fmt.Errorf("testfixtures: table %s does not exist", tableName)
}
return checksum.Int64, nil
}