A B (JIRA) wrote:
NPE when creating a trigger on a table and default schema doesn't exist. ------------------------------------------------------------------------
[ snip ]

A look at the derby.log file shows the stack trace given below. In a word, it looks like the "compilation schema" field of SYS.SYSTRIGGERS isn't getting set, and so it ends up being null. That causes the NPE in subsequent processing...
[ snip ]

The compilation schema for a trigger is set to "current schema" at the time the trigger is created. In the repro given for this bug, "current schema" is (by default) "SOMEUSER", but since that schema doesn't exist, it looks like we end up setting compilation schema to null.

So, which of the following would be the preferred fix?

1) Force the implicit creation of "current schema" if it doesn't exist, and _then_ set compilation schema to "current schema"?

2) Set "compilation schema" to something other than "current schema" if "current schema" doesn't exist? What would we use, then?

3) Leave "compilation schema" null, and add logic to check for it and behave appropriately? What exactly "appropriately" means would depend on the context...(this seems like a faulty approach, but I thought I'd mention it...).

4) Something else entirely?

Anyone have any suggestions?
Army

Reply via email to