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

Mark Diggory updated DS-961:
----------------------------

    Attachment: oracle_fix.patch
    
> 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
>         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

        

------------------------------------------------------------------------------
Get a FREE DOWNLOAD! and learn more about uberSVN rich system, 
user administration capabilities and model configuration. Take 
the hassle out of deploying and managing Subversion and the 
tools developers use with it. http://p.sf.net/sfu/wandisco-d2d-2
_______________________________________________
Dspace-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/dspace-devel

Reply via email to