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

Null Pointer Exception using trigger #272

Open
cederache opened this issue Mar 26, 2020 · 3 comments
Open

Null Pointer Exception using trigger #272

cederache opened this issue Mar 26, 2020 · 3 comments

Comments

@cederache
Copy link

cederache commented Mar 26, 2020

Hi everyone,
I have an issue using apgdif 2.0.6 with the creation of a trigger.

All the previous trigger did not cause the issue except for this one.

The issue can easily be created using the command :
java -jar apgdiff-2.6.0.jar prod.sql dev.sql

With dev.sql :

CREATE TABLE test  
(  
id uuid DEFAULT public.gen_random_uuid() NOT NULL,  
name text NOT NULL  
);

CREATE FUNCTION trigger_test() RETURNS trigger  
LANGUAGE plpgsql SECURITY DEFINER  
AS $$  
begin  
RAISE LOG 'test';  
return null;  
end;  
$$;

CREATE TRIGGER test_write INSTEAD OF INSERT OR UPDATE OR DELETE ON test FOR EACH ROW EXECUTE PROCEDURE trigger_test();

And prod.sql is an empty file

@cederache
Copy link
Author

Here is the missing logs :

Exception in thread "main" java.lang.NullPointerException
at cz.startnet.utils.pgdiff.PgDiffTriggers.getEnablerOrDisableTriggers(PgDiffTriggers.java:222)
at cz.startnet.utils.pgdiff.PgDiffTriggers.disableOrEnableTriggers(PgDiffTriggers.java:256)
at cz.startnet.utils.pgdiff.PgDiff.updateSchemas(PgDiff.java:321)
at cz.startnet.utils.pgdiff.PgDiff.diffDatabaseSchemas(PgDiff.java:144)
at cz.startnet.utils.pgdiff.PgDiff.createDiff(PgDiff.java:46)
at cz.startnet.utils.pgdiff.Main.main(Main.java:39)

@nphard
Copy link

nphard commented Jun 4, 2020

I have the same problem

@d1maxa
Copy link

d1maxa commented Jul 28, 2020

Hi guys, this problem looks solved in #255 already

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

No branches or pull requests

3 participants