[ 
https://jira.duraspace.org/browse/DS-961?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Kevin Van de Velde updated DS-961:
----------------------------------

    Status: Open  (was: Received)
    
> 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: Kevin Van de Velde
>            Priority: Major
>         Attachments: oracle_fix.patch
>
>
> 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, please contact your JIRA administrators: 
https://jira.duraspace.org/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

------------------------------------------------------------------------------
Doing More with Less: The Next Generation Virtual Desktop 
What are the key obstacles that have prevented many mid-market businesses
from deploying virtual desktops?   How do next-generation virtual desktops
provide companies an easier-to-deploy, easier-to-manage and more affordable
virtual desktop model.http://www.accelacomm.com/jaw/sfnl/114/51426474/
_______________________________________________
Dspace-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/dspace-devel

Reply via email to