Simplify CockroachDB detection
This commit is contained in:
+5
-15
@@ -542,9 +542,7 @@ func TestConnQueryDeferredError(t *testing.T) {
|
||||
conn := mustConnectString(t, os.Getenv("PGX_TEST_DATABASE"))
|
||||
defer closeConn(t, conn)
|
||||
|
||||
if conn.PgConn().ParameterStatus("crdb_version") != "" {
|
||||
t.Skip("Server does not support deferred constraint (https://github.com/cockroachdb/cockroach/issues/31632)")
|
||||
}
|
||||
skipCockroachDB(t, conn, "Server does not support deferred constraint (https://github.com/cockroachdb/cockroach/issues/31632)")
|
||||
|
||||
mustExec(t, conn, `create temporary table t (
|
||||
id text primary key,
|
||||
@@ -586,9 +584,7 @@ func TestConnQueryErrorWhileReturningRows(t *testing.T) {
|
||||
conn := mustConnectString(t, os.Getenv("PGX_TEST_DATABASE"))
|
||||
defer closeConn(t, conn)
|
||||
|
||||
if conn.PgConn().ParameterStatus("crdb_version") != "" {
|
||||
t.Skip("Server uses numeric instead of int")
|
||||
}
|
||||
skipCockroachDB(t, conn, "Server uses numeric instead of int")
|
||||
|
||||
for i := 0; i < 100; i++ {
|
||||
func() {
|
||||
@@ -1365,9 +1361,7 @@ func TestQueryContextErrorWhileReceivingRows(t *testing.T) {
|
||||
conn := mustConnectString(t, os.Getenv("PGX_TEST_DATABASE"))
|
||||
defer closeConn(t, conn)
|
||||
|
||||
if conn.PgConn().ParameterStatus("crdb_version") != "" {
|
||||
t.Skip("Server uses numeric instead of int")
|
||||
}
|
||||
skipCockroachDB(t, conn, "Server uses numeric instead of int")
|
||||
|
||||
ctx, cancelFunc := context.WithCancel(context.Background())
|
||||
defer cancelFunc()
|
||||
@@ -1889,9 +1883,7 @@ func TestConnSimpleProtocolRefusesNonUTF8ClientEncoding(t *testing.T) {
|
||||
conn := mustConnectString(t, os.Getenv("PGX_TEST_DATABASE"))
|
||||
defer closeConn(t, conn)
|
||||
|
||||
if conn.PgConn().ParameterStatus("crdb_version") != "" {
|
||||
t.Skip("Server does not support changing client_encoding (https://www.cockroachlabs.com/docs/stable/set-vars.html)")
|
||||
}
|
||||
skipCockroachDB(t, conn, "Server does not support changing client_encoding (https://www.cockroachlabs.com/docs/stable/set-vars.html)")
|
||||
|
||||
mustExec(t, conn, "set client_encoding to 'SQL_ASCII'")
|
||||
|
||||
@@ -1915,9 +1907,7 @@ func TestConnSimpleProtocolRefusesNonStandardConformingStrings(t *testing.T) {
|
||||
conn := mustConnectString(t, os.Getenv("PGX_TEST_DATABASE"))
|
||||
defer closeConn(t, conn)
|
||||
|
||||
if conn.PgConn().ParameterStatus("crdb_version") != "" {
|
||||
t.Skip("Server does not support standard_conforming_strings = off (https://github.com/cockroachdb/cockroach/issues/36215)")
|
||||
}
|
||||
skipCockroachDB(t, conn, "Server does not support standard_conforming_strings = off (https://github.com/cockroachdb/cockroach/issues/36215)")
|
||||
|
||||
mustExec(t, conn, "set standard_conforming_strings to off")
|
||||
|
||||
|
||||
Reference in New Issue
Block a user