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

View Issue DetailsJump to Notes ] Issue History ] Print ]
ID
0021817
TypeCategorySeverityReproducibilityDate SubmittedLast Update
defect[Openbravo ERP] Y. DBSourceManagermajoralways2012-10-01 17:212012-10-30 15:47
ReportermiruritaView Statuspublic 
Assigned ToAugustoMauch 
PrioritynormalResolutionfixedFixed in Version3.0MP17
StatusclosedFix in branchFixed in SCM revisionc16422ac65dc
ProjectionnoneETAnoneTarget Version
OSLinux 32 bitDatabasePostgreSQLJava version1.6.0_18
OS VersionCommunity ApplianceDatabase version8.3.9Ant version1.7.1
Product VersionpiSCM revision 
Review Assigned Tomarvintm
Web browser
ModulesCore
Regression level
Regression date
Regression introduced in release
Regression introduced by commit
Triggers an Emergency PackNo
Summary

0021817: export.database WRONG_TYPE validation result in a false positive

Descriptionfollow steps to reproduce.

+++++++++++++++++++++++++++++++++++++++++++++++++++
Errors for Validation type: WRONG_TYPE
+++++++++++++++++++++++++++++++++++++++++++++++++++
Column OBCNTR_UNBILLED_REVENUE.STARTDATE has incorrect type, expecting TIMESTAMP but was NVARCHAR
Column OBCNTR_UNBILLED_REVENUE.DATEACCT has incorrect type, expecting TIMESTAMP but was NVARCHAR
Module validation failed, see the above list of errors for more information
Steps To Reproduce1) Create a new table as follows

CREATE TABLE obcntr_unbilled_revenue
(
  obcntr_unbilled_revenue_id character varying(32) NOT NULL,
  ad_client_id character varying(32) NOT NULL,
  ad_org_id character varying(32) NOT NULL,
  isactive character(1) NOT NULL DEFAULT 'Y'::bpchar,
  created timestamp without time zone NOT NULL DEFAULT now(),
  createdby character varying(32) NOT NULL,
  updated timestamp without time zone NOT NULL DEFAULT now(),
  updatedby character varying(32) NOT NULL,
  "name" character varying(60),
  c_doctype_id character varying(32) NOT NULL,
  documentno character varying(30) NOT NULL,
  startdate timestamp without time zone NOT NULL,
  enddate timestamp without time zone NOT NULL,
  c_currency_id character varying(32) NOT NULL,
  description character varying(255),
  dateacct timestamp without time zone NOT NULL,
  posted character varying(60) NOT NULL DEFAULT 'N'::character varying,
  processing character(1),
  processed character(1) NOT NULL DEFAULT 'N'::bpchar,
  c_project_id character varying(32),
  amount numeric,
  CONSTRAINT obcntr_unbill_rev_key PRIMARY KEY (obcntr_unbilled_revenue_id),
  CONSTRAINT obcntr_unbilled_revenue_client FOREIGN KEY (ad_client_id)
      REFERENCES ad_client (ad_client_id) MATCH SIMPLE
      ON UPDATE NO ACTION ON DELETE NO ACTION,
  CONSTRAINT obcntr_unbill_rev_ad_org FOREIGN KEY (ad_org_id)
      REFERENCES ad_org (ad_org_id) MATCH SIMPLE
      ON UPDATE NO ACTION ON DELETE NO ACTION,
  CONSTRAINT obcntr_unbill_rev_currency FOREIGN KEY (c_currency_id)
      REFERENCES c_currency (c_currency_id) MATCH SIMPLE
      ON UPDATE NO ACTION ON DELETE NO ACTION,
  CONSTRAINT obcntr_unbill_rev_doctype FOREIGN KEY (c_doctype_id)
      REFERENCES c_doctype (c_doctype_id) MATCH SIMPLE
      ON UPDATE NO ACTION ON DELETE NO ACTION,
  CONSTRAINT obcntr_unbill_rev_project FOREIGN KEY (c_project_id)
      REFERENCES c_project (c_project_id) MATCH SIMPLE
      ON UPDATE NO ACTION ON DELETE NO ACTION,
  CONSTRAINT obcntr_unbillrev_isactive_chk CHECK (isactive = ANY (ARRAY['Y'::bpchar, 'N'::bpchar])),
  CONSTRAINT obcntr_unbillrev_proc_chk CHECK (processed = ANY (ARRAY['Y'::bpchar, 'N'::bpchar]))
)
WITH (
  OIDS=FALSE
);
COMMENT ON COLUMN obcntr_unbilled_revenue.documentno IS '--OBTG:NVARCHAR--';
COMMENT ON COLUMN obcntr_unbilled_revenue.description IS '--OBTG:NVARCHAR--';

2) Create corresponding table/columns in the application dictionary.

3) ant export.database works fine at this point

4) Drop "name" column and create again with a comment
alter table obcntr_unbilled_revenue drop column name;
alter table obcntr_unbilled_revenue add column name character varying(60) NOT NULL;
COMMENT ON COLUMN obcntr_unbilled_revenue.name IS '--OBTG:NVARCHAR--';

5) ant export.database

+++++++++++++++++++++++++++++++++++++++++++++++++++
Errors for Validation type: WRONG_TYPE
+++++++++++++++++++++++++++++++++++++++++++++++++++
Column OBCNTR_UNBILLED_REVENUE.STARTDATE has incorrect type, expecting TIMESTAMP but was NVARCHAR
Column OBCNTR_UNBILLED_REVENUE.DATEACCT has incorrect type, expecting TIMESTAMP but was NVARCHAR
Module validation failed, see the above list of errors for more information
TagsNo tags attached.
Attached Filesdiff file icon issue21817.diff [^] (2,103 bytes) 2012-10-02 17:49 [Show Content]

- Relationships Relation Graph ] Dependency Graph ]

-  Notes
(0053169)
hgbot (developer)
2012-10-09 13:22

Repository: erp/devel/pi
Changeset: 7b0840da8515ea4965820dafce053ee3e4ce4b88
Author: Augusto Mauch <augusto.mauch <at> openbravo.com>
Date: Tue Oct 09 11:00:46 2012 +0200
URL: http://code.openbravo.com/erp/devel/pi/rev/7b0840da8515ea4965820dafce053ee3e4ce4b88 [^]

Fixes issue 21817: SQL comments are applied to the proper columns

There was a problem in postgreSQL that happened when a table was created and one of its columns was removed and created again. The ordinal position of the columns in that case is not consecute, i.e.

Before removing the column:
Ordinal position Name
1 Column1
2 Column2
3 Column3

After removing the column Column2
Ordinal position Name
1 Column1
3 Column3

After adding the column Column2 again
Ordinal position Name
1 Column1
3 Column3
4 Column2

When the comments are applied to the columns, instead of using the ordinal position, the index (1..number of columns) was used to determine which comment belongs to each column. This resulted that the comments were applied to the wrong columns. If instead of using the index the ordinal position is used, the problem is solved.

---
M src-db/database/lib/dbsourcemanager.jar
---
(0053171)
hgbot (developer)
2012-10-09 13:30

Repository: erp/devel/pi
Changeset: 52411effe1115298f271e47b162a19b1d0fe4f86
Author: Augusto Mauch <augusto.mauch <at> openbravo.com>
Date: Tue Oct 09 13:29:28 2012 +0200
URL: http://code.openbravo.com/erp/devel/pi/rev/52411effe1115298f271e47b162a19b1d0fe4f86 [^]

Related to issue 21817: Reverted changeset 18172 until it passes Try

---
M src-db/database/lib/dbsourcemanager.jar
---
(0053172)
AugustoMauch (manager)
2012-10-09 13:31

Fix backed out because first it has to be tested in Try
(0053187)
hgbot (developer)
2012-10-10 09:48

Repository: erp/devel/pi
Changeset: fbfe1fab2cff4b7bd54e461c851b18efc4c64762
Author: Augusto Mauch <augusto.mauch <at> openbravo.com>
Date: Wed Oct 10 09:47:15 2012 +0200
URL: http://code.openbravo.com/erp/devel/pi/rev/fbfe1fab2cff4b7bd54e461c851b18efc4c64762 [^]

Fixes issue 21817: SQL comments are applied to the proper columns

There was a problem in postgreSQL that happened when a table was created and one of its columns was removed and created again. The ordinal position of the columns in that case is not consecute, i.e.

Before removing the column:
Ordinal position Name
1 Column1
2 Column2
3 Column3

After removing the column Column2
Ordinal position Name
1 Column1
3 Column3

After adding the column Column2 again
Ordinal position Name
1 Column1
3 Column3
4 Column2

When the comments are applied to the columns, instead of using the ordinal position, the index (1..number of columns) was used to determine which comment belongs to each column. This resulted that the comments were applied to the wrong columns. If instead of using the index the ordinal position is used, the problem is solved.

---
M src-db/database/lib/dbsourcemanager.jar
---
(0053188)
hgbot (developer)
2012-10-10 09:51

Repository: erp/devel/dbsm-main
Changeset: c16422ac65dcd5dd39c1e1d2618f588f1d061bfa
Author: Augusto Mauch <augusto.mauch <at> openbravo.com>
Date: Mon Oct 08 13:33:02 2012 +0200
URL: http://code.openbravo.com/erp/devel/dbsm-main/rev/c16422ac65dcd5dd39c1e1d2618f588f1d061bfa [^]

Fixes issue 21817: SQL comments are applied to the proper columns

There was a problem in postgreSQL that happened when a table was created and one of its columns was removed and created again. The ordinal position of the columns in that case is not consecute, i.e.

Before removing the column:
Ordinal position Name
1 Column1
2 Column2
3 Column3

After removing the column Column2
Ordinal position Name
1 Column1
3 Column3

After adding the column Column2 again
Ordinal position Name
1 Column1
3 Column3
4 Column2

When the comments are applied to the columns, instead of using the ordinal position, the index (1..number of columns) was used to determine which comment belongs to each column. This resulted that the comments were applied to the wrong columns. If instead of using the index the ordinal position is used, the problem is solved.

---
M src/org/apache/ddlutils/platform/postgresql/PostgreSqlModelLoader.java
---
(0053277)
hudsonbot (developer)
2012-10-11 07:50

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/63dfc135f2a1 [^]

Maturity status: Test
(0053279)
hudsonbot (developer)
2012-10-11 07:51

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/63dfc135f2a1 [^]

Maturity status: Test
(0053287)
hudsonbot (developer)
2012-10-11 07:51

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/63dfc135f2a1 [^]

Maturity status: Test

- Issue History
Date Modified Username Field Change
2012-10-01 17:21 mirurita New Issue
2012-10-01 17:21 mirurita Assigned To => marvintm
2012-10-01 17:21 mirurita Modules => Core
2012-10-01 17:34 marvintm Assigned To marvintm => AugustoMauch
2012-10-02 10:12 mirurita Description Updated View Revisions
2012-10-02 10:12 mirurita Steps to Reproduce Updated View Revisions
2012-10-02 17:49 AugustoMauch Status new => scheduled
2012-10-02 17:49 AugustoMauch fix_in_branch => pi
2012-10-02 17:49 AugustoMauch File Added: issue21817.diff
2012-10-08 13:23 AugustoMauch Issue Monitored: marvintm
2012-10-08 13:23 AugustoMauch Review Assigned To => marvintm
2012-10-08 13:23 AugustoMauch fix_in_branch pi =>
2012-10-09 13:22 hgbot Checkin
2012-10-09 13:22 hgbot Note Added: 0053169
2012-10-09 13:22 hgbot Status scheduled => resolved
2012-10-09 13:22 hgbot Resolution open => fixed
2012-10-09 13:22 hgbot Fixed in SCM revision => http://code.openbravo.com/erp/devel/pi/rev/7b0840da8515ea4965820dafce053ee3e4ce4b88 [^]
2012-10-09 13:30 hgbot Checkin
2012-10-09 13:30 hgbot Note Added: 0053171
2012-10-09 13:31 AugustoMauch Note Added: 0053172
2012-10-09 13:31 AugustoMauch Status resolved => new
2012-10-09 13:31 AugustoMauch Resolution fixed => open
2012-10-10 09:48 hgbot Checkin
2012-10-10 09:48 hgbot Note Added: 0053187
2012-10-10 09:48 hgbot Status new => resolved
2012-10-10 09:48 hgbot Resolution open => fixed
2012-10-10 09:48 hgbot Fixed in SCM revision http://code.openbravo.com/erp/devel/pi/rev/7b0840da8515ea4965820dafce053ee3e4ce4b88 [^] => http://code.openbravo.com/erp/devel/pi/rev/fbfe1fab2cff4b7bd54e461c851b18efc4c64762 [^]
2012-10-10 09:51 hgbot Checkin
2012-10-10 09:51 hgbot Note Added: 0053188
2012-10-10 09:51 hgbot Fixed in SCM revision http://code.openbravo.com/erp/devel/pi/rev/fbfe1fab2cff4b7bd54e461c851b18efc4c64762 [^] => http://code.openbravo.com/erp/devel/dbsm-main/rev/c16422ac65dcd5dd39c1e1d2618f588f1d061bfa [^]
2012-10-11 07:50 hudsonbot Checkin
2012-10-11 07:50 hudsonbot Note Added: 0053277
2012-10-11 07:51 hudsonbot Checkin
2012-10-11 07:51 hudsonbot Note Added: 0053279
2012-10-11 07:51 hudsonbot Checkin
2012-10-11 07:51 hudsonbot Note Added: 0053287
2012-10-30 15:47 marvintm Status resolved => closed
2012-10-30 15:47 marvintm Fixed in Version => 3.0MP17


Copyright © 2000 - 2009 MantisBT Group
Powered by Mantis Bugtracker