Bug 117294 - forms_widget_label : wrong setting in sql upgrade script (from 5.2 to 6)
Summary: forms_widget_label : wrong setting in sql upgrade script (from 5.2 to 6)
Keywords:
Status: CLOSED EOL
Alias: None
Product: Red Hat Web Application Framework
Classification: Retired
Component: persistence
Version: 6.0
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
Assignee: ccm-bugs-list
QA Contact: Jon Orris
URL:
Whiteboard:
Depends On:
Blocks: 108447
TreeView+ depends on / blocked
 
Reported: 2004-03-02 17:13 UTC by durnez
Modified: 2020-03-27 16:48 UTC (History)
0 users

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2020-03-27 16:48:02 UTC
Embargoed:


Attachments (Terms of Use)

Description durnez 2004-03-02 17:13:32 UTC
Description of problem:
Whenever, in simpleSurvey admin ui, i want to edit a new control
("Edit controls" link), i encounter the following exception :

com.arsdigita.persistence.PersistenceException:  (root cause:
com.redhat.persistence.engine.rdbms.RDBMSEngine$2: ORA-02291:
integrity constraint (C4FR_TEST2.FORMS_WGT_LABEL_LABEL_ID_FK) violated
- parent key not found)        at
com.arsdigita.persistence.PersistenceException.newInstance(PersistenceException.java:137)
       at
com.arsdigita.persistence.PersistenceException.newInstance(PersistenceException.java:109)
       at
com.arsdigita.persistence.DataObjectImpl.save(DataObjectImpl.java:413)
[...]

According to file
sql/core/default/formbuilder/table-forms_widget_label.sql (see content
below) :
create table forms_widget_label (    
     label_id integer        constraint forms_wgt_label_label_id_fk  
      
        references bebop_components (component_id)        
        constraint forms_wgt_label_label_id_pk primary key,    
     widget_id integer
        constraint         forms_wgt_label_widget_id_fk
        references bebop_widgets (widget_id) on delete cascade
);

label_id must point to an existing bebop_components item.


but the upgrade script
sql/core/oracle-se/upgrade/5.2.1-6.0.0/auto-upgrade.sql is wrong at
lines 235-237 :
alter table FORMS_WIDGET_LABEL drop constraint
FORMS_WGT_LABEL_LABEL_ID_FK;
alter table FORMS_WIDGET_LABEL add constraint
FORMS_WGT_LABEL_LABEL_ID_FK    foreign key(LABEL_ID) references
BEBOP_WIDGETS(WIDGET_ID);

those lines must be replaced by :

alter table FORMS_WIDGET_LABEL drop constraint
FORMS_WGT_LABEL_LABEL_ID_FK;
alter table FORMS_WIDGET_LABEL add constraint
FORMS_WGT_LABEL_LABEL_ID_FKforeign key(LABEL_ID) references
BEBOP_COMPONENTS(COMPONENT_ID);

That way, new controls can be edited in simple survey admin ui.



How reproducible:
always


Note You need to log in before you can comment on or make changes to this bug.