This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.
1. Connect to "travel" Java DB. 2. Expand it's "Indexes" node, rightclick index and choose "Add Column". 3. Choose some column and click "OK". Result: Error message about error on rename appears.
Created attachment 72939 [details] Screenshot of error message.
If this doesn't work, it's a P2. Almost makes me want to remove support for this - I don't like the way we do this - drop the old index and create a new one. We should just make the user do it manually rather than try to do it for them.
I couldn't reproduce, then I looked carefully at the error message. You are trying to add a column to the primary key. But the way we add a column to an index is to drop the indx and recreate it - yuck. You can't use 'DROP INDEX' to drop the primary key index, so that's why this fails. It actually works with Java DB, but not really - the primary key is still declared to be for the original column, even though the new column is in the primary key index. There is no way to tell via JDBC metadata whether an index is the index used by the primary key or just an index that *uses* the primary key column. So I don't know if there's anything we can do about this unless we disabled the ability to drop or add columns to *any* index that contains the primary key column(s). The only thing I can think of doing is if we get an error, the message can suggest that perhaps the user was trying to modify a primary key index.
Sorry, I didn't meant to mark it as fixed just yet. I updated the error message to suggest that the cause may be because the primary key index can't be modified. e24ec153ce3d
Integrated into 'main-golden', will be available in build *200810310201* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress) Changeset: http://hg.netbeans.org/main/rev/e24ec153ce3d User: David Van Couvering <davidvc@netbeans.org> Log: #151894: Error message by attempt to add column to the index
Verified with build 081031.