2
0

Simplify CockroachDB detection

This commit is contained in:
Jack Christensen
2021-02-27 10:40:06 -06:00
parent 09371f21d0
commit 1dc7133a63
8 changed files with 31 additions and 71 deletions
+5 -15
View File
@@ -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")