Issue Details (XML | Word | Printable)

Key: NUCRDBMS-443
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Major Major
Assignee: Andy Jefferson
Reporter: Giambattista Bloisi
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
DataNucleus Store RDBMS

DatabaseAdapter.getCreateIndexStatement: create index does not provide fully qualified name when required

Created: 23/Aug/10 02:25 PM   Updated: 20/Oct/10 09:30 AM   Resolved: 21/Sep/10 06:06 PM
Component/s: None
Affects Version/s: 1.1.6, 2.0.5, 2.1.1, 2.2.0.m1
Fix Version/s: 2.2.0.m2

File Attachments: 1. Text File DatabaseAdapter-getCreateIndexStatement.patch (1 kB)
2. Zip Archive NUCRDBMS-442-2.zip (2 kB)


Datastore: Oracle
Severity: Production


 Description  « Hide
Similarly to "CREATE TABLE" also "CREATE INDEX" possibly needs a fully qualified name as index identifier

Giambattista Bloisi made changes - 23/Aug/10 02:26 PM
Field Original Value New Value
Attachment DatabaseAdapter-getCreateIndexStatement.patch [ 11241 ]
Andy Jefferson added a comment - 21/Sep/10 01:51 PM - edited
I have no such problems in creating indexes with Oracle. A testcase please.
Also changing this in DatabaseAdapter means it has to work for *all* databases. Does it ?

Giambattista Bloisi added a comment - 21/Sep/10 02:38 PM
I'm going to prepare a test case for this. The patch has been used against hsqldb, mysql, sybase, ms sql server, and oracle. Though only on oracle I'm using the dbschema property.
In this case anyway I'm not observing a failure when creating indexes: I'm just observing that tables are created in the provided dbschema, while indexes are created into the default system schema.

Giambattista Bloisi added a comment - 21/Sep/10 05:02 PM
This is the same sample as NUCRDBMS-442.
Index is correctly created but in the wrong schema. I checked that with the statement reported below (_myclass_PK was created in ITDB schema as requested, while myclass_index was created into SYSTEM default schema for system user).


SQL> select index_name, OWNER from all_indexes where index_name like '%myclass%';

INDEX_NAME
--------------------------------------------------------------------------------
OWNER
--------------------------------------------------------------------------------
_myclass_PK
ITDB

myclass_index
SYSTEM


Giambattista Bloisi made changes - 21/Sep/10 05:02 PM
Attachment NUCRDBMS-442-2.zip [ 11253 ]
Andy Jefferson added a comment - 21/Sep/10 06:06 PM
Reproduced with the provided test (i.e default schema for the user being different from that specified with the "Schema" persistence property), and fix applied. Thx

Andy Jefferson made changes - 21/Sep/10 06:06 PM
Status Open [ 1 ] Resolved [ 5 ]
Assignee Andy Jefferson [ andy ]
Fix Version/s 2.2.0.m2 [ 11023 ]
Resolution Fixed [ 1 ]
Andy Jefferson made changes - 20/Oct/10 09:30 AM
Status Resolved [ 5 ] Closed [ 6 ]