Don't fetch rows that we won't modify
@@ -129,6 +129,7 @@ func encryptPlaintext(logger lager.Logger, sqlDB *sql.DB, key *encryption.Key) e
SELECT id, ` + col + `
FROM ` + table + `
WHERE nonce IS NULL
+ AND ` + col + ` IS NOT NULL
`)
if err != nil {
return err
