Anonymous | Login
Project:
RSS
  
News | My View | View Issues | Roadmap | Summary

View Issue DetailsJump to Notes ] Issue History ] Print ]
ID
0040264
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
ModulesCore
Regression level
Regression date
Regression introduced in release
Regression introduced by commit
Triggers an Emergency PackNo
Summary

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(Parameter.java:53)
     [java] at org.apache.ddlutils.platform.postgresql.PostgreSqlBuilder.writeParameter(PostgreSqlBuilder.java:529)
     [java] at org.apache.ddlutils.platform.postgresql.PostgreSqlBuilder.writeDropFunctionStmt(PostgreSqlBuilder.java:346)
     [java] at org.apache.ddlutils.platform.SqlBuilder.dropFunction(SqlBuilder.java:4276)
     [java] at org.apache.ddlutils.platform.postgresql.PostgreSqlBuilder.dropFunction(PostgreSqlBuilder.java:519)
     [java] at org.apache.ddlutils.platform.SqlBuilder.processChange(SqlBuilder.java:1543)
     [java] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
     [java] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
     [java] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
     [java] at java.lang.reflect.Method.invoke(Method.java:498)
     [java] at org.apache.ddlutils.util.CallbackClosure.execute(CallbackClosure.java:151)
     [java] at org.apache.ddlutils.platform.SqlBuilder$1.evaluate(SqlBuilder.java:1024)
     [java] at org.apache.commons.collections.CollectionUtils.filter(CollectionUtils.java:406)
     [java] at org.apache.ddlutils.platform.SqlBuilder.applyForSelectedChanges(SqlBuilder.java:1021)

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;'
    LANGUAGE SQL
    IMMUTABLE
    RETURNS NULL ON NULL INPUT;

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