Project:
View Issue Details[ Jump to Notes ] | [ Issue History ] [ Print ] | |||||||
ID | ||||||||
0049897 | ||||||||
Type | Category | Severity | Reproducibility | Date Submitted | Last Update | |||
defect | [Openbravo ERP] Y. DBSourceManager | major | have not tried | 2022-07-28 13:19 | 2022-11-18 09:23 | |||
Reporter | shuehner | View Status | public | |||||
Assigned To | alostale | |||||||
Priority | normal | Resolution | fixed | Fixed in Version | PR22Q4 | |||
Status | closed | Fix in branch | Fixed in SCM revision | |||||
Projection | none | ETA | none | Target Version | PR22Q4 | |||
OS | Any | Database | Any | Java version | ||||
OS Version | Database version | Ant version | ||||||
Product Version | SCM revision | |||||||
Merge Request Status | approved | |||||||
Review Assigned To | ||||||||
OBNetwork customer | OBPS | |||||||
Web browser | ||||||||
Modules | Core | |||||||
Support ticket | ||||||||
Regression level | ||||||||
Regression date | ||||||||
Regression introduced in release | ||||||||
Regression introduced by commit | ||||||||
Triggers an Emergency Pack | No | |||||||
Summary | 0049897: Add missing support for referencing other columns in onCreateDefault during importsampledata | |||||||
Description | onCreateDefault support sql-expressions on top of just fixed constant literals. That is fully implemented during update.database. However this logic used during import.sampledata currently only supports constant literals. We should add support for at least one common case which is referencing another column of the same table (to copy the data from). Example snippet for a module adding such a column to M_LOCATOR table. <column name="NEW_COLUMN_CODE" primaryKey="false" required="true" type="NVARCHAR" size="40" autoIncrement="false"> <default/> <onCreateDefault><![CDATA[VALUE]]></onCreateDefault> </column> | |||||||
Steps To Reproduce | Add a new required column to an existing table with definition shown above (i.e. table M_LOCATOR) Do NOT modify sampledata to contain data for the new column. Run install.source and observe not-null constraint violation for the new column. | |||||||
Proposed Solution | Add code to existing logic supporting 'onCreateDefault for not null column during import.sampledata' to detect: - Referencing another column on the same table - Replace column reference by 'value' of that other column planned to be inserted. | |||||||
Tags | No tags attached. | |||||||
Attached Files | ||||||||
![]() |
|||||||||||||||
|
![]() |
|
(0139668) shuehner (administrator) 2022-07-28 13:20 |
Adding short due-date as discussed between ALO/SHU |
(0139678) hgbot (developer) 2022-07-28 14:27 |
Merge Request created: https://gitlab.com/openbravo/product/dbsm/-/merge_requests/33 [^] |
(0140062) hgbot (developer) 2022-08-11 13:09 |
Merge Request created: https://gitlab.com/openbravo/product/openbravo/-/merge_requests/679 [^] |
(0140063) hgbot (developer) 2022-08-11 13:10 |
Merge request merged: https://gitlab.com/openbravo/product/openbravo/-/merge_requests/679 [^] |
(0140064) hgbot (developer) 2022-08-11 13:10 |
Directly closing issue as related merge request is already approved. Repository: https://gitlab.com/openbravo/product/openbravo [^] Changeset: 594166468e5cd20dcc0b116a8cca822ec1bdc967 Author: Augusto Mauch <augusto.mauch@openbravo.com> Date: 11-08-2022 13:08:53 URL: https://gitlab.com/openbravo/product/openbravo/-/commit/594166468e5cd20dcc0b116a8cca822ec1bdc967 [^] Fixes ISSUE-49897: import sample data fails with OCD referencing a column --- M src-db/database/lib/dbsourcemanager.jar --- |
(0140065) hgbot (developer) 2022-08-11 13:10 |
Directly closing issue as related merge request is already approved. Repository: https://gitlab.com/openbravo/product/dbsm [^] Changeset: 1984dc6f1bcbd78eb33e445ce1518cd763872d33 Author: Asier Lostalé <asier.lostale@openbravo.com> Date: 28-07-2022 14:23:03 URL: https://gitlab.com/openbravo/product/dbsm/-/commit/1984dc6f1bcbd78eb33e445ce1518cd763872d33 [^] fixes BUG-49897: import sample data fails with OCD referencing a column If a mandatory column has an onCreateDefault consisting on an expression that simply references another column in that same table and sampledata with no value for that column is applied, it fails because only literal onCreateDefault are applied in this case. The logic has been extended to cover this case (not including recursivity), now the value of the referenced column is applied. --- A src-test/data/sampledata/REFERENCE_CREATEDEFAULT.xml A src-test/model/sampledata/SAMPLE_DATA_MODEL2.xml M src-test/src/org/openbravo/dbsm/test/sampledata/ImportSampleData.java M src/org/apache/ddlutils/io/DataToDatabaseSink.java M src/org/apache/ddlutils/model/Column.java --- |
(0140066) hgbot (developer) 2022-08-11 13:10 |
Merge request merged: https://gitlab.com/openbravo/product/dbsm/-/merge_requests/33 [^] |
![]() |
|||
Date Modified | Username | Field | Change |
2022-07-28 13:19 | shuehner | New Issue | |
2022-07-28 13:19 | shuehner | Assigned To | => Triage Platform Base |
2022-07-28 13:19 | shuehner | OBNetwork customer | => OBPS |
2022-07-28 13:19 | shuehner | Modules | => Core |
2022-07-28 13:19 | shuehner | Triggers an Emergency Pack | => No |
2022-07-28 13:20 | shuehner | Note Added: 0139668 | |
2022-07-28 14:27 | hgbot | Merge Request Status | => open |
2022-07-28 14:27 | hgbot | Note Added: 0139678 | |
2022-08-01 09:03 | AugustoMauch | Assigned To | Triage Platform Base => alostale |
2022-08-01 09:03 | AugustoMauch | Status | new => scheduled |
2022-08-11 11:40 | hgbot | Merge Request Status | open => approved |
2022-08-11 13:09 | hgbot | Note Added: 0140062 | |
2022-08-11 13:10 | hgbot | Resolution | open => fixed |
2022-08-11 13:10 | hgbot | Status | scheduled => closed |
2022-08-11 13:10 | hgbot | Note Added: 0140063 | |
2022-08-11 13:10 | hgbot | Fixed in Version | => PR22Q4 |
2022-08-11 13:10 | hgbot | Note Added: 0140064 | |
2022-08-11 13:10 | hgbot | Note Added: 0140065 | |
2022-08-11 13:10 | hgbot | Note Added: 0140066 | |
2022-11-18 09:23 | caristu | Relationship added | related to 0046647 |
2022-11-18 13:41 | caristu | Relationship added | related to 0050951 |
Copyright © 2000 - 2009 MantisBT Group |