From: Sehrope Sarkuni <sehrope@jackdb.com>
To: pgsql-jdbc@lists.postgresql.org
Subject: [pgjdbc/pgjdbc] 0999bb: Fix TestUtil.dropXyz(...) object not exists errors...
Date: Wed, 05 Dec 2018 03:02:07 -0800
Message-ID: <5c07b02f1ba13_4a892ab63ff56584367d7@hookshot-fe-32b5f5b.cp1-iad.github.net.mail> (raw)
Branch: refs/heads/master
Home: https://github.com/pgjdbc/pgjdbc
Commit: 0999bb78ecb0a305f830d8b76ae24f6e64444ec8
https://github.com/pgjdbc/pgjdbc/commit/0999bb78ecb0a305f830d8b76ae24f6e64444ec8
Author: Sehrope Sarkuni <sehrope@jackdb.com>
Date: 2018-12-05 (Wed, 05 Dec 2018)
Changed paths:
M pgjdbc/src/test/java/org/postgresql/test/TestUtil.java
M pgjdbc/src/test/java/org/postgresql/test/jdbc2/DatabaseMetaDataTest.java
Log Message:
-----------
Fix TestUtil.dropXyz(...) object not exists errors (#1359)
* test: Change drop object utilities in TestUtils to use IF EXISTS
Changes most drop object helper methods in TestUtils to check if a transaction
is in progress and, if not, then use IF EXISTS to suppress errors for missing
objects during the DROP command.
If a transaction is in progress then the command then the drop is executed
without the IF EXISTS clause so that missing objects results in an exception
and test failure.
In either case an unrelated error such as the server being offline will be now
throw an exception. This is a change from the prior behavior where all errors
that are not part of a transaction were being suppressed.
errors if the object being dropped does not exist.
* test: Change TestUtil.dropSequence(...) to add CASCADE
Adds CASCADE option to TestUtils.dropSequence(...) helper to handle
dependency errors in drop statements that previously being ignored.
* test: Add shouldDrop param to TestUtils.createCompositeType(...)
Also adds a method matching the previous signature without the new parameter
and defaulting to the older behaviour of true (i.e. drop then create).
* test: Use explicit drop type statements for metadata tests
Adds explicit drop statements for types in metadata tests to ensure
the drop statements are executed in the correct order. Also adds a
drop statement for the reference table.
The revised drop order is required as TestUtils no longer skips over
non-missing object errors when dropping objects.
* test: Clean up throws clauses in TestUtil
Restricts throws clauses in TestUtil to SQLException rather than a
more broad Exception and removes throws clause from initDriver().
**NOTE:** This service has been marked for deprecation: https://developer.github.com/changes/2018-04-25-github-services-deprecation/
Functionality will be removed from GitHub.com on January 31st, 2019.
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-jdbc@postgresql.org
Cc: sehrope@jackdb.com
Subject: Re: [pgjdbc/pgjdbc] 0999bb: Fix TestUtil.dropXyz(...) object not exists errors...
In-Reply-To: <5c07b02f1ba13_4a892ab63ff56584367d7@hookshot-fe-32b5f5b.cp1-iad.github.net.mail>
References: <5c07b02f1ba13_4a892ab63ff56584367d7@hookshot-fe-32b5f5b.cp1-iad.github.net.mail>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox