mirror of https://github.com/jackc/pgx.git
Cockroach DB uses different error code
parent
ec5dfb472c
commit
5f58e0e443
|
@ -627,9 +627,16 @@ func TestQueryEncodeError(t *testing.T) {
|
||||||
if rows.Err() == nil {
|
if rows.Err() == nil {
|
||||||
t.Error("Expected rows.Err() to return error, but it didn't")
|
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") {
|
if !strings.Contains(rows.Err().Error(), "SQLSTATE 22P02") {
|
||||||
t.Error("Expected rows.Err() to return different error:", rows.Err())
|
t.Error("Expected rows.Err() to return different error:", rows.Err())
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestQueryRowCoreTypes(t *testing.T) {
|
func TestQueryRowCoreTypes(t *testing.T) {
|
||||||
|
|
Loading…
Reference in New Issue