db-derby-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Suran Jayathilaka (JIRA)" <j...@apache.org>
Subject [jira] Updated: (DERBY-712) Support for sequences
Date Sun, 16 Aug 2009 23:02:15 GMT

     [ https://issues.apache.org/jira/browse/DERBY-712?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Suran Jayathilaka updated DERBY-712:
------------------------------------

    Attachment: create_drop_sequence_c.patch

After the changes, I ran the SQL script and it execute successfuly. Following is the output
I got
-------------------------------------
ij version 10.6
ij> connect 'jdbc:derby:memory:patient;create=true;user=admin;password=adminpassword' as
admin_conn;
ij> connect 'jdbc:derby:memory:patient;user=alice;password=alicepassword' as alice_conn;
ij(ALICE_CONN)> -- should implicitly create the ALICE schema
create sequence alice_seq;
0 rows inserted/updated/deleted
ij(ALICE_CONN)> -- should fail because the sequence already exists
create sequence alice_seq;
ERROR X0Y68: Sequence 'ALICE_SEQ' already exists.
ij(ALICE_CONN)> connect 'jdbc:derby:memory:patient;user=ruth;password=ruthpassword' as
ruth_conn;
ij(RUTH_CONN)> -- should not be able to drop someone else's objects
drop sequence alice.alice_seq;
ERROR 42507: User 'RUTH' can not perform the operation in schema 'ALICE'.
ij(RUTH_CONN)> -- should not be able to create objects in someone else's schema
create sequence alice.ruth_seq;
ERROR 42507: User 'RUTH' can not perform the operation in schema 'ALICE'.
ij(RUTH_CONN)> set connection alice_conn;
ij(ALICE_CONN)> --should succeed
drop sequence alice_seq;
0 rows inserted/updated/deleted
ij(ALICE_CONN)> -- should succeed
create sequence alice_seq;
0 rows inserted/updated/deleted
ij(ALICE_CONN)>
----------------------------
When recreating these actions in JUnit, I found that testDropOtherSchemaSequence() and testCreateOtherSchemaSequence()
tests take a long time to finish and they fail. I'm not sure if I'm taking the right way for
creating different user connections. Theses two tests are commented out in the testcase.

Thanks!
Suran

> Support for sequences
> ---------------------
>
>                 Key: DERBY-712
>                 URL: https://issues.apache.org/jira/browse/DERBY-712
>             Project: Derby
>          Issue Type: Improvement
>          Components: SQL
>         Environment: feature request 
>            Reporter: Tony Dahbura
>            Assignee: Suran Jayathilaka
>             Fix For: 10.6.0.0
>
>         Attachments: altertable.diff, catalogs_a.patch, catalogs_b.patch, catalogs_c.patch,
catalogs_d.patch, catalogs_e.patch, catalogs_f.patch, catalogs_f_2.patch, catalogs_g.diff,
catalogs_h.diff, create_drop_sequence_a.patch, create_drop_sequence_b.patch, create_drop_sequence_c.patch,
create_sequence_a.patch, SequenceGenerator.html
>
>
> Would like to see support added for sequences.  This would permit a select against the
sequence to always obtain a ever increasing/decreasing value.  The identity column works fine
but there are times for applications where the application needs to obtain the sequence number
and use it prior to the database write.  Subsequent calls to the table/column would result
in a new number on each call.
> SQL such as the following:
> SELECT NEXT VALUE FOR sequence_name FROM sometable ; would result in a next value.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message