mirror of
https://github.com/jackc/pgx.git
synced 2025-05-15 12:01:19 +00:00
Cockroach DB uses different error code
This commit is contained in:
parent
38d43fc758
commit
abc5433890
@ -627,8 +627,15 @@ func TestQueryEncodeError(t *testing.T) {
|
||||
if rows.Err() == nil {
|
||||
t.Error("Expected rows.Err() to return error, but it didn't")
|
||||
}
|
||||
if !strings.Contains(rows.Err().Error(), "SQLSTATE 22P02") {
|
||||
t.Error("Expected rows.Err() to return different error:", rows.Err())
|
||||
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())
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user