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
+4 -12
View File
@@ -18,9 +18,7 @@ func TestConnSendBatch(t *testing.T) {
conn := mustConnectString(t, os.Getenv("PGX_TEST_DATABASE"))
defer closeConn(t, conn)
if conn.PgConn().ParameterStatus("crdb_version") != "" {
t.Skip("Server serial type is incompatible with test")
}
skipCockroachDB(t, conn, "Server serial type is incompatible with test")
sql := `create temporary table ledger(
id serial primary key,
@@ -189,9 +187,7 @@ func TestConnSendBatchWithPreparedStatement(t *testing.T) {
conn := mustConnectString(t, os.Getenv("PGX_TEST_DATABASE"))
defer closeConn(t, conn)
if conn.PgConn().ParameterStatus("crdb_version") != "" {
t.Skip("Server issues incorrect ParameterDescription (https://github.com/cockroachdb/cockroach/issues/60907)")
}
skipCockroachDB(t, conn, "Server issues incorrect ParameterDescription (https://github.com/cockroachdb/cockroach/issues/60907)")
_, err := conn.Prepare(context.Background(), "ps1", "select n from generate_series(0,$1::int) n")
if err != nil {
@@ -248,9 +244,7 @@ func TestConnSendBatchWithPreparedStatementAndStatementCacheDisabled(t *testing.
conn := mustConnect(t, config)
defer closeConn(t, conn)
if conn.PgConn().ParameterStatus("crdb_version") != "" {
t.Skip("Server issues incorrect ParameterDescription (https://github.com/cockroachdb/cockroach/issues/60907)")
}
skipCockroachDB(t, conn, "Server issues incorrect ParameterDescription (https://github.com/cockroachdb/cockroach/issues/60907)")
_, err = conn.Prepare(context.Background(), "ps1", "select n from generate_series(0,$1::int) n")
if err != nil {
@@ -605,9 +599,7 @@ func TestConnBeginBatchDeferredError(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,