Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Flyway suppresses warnings silently on SQLException #843

Closed
cowwoc opened this issue Sep 16, 2014 · 1 comment
Closed

Flyway suppresses warnings silently on SQLException #843

cowwoc opened this issue Sep 16, 2014 · 1 comment

Comments

@cowwoc
Copy link

@cowwoc cowwoc commented Sep 16, 2014

Flyway 3.0

  1. Run the following postgresql script in a migration:
DROP FUNCTION IF EXISTS Test();
CREATE FUNCTION Test() RETURNS VOID AS $$
BEGIN
  RAISE WARNING 'This is a warning';
--  RAISE EXCEPTION 'This is an error';
END;
$$ LANGUAGE plpgsql;

SELECT Test();

2.. You will see This is a warning.
3.. Now, uncomment the RAISE EXCEPTION.
4.. You will see the error, but the warning will never get logged.

This means that if we have a broken script, we cannot use the log for debugging purposes because Flyway will not print them out.

Expected behavior: Flyway should print Connection.getWarnings() before handling statement errors.

@cowwoc cowwoc changed the title Flyway does not show warnings on migration failure Flyway suppresses warnings silently on SQLException Sep 16, 2014
@axelfontaine axelfontaine added this to the Flyway 3.1 milestone Sep 17, 2014
@axelfontaine
Copy link
Contributor

@axelfontaine axelfontaine commented Sep 17, 2014

Good catch and thanks for the sql to reproduce this!

Fixed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants