TestQueryEncodeError: crdb now returns the same error as postgres

pull/1658/head
Nicola Murino 2023-06-19 19:09:36 +02:00 committed by Jack Christensen
parent aa263d4352
commit 20a40120ed
1 changed files with 2 additions and 9 deletions

View File

@ -587,15 +587,8 @@ func TestQueryEncodeError(t *testing.T) {
if rows.Err() == nil {
t.Error("Expected rows.Err() to return error, but it didn't")
}
if conn.PgConn().ParameterStatus("crdb_version") != "" {
if !strings.Contains(rows.Err().Error(), "SQLSTATE 08P01") {
// CockroachDB returns protocol_violation instead of invalid_text_representation
t.Error("Expected rows.Err() to return different error:", rows.Err())
}
} else {
if !strings.Contains(rows.Err().Error(), "SQLSTATE 22P02") {
t.Error("Expected rows.Err() to return different error:", rows.Err())
}
if !strings.Contains(rows.Err().Error(), "SQLSTATE 22P02") {
t.Error("Expected rows.Err() to return different error:", rows.Err())
}
}