Anonymous | Login
News | My View | View Issues | Roadmap | Summary

View Issue DetailsJump to Notes ] Issue History ] Print ]
TypeCategorySeverityReproducibilityDate SubmittedLast Update
defect[Openbravo ERP] Y. DBSourceManagerminorhave not tried2019-02-25 10:352019-02-25 10:35
ReporterAugustoMauchView Statuspublic 
Assigned Toplatform 
PrioritynormalResolutionopenFixed in Version
StatusnewFix in branchFixed in SCM revision
ProjectionnoneETAnoneTarget Version
OSAnyDatabaseAnyJava version
OS VersionDatabase versionAnt version
Product VersionSCM revision 
Review Assigned To
Web browser
Regression level
Regression date
Regression introduced in release
Regression introduced by commit
Triggers an Emergency PackNo

0040264: update.database task fails with no proper error message when a wrong function is defined in db but not excluded

DescriptionThere are some functions that are not defined as part of Openbravo model and that they must be excluded from being loaded by adding them to the exclude filter.

Whe one of those functions is not added to the exclude filter, the update.database function will fail, and the error message will not be clear enough:

 [java] 67129 INFO - Updating database model...
     [java] 67335 ERROR -
     [java] java.lang.NullPointerException
     [java] at org.apache.ddlutils.model.Parameter.getName(
     [java] at org.apache.ddlutils.platform.postgresql.PostgreSqlBuilder.writeParameter(
     [java] at org.apache.ddlutils.platform.postgresql.PostgreSqlBuilder.writeDropFunctionStmt(
     [java] at org.apache.ddlutils.platform.SqlBuilder.dropFunction(
     [java] at org.apache.ddlutils.platform.postgresql.PostgreSqlBuilder.dropFunction(
     [java] at org.apache.ddlutils.platform.SqlBuilder.processChange(
     [java] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
     [java] at sun.reflect.NativeMethodAccessorImpl.invoke(
     [java] at sun.reflect.DelegatingMethodAccessorImpl.invoke(
     [java] at java.lang.reflect.Method.invoke(
     [java] at org.apache.ddlutils.util.CallbackClosure.execute(
     [java] at org.apache.ddlutils.platform.SqlBuilder$1.evaluate(
     [java] at org.apache.commons.collections.CollectionUtils.filter(
     [java] at org.apache.ddlutils.platform.SqlBuilder.applyForSelectedChanges(

Even if the dbsourcemanager log is set to debug, it still does not what was the function that caused the error while being loaded from the database. The cause of the error is that Openbravo does not support to load functions with unnamed parameters.
Steps To ReproduceCreate this function directly in the database:

CREATE FUNCTION bad_function(integer, integer) RETURNS integer
    AS 'select $1 + $2;'

Run ant update.database -Dforce=yes

The process will fail and it will throw the error mentioned in the description
Proposed SolutionIt would be better to:
- Fail like now, but mentioning in the error message the function that was being loaded and telling that update.database will not work until that function is added to exclude filter / removed from database
- When a function with unnamed parameters is loaded, just ignore and show a warning message.
TagsNo tags attached.
Attached Files

- Relationships Relation Graph ] Dependency Graph ]

-  Notes
There are no notes attached to this issue.

- Issue History
Date Modified Username Field Change
2019-02-25 10:35 AugustoMauch New Issue
2019-02-25 10:35 AugustoMauch Assigned To => platform
2019-02-25 10:35 AugustoMauch Modules => Core
2019-02-25 10:35 AugustoMauch Triggers an Emergency Pack => No

Copyright © 2000 - 2009 MantisBT Group
Powered by Mantis Bugtracker