Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0032244Openbravo ERPY. DBSourceManagerpublic2016-02-16 07:422016-03-17 10:56
alostale 
alostale 
immediateminorhave not tried
closedfixed 
5
 
3.0PR16Q23.0PR16Q2 
AugustoMauch
Core
Production - Confirmed Stable
2015-04-28
3.0PR15Q3
http://code.openbravo.com/erp/devel/pi/rev/f8c18a0c0a00d9dc01482bb1ca5b72d2c68c1fe3 [^]
No
0032244: oracle shows error in log when setting an AD column to not null
model change changing char(1) boolean from nullable to not null and looks like the incremental update.db processing that change has some issues:
     [java] 40817 INFO - Disabling triggers
     [java] 51348 WARN - SQL Command failed with: ORA-01451: column to be modified to NULL cannot be modified to NULL
     [java]
     [java] 51365 WARN - -- END
     [java] ALTER TABLE OBPOS_PRINT_TEMPLATE MODIFY ISPDF CHAR(1) NULL
     [java] 51740 INFO - Executed 837 SQL command(s) with 1 error(s)

https://ci.openbravo.com/job/ret-inc-oracle/3585/console [^]
https://code.openbravo.com/erp/pmods/org.openbravo.retail.posterminal/rev/ab2b38250f44 [^]
There are different ways to reproduce, all of them in an Oracle instance.

1.1. Update an Oracle instance from a previous version to https://code.openbravo.com/erp/pmods/org.openbravo.retail.posterminal/rev/ab2b38250f44 [^]
   -> Check in log WARN message

2.1 Emulate this situation in by executing in DB:
   ALTER TABLE AD_WINDOW MODIFY (ISACTIVE NULL); --next update will reset not null contraint
   update ad_module set status='I' where ad_module_id = 'A918E3331C404B889D69AA9BFAFB23AC'; --pick a module and set it as rebuild required
   select ad_db_modified('Y') from dual; --forget local db changes
2.2 Login as System Admin
2.3 Open Module Management window and rebuild
   -> ERROR: Build is marked as having warnings

No tags attached.
related to defect 0032146 closed mario_castello Retail Modules POS templates created in previous versions to RR14Q3, can not be printed 
depends on backport 00322563.0PR16Q1 closed platform Openbravo ERP oracle shows error in log when setting an AD column to not null 
depends on backport 00322573.0PR15Q4.4 closed platform Openbravo ERP oracle shows error in log when setting an AD column to not null 
depends on backport 00322583.0PR15Q3.7 closed platform Openbravo ERP oracle shows error in log when setting an AD column to not null 
caused by feature request 0029270 closed alostale Openbravo ERP prevent table recreation in update.database 
png rebuild-warn.png (51,820) 2016-02-17 12:29
https://issues.openbravo.com/file_download.php?file_id=9073&type=bug
png
Issue History
2016-02-16 07:42alostaleNew Issue
2016-02-16 07:42alostaleAssigned To => platform
2016-02-16 07:42alostaleModules => Core
2016-02-16 07:42alostaleTriggers an Emergency Pack => No
2016-02-16 07:42alostalePrioritynormal => urgent
2016-02-16 07:43alostaleTarget Version => 3.0PR16Q2
2016-02-16 10:34hgbotCheckin
2016-02-16 10:34hgbotNote Added: 0084232
2016-02-16 14:46alostaleSummaryoracle fails to set column to not null => oracle shows error in log when setting an AD column to not null
2016-02-16 14:46alostaleSteps to Reproduce Updatedbug_revision_view_page.php?rev_id=11147#r11147
2016-02-16 14:49alostaleNote Added: 0084254
2016-02-16 14:52alostaleRegression level => Production - Confirmed Stable
2016-02-16 14:52alostaleRegression date => 2015-04-28
2016-02-16 14:52alostaleRegression introduced in release => 3.0PR15Q3
2016-02-16 14:52alostaleRegression introduced by commit => http://code.openbravo.com/erp/devel/pi/rev/f8c18a0c0a00d9dc01482bb1ca5b72d2c68c1fe3 [^]
2016-02-16 14:52alostaleRelationship addedcaused by 0029270
2016-02-16 14:53alostalePriorityurgent => immediate
2016-02-16 14:53alostaleStatusnew => acknowledged
2016-02-16 15:46alostaleSeveritymajor => minor
2016-02-16 15:47alostaleRelationship addedrelated to 0032146
2016-02-17 12:12alostaleSteps to Reproduce Updatedbug_revision_view_page.php?rev_id=11150#r11150
2016-02-17 12:29alostaleFile Added: rebuild-warn.png
2016-02-17 12:29alostaleReview Assigned To => AugustoMauch
2016-02-17 12:30alostaleStatusacknowledged => scheduled
2016-02-17 12:30alostaleAssigned Toplatform => alostale
2016-02-17 13:13hgbotCheckin
2016-02-17 13:13hgbotNote Added: 0084281
2016-02-17 13:13hgbotCheckin
2016-02-17 13:13hgbotNote Added: 0084282
2016-02-17 13:15hgbotCheckin
2016-02-17 13:15hgbotNote Added: 0084283
2016-02-17 13:15hgbotStatusscheduled => resolved
2016-02-17 13:15hgbotResolutionopen => fixed
2016-02-17 13:15hgbotFixed in SCM revision => http://code.openbravo.com/erp/devel/pi/rev/983bdd5eab9bcd11e1ddc7d85ad7aa637e9afbd5 [^]
2016-02-25 11:23hgbotCheckin
2016-02-25 11:23hgbotNote Added: 0084488
2016-02-25 11:23hgbotCheckin
2016-02-25 11:23hgbotNote Added: 0084489
2016-02-25 11:23hgbotCheckin
2016-02-25 11:23hgbotNote Added: 0084490
2016-02-25 11:23hgbotFixed in SCM revisionhttp://code.openbravo.com/erp/devel/pi/rev/983bdd5eab9bcd11e1ddc7d85ad7aa637e9afbd5 [^] => http://code.openbravo.com/erp/devel/pi/rev/689c4b6505eaac93cfe275dc9ae23ca9e3f3be71 [^]
2016-02-25 11:23hgbotFixed in SCM revisionhttp://code.openbravo.com/erp/devel/pi/rev/983bdd5eab9bcd11e1ddc7d85ad7aa637e9afbd5 [^] => http://code.openbravo.com/erp/devel/pi/rev/689c4b6505eaac93cfe275dc9ae23ca9e3f3be71 [^]
2016-02-25 11:24hgbotCheckin
2016-02-25 11:24hgbotNote Added: 0084491
2016-02-25 11:27alostaleNote Edited: 0084490bug_revision_view_page.php?bugnote_id=0084490#r11239
2016-02-25 18:51AugustoMauchNote Added: 0084526
2016-02-25 18:51AugustoMauchStatusresolved => closed
2016-02-25 18:51AugustoMauchFixed in Version => 3.0PR16Q2
2016-03-17 10:56hudsonbotCheckin
2016-03-17 10:56hudsonbotNote Added: 0085146
2016-03-17 10:56hudsonbotCheckin
2016-03-17 10:56hudsonbotNote Added: 0085168

Notes
(0084232)
hgbot   
2016-02-16 10:34   
Repository: erp/devel/dbsm-main
Changeset: 3ca79561ccebcc817f83f918921eec319093f785
Author: Asier Lostalé <asier.lostale <at> openbravo.com>
Date: Tue Feb 16 10:34:15 2016 +0100
URL: http://code.openbravo.com/erp/devel/dbsm-main/rev/3ca79561ccebcc817f83f918921eec319093f785 [^]

related to bug 32244: test cases should fail in case of warn/error is logged

---
M src-test/src/org/openbravo/dbsm/test/base/DbsmTest.java
A src-test/src/org/openbravo/dbsm/test/base/TestLogAppender.java
---
(0084254)
alostale   
2016-02-16 14:49   
This is caused because it is being tried to disable not-null constraint from a column which is already nullable. In Oracle this statement causes an error whereas in PostgreSQL is just ignored.

Existing test suite didn't caught this error because, although there are test cases executing this case, the assertions ensure the model is correct but logs were not checked to prevent error/warning messages.

Test cases have been changed to fail in case any error/warning is logged during the process.
(0084281)
hgbot   
2016-02-17 13:13   
Repository: erp/devel/dbsm-main
Changeset: 897107b8de128f06c2237476cdd64c92fad3c846
Author: Asier Lostalé <asier.lostale <at> openbravo.com>
Date: Tue Feb 16 14:55:08 2016 +0100
URL: http://code.openbravo.com/erp/devel/dbsm-main/rev/897107b8de128f06c2237476cdd64c92fad3c846 [^]

related to bug 32244: ORA error in log when setting an AD column to not null

  Prevented trying to disable not-null constraints in case the column was already
  nullable.

---
M src/org/apache/ddlutils/Platform.java
M src/org/apache/ddlutils/platform/PlatformImplBase.java
M src/org/apache/ddlutils/platform/SqlBuilder.java
M src/org/apache/ddlutils/platform/oracle/Oracle8Builder.java
M src/org/apache/ddlutils/platform/postgresql/PostgreSqlBuilder.java
---
(0084282)
hgbot   
2016-02-17 13:13   
Repository: erp/devel/dbsm-main
Changeset: 38fce583f758b9d32f161538ab0e8f0c2286c408
Author: Asier Lostalé <asier.lostale <at> openbravo.com>
Date: Wed Feb 17 13:12:39 2016 +0100
URL: http://code.openbravo.com/erp/devel/dbsm-main/rev/38fce583f758b9d32f161538ab0e8f0c2286c408 [^]

related to bug 32244: javadoc for API

---
M src/org/apache/ddlutils/platform/SqlBuilder.java
---
(0084283)
hgbot   
2016-02-17 13:15   
Repository: erp/devel/pi
Changeset: 983bdd5eab9bcd11e1ddc7d85ad7aa637e9afbd5
Author: Asier Lostalé <asier.lostale <at> openbravo.com>
Date: Wed Feb 17 13:14:36 2016 +0100
URL: http://code.openbravo.com/erp/devel/pi/rev/983bdd5eab9bcd11e1ddc7d85ad7aa637e9afbd5 [^]

fixed bug 32244: ORA error in log when setting an AD column to not null

  Prevented trying to disable not-null constraints in case the column was already
  set as nullable in DB.

---
M src-db/database/lib/dbsourcemanager.jar
---
(0084488)
hgbot   
2016-02-25 11:23   
Repository: erp/devel/dbsm-main
Changeset: 827164944af4f27b05da160d41eb6dd9a4978d3a
Author: Asier Lostalé <asier.lostale <at> openbravo.com>
Date: Thu Feb 25 09:26:26 2016 +0100
URL: http://code.openbravo.com/erp/devel/dbsm-main/rev/827164944af4f27b05da160d41eb6dd9a4978d3a [^]

related to issue 32244: added additional test cases

  Changes for column mandatory <--> no mandatory are now covered for both AD
  and instance tables.

---
M src-test/src/org/openbravo/dbsm/test/model/data/OtherDefaults.java
---
(0084489)
hgbot   
2016-02-25 11:23   
Repository: erp/devel/pi
Changeset: 689c4b6505eaac93cfe275dc9ae23ca9e3f3be71
Author: Asier Lostalé <asier.lostale <at> openbravo.com>
Date: Thu Feb 25 11:22:36 2016 +0100
URL: http://code.openbravo.com/erp/devel/pi/rev/689c4b6505eaac93cfe275dc9ae23ca9e3f3be71 [^]

fixed bug 32244: ORA shows error in log when setting an AD column to not null

  Implemented a better condition to decide whether not nulls should be disabled,
  now it is based on the flag set for deferred not nulls, covering in this manner
  some cases that were not workding before and making the code clearer to understand

---
M src-db/database/lib/dbsourcemanager.jar
---
(0084490)
hgbot   
2016-02-25 11:23   
(edited on: 2016-02-25 11:27)
Repository: erp/devel/dbsm-main
Changeset: 1314eec95492
Author: Asier Lostalé <asier.lostale <at> openbravo.com>
Date: Thu Feb 25 11:22:36 2016 +0100
URL: https://code.openbravo.com/erp/devel/dbsm-main/rev/1314eec95492 [^]

fixed bug 32244: ORA shows error in log when setting an AD column to not null

  Implemented a better condition to decide whether not nulls should be disabled,
  now it is based on the flag set for deferred not nulls, covering in this manner
  some cases that were not workding before and making the code clearer to understand

(0084491)
hgbot   
2016-02-25 11:24   
Repository: erp/devel/dbsm-main
Changeset: 65084896d0b02627d31e27241b920f577b02a57b
Author: Asier Lostalé <asier.lostale <at> openbravo.com>
Date: Thu Feb 25 09:49:23 2016 +0100
URL: http://code.openbravo.com/erp/devel/dbsm-main/rev/65084896d0b02627d31e27241b920f577b02a57b [^]

related to bug 32244: javadoc

---
M src/org/apache/ddlutils/model/Database.java
---
(0084526)
AugustoMauch   
2016-02-25 18:51   
Code reviewed and verified in pi@689c4b6505ea
(0085146)
hudsonbot   
2016-03-17 10:56   
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/b22fb0500156 [^]
Maturity status: Test
(0085168)
hudsonbot   
2016-03-17 10:56   
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/b22fb0500156 [^]
Maturity status: Test