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

View Issue DetailsJump to Notes ] Issue History ] Print ]
ID
0036862
TypeCategorySeverityReproducibilityDate SubmittedLast Update
defect[Openbravo ERP] A. Platformmajorhave not tried2017-09-15 08:582017-09-25 13:30
ReporterAugustoMauchView Statuspublic 
Assigned Toalostale 
PrioritynormalResolutionfixedFixed in Version3.0PR17Q4
StatusclosedFix in branchFixed in SCM revision053c21c0408a
ProjectionnoneETAnoneTarget Version
OSAnyDatabasePostgreSQLJava version
OS VersionDatabase version9.6Ant version
Product VersionSCM revision 
Review Assigned ToAugustoMauch
Web browser
ModulesCore
Regression level
Regression date
Regression introduced in release
Regression introduced by commit
Triggers an Emergency PackNo
Summary

0036862: update.database throws NPE in PostgreSQL 9.6

DescriptionUpdate.database fails if executed on an Openbravo instance that uses PostgreSQL 9.6. With the following error:

[java] 20297 INFO - Updating database model...
[java] org.apache.ddlutils.DdlUtilsException: java.lang.NullPointerException
[java] at org.apache.ddlutils.util.CallbackClosure.execute(CallbackClosure.java:154)
[java] at org.apache.ddlutils.platform.SqlBuilder$1.evaluate(SqlBuilder.java:975)
[java] at org.apache.commons.collections.CollectionUtils.filter(CollectionUtils.java:406)
[java] at org.apache.ddlutils.platform.SqlBuilder.applyForSelectedChanges(SqlBuilder.java:972)
[java] at org.apache.ddlutils.platform.SqlBuilder.processChanges(SqlBuilder.java:1060)
[java] at org.apache.ddlutils.platform.SqlBuilder.alterDatabase(SqlBuilder.java:576)
[java] at org.apache.ddlutils.platform.SqlBuilder.alterDatabase(SqlBuilder.java:562)
[java] at org.apache.ddlutils.platform.PlatformImplBase.alterTables(PlatformImplBase.java:679)
[java] at org.apache.ddlutils.platform.PlatformImplBase.alterTables(PlatformImplBase.java:662)
[java] at org.openbravo.ddlutils.task.AlterDatabaseDataAll.doExecute(AlterDatabaseDataAll.java:178)
[java] at org.openbravo.ddlutils.task.BaseDatabaseTask.execute(BaseDatabaseTask.java:86)
[java] at org.openbravo.ddlutils.task.AlterDatabaseJava.main(AlterDatabaseJava.java:57)
[java] Caused by: 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:506)
[java] at org.apache.ddlutils.platform.postgresql.PostgreSqlBuilder.writeDropFunctionStmt(PostgreSqlBuilder.java:346)
[java] at org.apache.ddlutils.platform.SqlBuilder.dropFunction(SqlBuilder.java:4224)
[java] at org.apache.ddlutils.platform.postgresql.PostgreSqlBui20485 ERROR -
[java] java.lang.NullPointerException

The functions that are causing the error when trying to be dropped are:
- GIN_TRGM_TRICONSISTENT
- WORD_SIMILARITY
- etc

Those are functions defined by the new version of pg_trgm extension. The excludeFilter needs to be updated to exclude these new functions.
Steps To ReproduceIn an Openbravo instance with PostgreSQL 9.6:
- Run update.database. It will fail with a NullPointerException
Proposed SolutionThese are the functions defined by pg_trgm--1.1--1.2 [1] and by pg_trgm--1.3 [2]. Add exclusions for them in the exclude filter.

[1] https://github.com/postgres/postgres/blob/master/contrib/pg_trgm/pg_trgm--1.1--1.2.sql [^]
[2] https://github.com/postgres/postgres/blob/master/contrib/pg_trgm/pg_trgm--1.3.sql [^]
TagsNo tags attached.
Attached Files

- Relationships Relation Graph ] Dependency Graph ]
related to feature request 00346503.0PR17Q2 closedcaristu Ability to generate indexes to speed up searching using 'contains' operators 
has duplicate defect 0036043 closedplatform update.database fails with NullPointerException when using PostgreSQL 10beta1 
blocks feature request 0036914 closedalostale support PostgreSQL 9.6 

-  Notes
(0099211)
hgbot (developer)
2017-09-21 13:12

Repository: erp/devel/pi
Changeset: 053c21c0408aaec30fec4becace76591c115e2cb
Author: Asier Lostalé <asier.lostale <at> openbravo.com>
Date: Thu Sep 21 12:49:29 2017 +0200
URL: http://code.openbravo.com/erp/devel/pi/rev/053c21c0408aaec30fec4becace76591c115e2cb [^]

fixed bug 36862: update.database throws NPE in PG 6

  It was casued because starting from PG 9.6 a new version of pg_trgm extension
  is used which includes new functions that shouldn't be tried to be processed by
  dbsm.

  Those functions are now excluded.

---
M src-db/database/model/excludeFilter.xml
---
(0099213)
hgbot (developer)
2017-09-21 13:28

Repository: erp/devel/dbsm-main
Changeset: 03d63d4136e617234506e5091d16229b13c46cdb
Author: Asier Lostalé <asier.lostale <at> openbravo.com>
Date: Thu Sep 21 13:09:22 2017 +0200
URL: http://code.openbravo.com/erp/devel/dbsm-main/rev/03d63d4136e617234506e5091d16229b13c46cdb [^]

related to bug 36862: sync exclude filter for trgm with pi

---
M src-test/model/excludeFilter/excludePgTrgmFunctions.xml
---
(0099450)
hudsonbot (developer)
2017-09-22 03:19

A changeset related to this issue has been promoted main and to the
Central Repository, after passing a series of tests.

Promotion changeset: https://code.openbravo.com/erp/devel/main/rev/79f756868bba [^]
Maturity status: Test
(0099544)
AugustoMauch (developer)
2017-09-25 13:30

Code reviewed and verified

- Issue History
Date Modified Username Field Change
2017-09-15 08:58 AugustoMauch New Issue
2017-09-15 08:58 AugustoMauch Assigned To => platform
2017-09-15 08:58 AugustoMauch Modules => Core
2017-09-15 08:58 AugustoMauch Triggers an Emergency Pack => No
2017-09-15 09:09 AugustoMauch Description Updated View Revisions
2017-09-15 09:15 AugustoMauch Summary Upgrade excludeFilter in order to support PostgreSQL 9.6 => Upgrade excludeFilter in order to support new versions of the pg_trgm extension
2017-09-15 09:30 caristu Relationship added related to 0034650
2017-09-21 12:42 caristu Relationship added related to 0036911
2017-09-21 12:42 alostale Relationship added blocks 0036914
2017-09-21 13:04 alostale Relationship deleted related to 0036911
2017-09-21 13:06 alostale Review Assigned To => AugustoMauch
2017-09-21 13:06 alostale Type feature request => defect
2017-09-21 13:06 alostale Summary Upgrade excludeFilter in order to support new versions of the pg_trgm extension => update.database throws NPE in PG 6
2017-09-21 13:06 alostale Assigned To platform => alostale
2017-09-21 13:12 hgbot Checkin
2017-09-21 13:12 hgbot Note Added: 0099211
2017-09-21 13:12 hgbot Status new => resolved
2017-09-21 13:12 hgbot Resolution open => fixed
2017-09-21 13:12 hgbot Fixed in SCM revision => http://code.openbravo.com/erp/devel/pi/rev/053c21c0408aaec30fec4becace76591c115e2cb [^]
2017-09-21 13:15 alostale Relationship added has duplicate 0036043
2017-09-21 13:28 hgbot Checkin
2017-09-21 13:28 hgbot Note Added: 0099213
2017-09-21 13:32 shuehner Summary update.database throws NPE in PG 6 => update.database throws NPE in PostgreSQL 9.6
2017-09-22 03:19 hudsonbot Checkin
2017-09-22 03:19 hudsonbot Note Added: 0099450
2017-09-25 13:30 AugustoMauch Note Added: 0099544
2017-09-25 13:30 AugustoMauch Status resolved => closed
2017-09-25 13:30 AugustoMauch Fixed in Version => 3.0PR17Q4


Copyright © 2000 - 2009 MantisBT Group
Powered by Mantis Bugtracker