aboutsummaryrefslogtreecommitdiff
path: root/internal/postgres/versionstate.go
diff options
context:
space:
mode:
authorJonathan Amsterdam <jba@google.com>2020-08-19 11:47:41 -0400
committerJonathan Amsterdam <jba@google.com>2020-08-19 17:47:28 +0000
commit56517e4b414745c963a2b1b9250c236631d9011f (patch)
tree48d65bae96ed589f50f392425feb1ba2e667f33e /internal/postgres/versionstate.go
parent9b820d8a6e095e39f3eb437fd020d1afcee0b242 (diff)
downloadgo-x-pkgsite-56517e4b414745c963a2b1b9250c236631d9011f.tar.xz
internal/postgres: don't read module_version_states.incompatible
We don't need to read the 'incompatible' column from module_version_states. This also fixes a bug where there was a mismatch between the number of columns in the query and the number of arguments to rows.Scan in queryModuleVersionStates. Change-Id: I5a8e0d41666ce7b5e721ba78342cb18ee21ead2f Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/249297 Reviewed-by: Julie Qiu <julie@golang.org>
Diffstat (limited to 'internal/postgres/versionstate.go')
-rw-r--r--internal/postgres/versionstate.go10
1 files changed, 2 insertions, 8 deletions
diff --git a/internal/postgres/versionstate.go b/internal/postgres/versionstate.go
index ad876d31..c7dcbfc0 100644
--- a/internal/postgres/versionstate.go
+++ b/internal/postgres/versionstate.go
@@ -191,8 +191,7 @@ const moduleVersionStateColumns = `
next_processed_after,
app_version,
go_mod_path,
- num_packages,
- incompatible`
+ num_packages`
// scanModuleVersionState constructs an *internal.ModuleModuleVersionState from the given
// scanner. It expects columns to be in the order of moduleVersionStateColumns.
@@ -281,12 +280,7 @@ func (db *DB) GetModuleVersionState(ctx context.Context, modulePath, version str
AND version = $2;`, moduleVersionStateColumns)
row := db.db.QueryRow(ctx, query, modulePath, version)
- // Ignore the incompatible column, it is only used for sorting.
- scan := func(dests ...interface{}) error {
- var incompatible bool
- return row.Scan(append(dests, &incompatible)...)
- }
- v, err := scanModuleVersionState(scan)
+ v, err := scanModuleVersionState(row.Scan)
switch err {
case nil:
return v, nil