But you know the password that has just been entered. Iterate over every hashed password. Hash the plaintext password you know, using the salt from the hashed password. If it's a match, record that the 2 users matched. Loop to next hashed password.
If they were plaintext it wouldn't need a linear search because the column could be indexed.