[
https://jira.duraspace.org/browse/DS-961?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Mark Diggory reassigned DS-961:
-------------------------------
Assignee: Mark Diggory
> Oracle update sequence script can result in deleted sequences
> -------------------------------------------------------------
>
> Key: DS-961
> URL: https://jira.duraspace.org/browse/DS-961
> Project: DSpace
> Issue Type: Bug
> Affects Versions: 1.5.0, 1.5.1, 1.5.2, 1.6.0, 1.6.1, 1.6.2, 1.7.0, 1.7.1,
> 1.7.2, 1.8.0
> Reporter: Kevin Van de Velde
> Assignee: Mark Diggory
> Priority: Major
>
> When updating the sequences using oracle if the table is empty the sequence
> for this table will be dropped, but not recreated.
> Imagine the following situation:
> DECLARE
> curr NUMBER := 0;
> BEGIN
> -- If the table is empty, curr will be equal to Null
> SELECT max(workflowitem_id) INTO curr FROM workflowitem;
> -- If curr is equal to Null, curr + 1 will be equal to Null as well
> curr := curr + 1;
> -- The sequence will be dropped
> EXECUTE IMMEDIATE 'DROP SEQUENCE workflowitem_seq';
> -- The sequence will not be recreated because of an 'Invalid Number' error
> since, curr equals Null
> EXECUTE IMMEDIATE 'CREATE SEQUENCE workflowitem START WITH ' || curr;
> END;
> I therefore suggest to replace the CREATE statement with the following line:
> EXECUTE IMMEDIATE 'CREATE SEQUENCE &1 START WITH ' || NVL(curr,1);
> By using the NVL() function, 1 will be used as the starting value for the
> sequence instead of the invalid Null value.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
https://jira.duraspace.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
------------------------------------------------------------------------------
BlackBerry® DevCon Americas, Oct. 18-20, San Francisco, CA
The must-attend event for mobile developers. Connect with experts.
Get tools for creating Super Apps. See the latest technologies.
Sessions, hands-on labs, demos & much more. Register early & save!
http://p.sf.net/sfu/rim-blackberry-1
_______________________________________________
Dspace-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/dspace-devel