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

View Revisions: Issue #34488 Back to Issue ]
Summary 0034488: Unsolvable dbconsistency problems in index functions
Revision 2016-11-16 16:04 by caristu
Description I have a custom function developed in the prescript* files (not sure if this really matters).
This function, which has 2 parameters, is used as part of a function index.

The export database process always modifies the way the function parameters in the index definition are written: it either adds or removes a blank space.

Example I (In Oracle):

Index definition in XML before exporting database (note the blank space between the parameters (GENERATED_CREDIT, USED_CREDIT):
<index name="FIN_PAYMENT_BP_CREDIT_IX" unique="false">
  <index-column name="C_BPARTNER_ID"/>
  <index-column name="functionBasedColumn" functionExpression="OBEQUALS(GENERATED_CREDIT, USED_CREDIT)"/>
</index>

Index definition in XML after exporting database (note the blank space has been removed):
<index name="FIN_PAYMENT_BP_CREDIT_IX" unique="false">
  <index-column name="C_BPARTNER_ID"/>
  <index-column name="functionBasedColumn" functionExpression="OBEQUALS(GENERATED_CREDIT,USED_CREDIT)"/>
</index>

Note that the previous example is not valid as the mentioned blank space should not be present on the XML file

Example II (In PostgresSQL):

Index definition in XML before exporting database (note there is NO blank space between the parameters (GENERATED_CREDIT,USED_CREDIT):
<index name="FIN_PAYMENT_BP_CREDIT_IX" unique="false">
  <index-column name="C_BPARTNER_ID"/>
  <index-column name="functionBasedColumn" functionExpression="OBEQUALS(GENERATED_CREDIT,USED_CREDIT)"/>
</index>

Index definition in XML after exporting database (note the blank space between parameters is added):
<index name="FIN_PAYMENT_BP_CREDIT_IX" unique="false">
  <index-column name="C_BPARTNER_ID"/>
  <index-column name="functionBasedColumn" functionExpression="OBEQUALS(GENERATED_CREDIT, USED_CREDIT)"/>
</index>

Revision 2016-11-16 16:04 by caristu
Steps To Reproduce In PostgreSQL instance
Apply patch attached to 0033581 (without space between parameters)
Set core in development.
Export database. See the diff in FIN_PAYMENT.xml file (it adds a space in parameters)
Run smarbuild -Dlocal=no
Export database again. See the FIN_PAYMENT.xml file (the space between parameters have been removed)


Tested in try:
https://code.openbravo.com/erp/devel/try/graph/7cec3fd4e1346b7f05d55fdf0eafc7e72f8e25df [^]
https://ci.openbravo.com//job/try-dbcons-pgsql/4691/ [^]

https://code.openbravo.com/erp/devel/try/graph/f840a525ce1c8fc45680e7028788c0b7bfde6618 [^]
https://ci.openbravo.com//job/try-dbcons-oracle/4696/ [^]
Revision 2016-11-16 16:04 by caristu
Description I have a custom function developed in the prescript* files (not sure if this really matters).
This function, which has 2 parameters, is used as part of a function index.

The export database process always modifies the way the function parameters in the index definition are written: it either adds or removes a blank space.

Example I (In Oracle):

Index definition in XML before exporting database (note the blank space between the parameters (GENERATED_CREDIT, USED_CREDIT):
<index name="FIN_PAYMENT_BP_CREDIT_IX" unique="false">
  <index-column name="C_BPARTNER_ID"/>
  <index-column name="functionBasedColumn" functionExpression="OBEQUALS(GENERATED_CREDIT, USED_CREDIT)"/>
</index>

Index definition in XML after exporting database (note the blank space has been removed):
<index name="FIN_PAYMENT_BP_CREDIT_IX" unique="false">
  <index-column name="C_BPARTNER_ID"/>
  <index-column name="functionBasedColumn" functionExpression="OBEQUALS(GENERATED_CREDIT,USED_CREDIT)"/>
</index>



Example II (In PostgresSQL):

Index definition in XML before exporting database (note there is NO blank space between the parameters (GENERATED_CREDIT,USED_CREDIT):
<index name="FIN_PAYMENT_BP_CREDIT_IX" unique="false">
  <index-column name="C_BPARTNER_ID"/>
  <index-column name="functionBasedColumn" functionExpression="OBEQUALS(GENERATED_CREDIT,USED_CREDIT)"/>
</index>

Index definition in XML after exporting database (note the blank space between parameters is added):
<index name="FIN_PAYMENT_BP_CREDIT_IX" unique="false">
  <index-column name="C_BPARTNER_ID"/>
  <index-column name="functionBasedColumn" functionExpression="OBEQUALS(GENERATED_CREDIT, USED_CREDIT)"/>
</index>

Revision 2016-11-16 11:05 by caristu
Steps To Reproduce In Oracle instance
Apply patch attached to 0033581 (without space between parameters)
Set core in development.
Export database. See the diff in FIN_PAYMENT.xml file (it adds a space in parameters)
Run smarbuild -Dlocal=no
Export database again. See the FIN_PAYMENT.xml file (the space between parameters have been removed)


Tested in try:
https://code.openbravo.com/erp/devel/try/graph/7cec3fd4e1346b7f05d55fdf0eafc7e72f8e25df [^]
https://ci.openbravo.com//job/try-dbcons-pgsql/4691/ [^]

https://code.openbravo.com/erp/devel/try/graph/f840a525ce1c8fc45680e7028788c0b7bfde6618 [^]
https://ci.openbravo.com//job/try-dbcons-oracle/4696/ [^]
Revision 2016-11-16 11:05 by caristu
Description I have a custom function developed in the prescript* files (not sure if this really matters).
This function, which has 2 parameters, is used as part of a function index.

The export database process always modifies the way the function parameters in the index definition are written: it either adds or removes a blank space.
This is only reproducible in Oracle (PG works fine)


Example I:

Index definition in XML before exporting database (note the blank space between the parameters (GENERATED_CREDIT, USED_CREDIT):
<index name="FIN_PAYMENT_BP_CREDIT_IX" unique="false">
  <index-column name="C_BPARTNER_ID"/>
  <index-column name="functionBasedColumn" functionExpression="OBEQUALS(GENERATED_CREDIT, USED_CREDIT)"/>
</index>

Index definition in XML after exporting database (note the blank space has been removed):
<index name="FIN_PAYMENT_BP_CREDIT_IX" unique="false">
  <index-column name="C_BPARTNER_ID"/>
  <index-column name="functionBasedColumn" functionExpression="OBEQUALS(GENERATED_CREDIT,USED_CREDIT)"/>
</index>



Example II:

Index definition in XML before exporting database (note there is NO blank space between the parameters (GENERATED_CREDIT,USED_CREDIT):
<index name="FIN_PAYMENT_BP_CREDIT_IX" unique="false">
  <index-column name="C_BPARTNER_ID"/>
  <index-column name="functionBasedColumn" functionExpression="OBEQUALS(GENERATED_CREDIT,USED_CREDIT)"/>
</index>

Index definition in XML after exporting database (note the blank space between parameters is added):
<index name="FIN_PAYMENT_BP_CREDIT_IX" unique="false">
  <index-column name="C_BPARTNER_ID"/>
  <index-column name="functionBasedColumn" functionExpression="OBEQUALS(GENERATED_CREDIT, USED_CREDIT)"/>
</index>



Copyright © 2000 - 2009 MantisBT Group
Powered by Mantis Bugtracker