summaryrefslogtreecommitdiff
path: root/tests/run.scm
diff options
context:
space:
mode:
authorPeter Bex <peter@more-magic.net>2024-09-12 18:46:04 +0200
committerPeter Bex <peter@more-magic.net>2024-09-12 18:46:04 +0200
commitc1a36cc2c67de45c4f6db6ecd2cc9102c5170ba2 (patch)
tree545158a192d2ac7d53373626bd21e9023dd0aef8 /tests/run.scm
parent54cf30131d9cb64588d7a0a27d34653681cbd567 (diff)
downloadchicken-postgresql-c1a36cc2c67de45c4f6db6ecd2cc9102c5170ba2.tar.gz
Fix a few tests that no longer work in newer Postgres versions4.1.5
The WITH(OIDS=true) attribute for CREATE TABLE is no longer supported since version 12. So simply don't run the test for inserted-oid. I *think* this means the inserted-oid procedure is completely useless now, but I'm not 100% sure. The pg_type table has grown a "oid" column in 9.3 which comes before the "typename" column, which used to be the first. So the test is a bit too tightly coupled to the postgres system catalog. Move the test to where we create actual tables and use it on that, instead.
Diffstat (limited to 'tests/run.scm')
-rw-r--r--tests/run.scm24
1 files changed, 13 insertions, 11 deletions
diff --git a/tests/run.scm b/tests/run.scm
index 21daa09..ff4c0d2 100644
--- a/tests/run.scm
+++ b/tests/run.scm
@@ -121,10 +121,6 @@
(exn postgresql bounds)
(table-oid
(query conn "SELECT typname FROM pg_type") 1))
- (test "Table column number for real table"
- 0
- (table-column-index
- (query conn "SELECT typname FROM pg_type") 0))
(test "Column format is text for normal data"
'text
(column-format
@@ -257,6 +253,10 @@
1
(affected-rows
(query conn "INSERT INTO foo (bar) VALUES (1);")))
+ (test "Table column number for real table"
+ 0
+ (table-column-index
+ (query conn "SELECT bar FROM foo") 0))
(query conn "COMMIT")
(query conn "BEGIN")
@@ -282,13 +282,15 @@
(query conn "INSERT INTO foo (bar) VALUES (1);")))
(query conn "COMMIT")
- (query conn "BEGIN")
- (query conn "CREATE TEMP TABLE foo ( bar integer ) WITH (OIDS=true) ON COMMIT DROP")
- (test-assert "Inserted OID number on table with OID"
- (number?
- (inserted-oid
- (query conn "INSERT INTO foo (bar) VALUES (1)"))))
- (query conn "COMMIT")
+ ;; Since Postgres 12, WITH OIDS is not supported anymore
+ (when (< major-version 12)
+ (query conn "BEGIN")
+ (query conn "CREATE TEMP TABLE foo ( bar integer ) WITH (OIDS=true) ON COMMIT DROP")
+ (test-assert "Inserted OID number on table with OID"
+ (number?
+ (inserted-oid
+ (query conn "INSERT INTO foo (bar) VALUES (1)"))))
+ (query conn "COMMIT"))
(test "regular parameters"
"hi"