Project:
View Issue Details[ Jump to Notes ] | [ Issue History ] [ Print ] | |||||||
ID | ||||||||
0054768 | ||||||||
Type | Category | Severity | Reproducibility | Date Submitted | Last Update | |||
defect | [Openbravo ERP] A. Platform | major | always | 2024-02-27 08:32 | 2024-10-19 09:52 | |||
Reporter | malsasua | View Status | public | |||||
Assigned To | AugustoMauch | |||||||
Priority | urgent | Resolution | fixed | Fixed in Version | PR24Q4 | |||
Status | closed | Fix in branch | Fixed in SCM revision | |||||
Projection | none | ETA | none | Target Version | ||||
OS | Any | Database | Any | Java version | ||||
OS Version | Database version | Ant version | ||||||
Product Version | SCM revision | |||||||
Review Assigned To | ||||||||
Web browser | ||||||||
Modules | Core | |||||||
Regression level | ||||||||
Regression date | ||||||||
Regression introduced in release | ||||||||
Regression introduced by commit | ||||||||
Triggers an Emergency Pack | No | |||||||
Summary | 0054768: compilation error: [java] org.postgresql.util.PSQLException: Bad value for type int : 2173831272 | |||||||
Description | Executing update.database command, error is happening when the postgresql OID assigned to functions is higher than max int value (2,147,483,647). To check what is the OID assigned for each function: SELECT proname, oid, proconfig FROM pg_proc order by oid desc; The OID is read in update.database command using getInt function. For this reason, when this value is higher than max INT value, the below error is raised: [java] org.postgresql.util.PSQLException: Bad value for type int : 2173831272 [java] at org.postgresql.jdbc.PgResultSet.toInt(PgResultSet.java:2834) ~[postgresql-42.2.2.jre7.jar:42.2.2.jre7] [java] at org.postgresql.jdbc.PgResultSet.getInt(PgResultSet.java:2067) ~[postgresql-42.2.2.jre7.jar:42.2.2.jre7] [java] at org.apache.commons.dbcp.DelegatingResultSet.getInt(DelegatingResultSet.java:225) ~[commons-dbcp-1.4.jar:1.4] [java] at org.apache.commons.dbcp.DelegatingResultSet.getInt(DelegatingResultSet.java:225) ~[commons-dbcp-1.4.jar:1.4] [java] at org.apache.ddlutils.platform.postgresql.PostgreSqlModelLoader$1.fillRow(PostgreSqlModelLoader.java:432) ~[dbsourcemanager.jar:?] [java] at org.apache.ddlutils.platform.ModelLoaderBase.fillList(ModelLoaderBase.java:871) ~[dbsourcemanager.jar:?] [java] at org.apache.ddlutils.platform.postgresql.PostgreSqlModelLoader.readFunction(PostgreSqlModelLoader.java:429) ~[dbsourcemanager.jar:?] [java] at org.apache.ddlutils.platform.ModelLoaderBase$28.getRow(ModelLoaderBase.java:661) ~[dbsourcemanager.jar:?] [java] at org.apache.ddlutils.platform.ModelLoaderBase.readList(ModelLoaderBase.java:816) ~[dbsourcemanager.jar:?] [java] at org.apache.ddlutils.platform.ModelLoaderBase.readFunctions(ModelLoaderBase.java:657) ~[dbsourcemanager.jar:?] [java] at org.apache.ddlutils.platform.ModelLoaderBase.readDatabase(ModelLoaderBase.java:216) ~[dbsourcemanager.jar:?] [java] at org.apache.ddlutils.platform.postgresql.PostgreSqlModelLoader.readDatabase(PostgreSqlModelLoader.java:90) ~[dbsourcemanager.jar:?] | |||||||
Steps To Reproduce | Preparation - create enough database objects (roughly 2,147,483,647) - It should be enough to create+drop objects just to drive up oid usage - There is be NO need to keep all all those objects at once - oid are global per database so type of objects created should not matter - drop function next_day (to force its recreation) - run update.database to recreate that function - check that "SELECT proname, oid, proconfig FROM pg_proc where proname = 'next_day' returns number high enough Reproducer: - Run update.database - Step reading model will read functions and trip over the high value Note: - next_day function is just example function to trigger this issue - Should work for any function being read during 'Reading functions...' step I.e. everything not in excludeFilter.xml | |||||||
Tags | No tags attached. | |||||||
Attached Files | ||||||||
Relationships [ Relation Graph ] [ Dependency Graph ] | |||||||||||||||
|
Notes | |
(0161291) shuehner (administrator) 2024-02-27 09:52 |
Error observed is likely coming from here: https://gitlab.com/openbravo/product/dbsm/-/blob/master/src/org/apache/ddlutils/platform/postgresql/PostgreSqlModelLoader.java?ref_type=heads#L436 [^] Where we read list of functions (including their oid) to later in a loop using this oid to retrieve more data NOTE: - We need to check more oid + getInt usage. - Not just in git master but also against the target version for customer backport (19Q3-ish) of this bug-reprt - It looks like that older code has another oid-usage not present (or just in different place in git master) see same file:_stmt_oids_tables |
(0161300) hgbot (developer) 2024-02-27 11:55 |
Merge Request created: https://gitlab.com/openbravo/product/dbsm/-/merge_requests/46 [^] |
(0161301) hgbot (developer) 2024-02-27 11:56 |
Merge Request created: https://gitlab.com/openbravo/product/openbravo/-/merge_requests/1153 [^] |
(0169545) hgbot (developer) 2024-09-24 17:51 |
Directly closing issue as related merge request is already approved. Repository: https://gitlab.com/openbravo/product/dbsm [^] Changeset: e38ac5a01677cb654de360cce040a6b4a96993c3 Author: Asier Lostalé <a.lostale@orisha.com> Date: 23-09-2024 21:06:14 URL: https://gitlab.com/openbravo/product/dbsm/-/commit/e38ac5a01677cb654de360cce040a6b4a96993c3 [^] fixes BUG-54768: error reading functions if oid excedes max int value When oid excedes the maximum value for int in Java, an error is thrown reading functions from pg catalog. Changed to read them as long instead of integer. --- M src/org/apache/ddlutils/platform/postgresql/PostgreSqlModelLoader.java --- |
(0169546) hgbot (developer) 2024-09-24 17:51 |
Merge request merged: https://gitlab.com/openbravo/product/dbsm/-/merge_requests/46 [^] |
(0169547) hgbot (developer) 2024-09-24 17:51 |
Merge request merged: https://gitlab.com/openbravo/product/openbravo/-/merge_requests/1153 [^] |
(0169548) hgbot (developer) 2024-09-24 17:51 |
Directly closing issue as related merge request is already approved. Repository: https://gitlab.com/openbravo/product/openbravo [^] Changeset: 30a202d72fe0343c626c7910a8aac7eab2e9aed1 Author: Augusto Mauch <a.mauch@orisha.com> Date: 23-09-2024 23:09:16 URL: https://gitlab.com/openbravo/product/openbravo/-/commit/30a202d72fe0343c626c7910a8aac7eab2e9aed1 [^] fixes BUG-54768: error reading functions if oid excedes max int value --- M src-db/database/lib/dbsourcemanager.jar --- |
Issue History | |||
Date Modified | Username | Field | Change |
2024-02-27 08:32 | malsasua | New Issue | |
2024-02-27 08:32 | malsasua | Assigned To | => Triage Platform Base |
2024-02-27 08:32 | malsasua | Modules | => Core |
2024-02-27 08:32 | malsasua | Triggers an Emergency Pack | => No |
2024-02-27 08:33 | malsasua | Priority | high => urgent |
2024-02-27 09:47 | shuehner | Description Updated | View Revisions |
2024-02-27 09:47 | shuehner | Steps to Reproduce Updated | View Revisions |
2024-02-27 09:52 | shuehner | Note Added: 0161291 | |
2024-02-27 11:55 | hgbot | Note Added: 0161300 | |
2024-02-27 11:56 | hgbot | Note Added: 0161301 | |
2024-03-18 12:38 | egoitz | Relationship added | related to 0054980 |
2024-09-10 16:56 | AugustoMauch | Assigned To | Triage Platform Base => AugustoMauch |
2024-09-10 16:57 | AugustoMauch | Status | new => acknowledged |
2024-09-24 17:51 | hgbot | Resolution | open => fixed |
2024-09-24 17:51 | hgbot | Status | acknowledged => closed |
2024-09-24 17:51 | hgbot | Note Added: 0169545 | |
2024-09-24 17:51 | hgbot | Note Added: 0169546 | |
2024-09-24 17:51 | hgbot | Note Added: 0169547 | |
2024-09-24 17:51 | hgbot | Fixed in Version | => PR24Q4 |
2024-09-24 17:51 | hgbot | Note Added: 0169548 | |
2024-10-19 09:52 | AugustoMauch | Issue cloned | 0056837 |
2024-10-19 09:53 | AugustoMauch | Relationship added | related to 0056837 |
Copyright © 2000 - 2009 MantisBT Group |