Openbravo Issue Tracking System - Openbravo ERP |
View Issue Details |
|
ID | Project | Category | View Status | Date Submitted | Last Update |
0033417 | Openbravo ERP | A. Platform | public | 2016-07-04 15:56 | 2016-12-16 18:37 |
|
Reporter | Sandrahuguet | |
Assigned To | caristu | |
Priority | urgent | Severity | minor | Reproducibility | have not tried |
Status | closed | Resolution | fixed | |
Platform | | OS | 20 | OS Version | Community Appliance |
Product Version | | |
Target Version | 3.0PR17Q1 | Fixed in Version | 3.0PR17Q1 | |
Merge Request Status | |
Review Assigned To | alostale |
OBNetwork customer | |
Web browser | |
Modules | Core |
Support ticket | |
Regression level | |
Regression date | |
Regression introduced in release | |
Regression introduced by commit | |
Triggers an Emergency Pack | No |
|
Summary | 0033417: Loading config script for a module template in install.source task fails in pgsql 9.3 |
Description | Loading config script for a module template in install.source task fails in pgsql 9.3.
The same config script can be load using update.database task in pgsql and oracle and using install.source task in oracle.
|
Steps To Reproduce | -install the following module template:
https://code.openbravo.com/erp/pmods/org.openbravo.retail.storeserver.synchronization.template [^]
-ant install.source
Notice that the following error occurs in the execution of the task:
Loading config script for module Store Server Synchronized Tables for Retail Template. Path: /srv/ci/workspace/mod-simple-ci23.140/src-db/database/../../modules/org.openbravo.retail.storeserver.synchronization.template/src-db/database/configScript.xml
SQL Command failed with: ERROR: syntax error at or near "Y"
Position: 135
-- END
UPDATE AD_TAB SET HQLWHERECLAUSE = 'e.obstsynMobserver.id = (select id from OBMOBC_SERVER_DEFINITION ms where ms.iscurrent=\'Y\')' WHERE AD_TAB_ID = '8E5972CF3664486D9D887BDEDA88627D'
SQL Command failed with: ERROR: syntax error at or near "Y"
Position: 70
-- END
UPDATE AD_TAB SET HQLFILTERCLAUSE = 'e.securityBasedOnRole=\'Y\' or e.userContact.id=@user@\n' WHERE AD_TAB_ID = '8E5972CF3664486D9D887BDEDA88627D'
SQL Command failed with: ERROR: syntax error at or near "Y"
Position: 182
-- END
UPDATE AD_TAB SET HQLWHERECLAUSE = 'e.processRequest.id = @ProcessRequest.id@ and e.obstsynMobserver.id = (select id from OBMOBC_SERVER_DEFINITION ms where ms.iscurrent=\'Y\')' WHERE AD_TAB_ID = 'A22C68A803DA43D3AE1FFD51BBA3234A'
Executed 5 SQL command(s) with 3 error(s) |
Proposed Solution | Use the alterData method inside the applyConfigScript() method of the PlatformImplBase, this way a prepared statement with parameters will be used instead of make use of a query with scaped characters. |
Additional Information | |
Tags | No tags attached. |
Relationships | related to | defect | 0034022 | | acknowledged | Triage Platform Base | PostgreSqlBuilder configuration for escaped characters is not correct | related to | design defect | 0034102 | | closed | platform | Update.database and Install.Source tasks should use the same flow to create the database and the db model |
|
Attached Files | issue33417.diff (10,494) 2016-09-28 19:25 https://issues.openbravo.com/file_download.php?file_id=9870&type=bug |
|
Issue History |
Date Modified | Username | Field | Change |
2016-07-04 15:56 | Sandrahuguet | New Issue | |
2016-07-04 15:56 | Sandrahuguet | Assigned To | => platform |
2016-07-04 15:56 | Sandrahuguet | Modules | => Core |
2016-07-04 15:56 | Sandrahuguet | Triggers an Emergency Pack | => No |
2016-07-04 15:58 | Sandrahuguet | Steps to Reproduce Updated | bug_revision_view_page.php?rev_id=12604#r12604 |
2016-07-07 12:06 | AugustoMauch | Note Added: 0088287 | |
2016-07-14 12:19 | alostale | Status | new => acknowledged |
2016-07-26 07:56 | alostale | Priority | normal => urgent |
2016-07-26 07:56 | alostale | Target Version | => 3.0PR16Q4 |
2016-07-27 16:05 | shuehner | Issue Monitored: shuehner | |
2016-07-27 16:06 | shuehner | Note Added: 0088680 | |
2016-09-13 16:02 | caristu | Status | acknowledged => scheduled |
2016-09-13 16:02 | caristu | Assigned To | platform => caristu |
2016-09-19 19:15 | caristu | Proposed Solution updated | |
2016-09-19 19:16 | caristu | Note Added: 0090080 | |
2016-09-19 19:24 | caristu | Relationship added | related to 0034022 |
2016-09-27 16:50 | caristu | Relationship added | related to 0034102 |
2016-09-28 14:50 | alostale | Target Version | 3.0PR16Q4 => 3.0PR17Q1 |
2016-09-28 19:25 | caristu | File Added: issue33417.diff | |
2016-09-28 19:26 | caristu | Note Added: 0090357 | |
2016-10-17 13:46 | hgbot | Checkin | |
2016-10-17 13:46 | hgbot | Note Added: 0090638 | |
2016-10-17 14:04 | hgbot | Checkin | |
2016-10-17 14:04 | hgbot | Note Added: 0090639 | |
2016-10-17 14:04 | hgbot | Status | scheduled => resolved |
2016-10-17 14:04 | hgbot | Resolution | open => fixed |
2016-10-17 14:04 | hgbot | Fixed in SCM revision | => http://code.openbravo.com/erp/devel/pi/rev/0f6f5ff03a21c796975c447b3e721494bc8d7ce5 [^] |
2016-10-17 14:04 | caristu | Review Assigned To | => alostale |
2016-10-17 14:05 | caristu | Issue Monitored: alostale | |
2016-10-21 10:46 | hgbot | Checkin | |
2016-10-21 10:46 | hgbot | Note Added: 0090752 | |
2016-10-28 09:20 | alostale | Note Added: 0090976 | |
2016-10-28 09:20 | alostale | Status | resolved => closed |
2016-10-28 09:20 | alostale | Fixed in Version | => 3.0PR17Q1 |
2016-10-28 15:13 | hgbot | Checkin | |
2016-10-28 15:13 | hgbot | Note Added: 0090998 | |
2016-12-16 18:37 | hudsonbot | Checkin | |
2016-12-16 18:37 | hudsonbot | Note Added: 0092523 | |
Notes |
|
|
Appying the configScript fails in the install.source (the install.source finishes with success, but the parts of the configScript that failed are not applied) but not whene the configScript is loaded in the update.database process.
This means that as a work around, an update.database can be run after the install.source, and the config script will be properly applied. |
|
|
|
Can also be seen happening in job mod-but-BUT_QA (for pg) |
|
|
|
|
|
|
Attached patch with the fix, that will be pushed for next 3.0PR17Q1 |
|
|
(0090638)
|
hgbot
|
2016-10-17 13:46
|
|
Repository: erp/devel/dbsm-main
Changeset: ee257b63e9179f570400adb3eef0af6574c080a3
Author: Carlos Aristu <carlos.aristu <at> openbravo.com>
Date: Mon Oct 17 13:43:31 2016 +0200
URL: http://code.openbravo.com/erp/devel/dbsm-main/rev/ee257b63e9179f570400adb3eef0af6574c080a3 [^]
related to issue 33417: ConfigScript with single quotes on install.source fails
When applying data changes of a Configuration Script on install.source the generated sql statement could contain unscaped single quotes, causing the failure in the statement execution. The same problem was reproducible with other special characters like breakline.
This problem has been solved using the same method which is being used on update.database: the alterData() method of PlatformImplBase eventually generates sql prepared statements with the special characters properly scaped (by using getUpdateSql() with the genPlaceholders parameter set as true)
---
M src-test/src/org/openbravo/dbsm/test/configscript/ConfigScriptBaseTest.java
M src-test/src/org/openbravo/dbsm/test/configscript/ConfigScriptColumnDataChange.java
M src/org/apache/ddlutils/platform/PlatformImplBase.java
M src/org/apache/ddlutils/platform/SqlBuilder.java
---
|
|
|
(0090639)
|
hgbot
|
2016-10-17 14:04
|
|
|
|
(0090752)
|
hgbot
|
2016-10-21 10:46
|
|
Repository: erp/devel/dbsm-main
Changeset: 123dc6f7d82fe1420e50f5a25052d2f30efe017c
Author: Carlos Aristu <carlos.aristu <at> openbravo.com>
Date: Fri Oct 21 10:45:56 2016 +0200
URL: http://code.openbravo.com/erp/devel/dbsm-main/rev/123dc6f7d82fe1420e50f5a25052d2f30efe017c [^]
related to issue 33417: fix test case in Oracle
Updated trigger definition to avoid error 'ORA-04098: trigger is invalid and failed re-validation' when executing isConfigurationScriptApplied() test in Oracle
---
M src-test/model/configScripts/BASE_MODEL.xml
---
|
|
|
|
|
|
(0090998)
|
hgbot
|
2016-10-28 15:13
|
|
|
|
|
|