Recreate table with compound primary key generate wrong code:
create table mytable (
col1 int primary key,
col2 int primary key
Proper code is (for most of SQL servers):
create table mytable (
primary key (col1,col2)
Will be investigated for new module based on MDR. There is no way to
fix it nice in the current implementation.
Resolved for 3.3.x or earlier, no new info since then -> closing.
A mistakenly closed RESOLVED LATER/REMIND issue. Reopening.
Grab/Recreate Table action wasn't designed to generate advanced
commands as shown. There is no support for compound keys or indexes so
there is no way how to fix it with current infrastructure.
Changing to ENHANCEMENT.
*** Issue 35308 has been marked as a duplicate of this issue. ***
*** Issue 15412 has been marked as a duplicate of this issue. ***
*** Issue 48693 has been marked as a duplicate of this issue. ***
Do you still think it is more enhancement then the defect?
So many dups have been reported so far, then it might bejust only
The functionality wasn't design for these commands so from this point
of view it is probably an enhancement :-)
If you think so.... There's no absolute true, and each one has his/her
Let me explain my point of view
But if an architect designs house and there are 2 rooms without doors
inside it, would you call it rather badly/buggy designed house or
you'll be happy with it and just say: Alright it's just a question of
an enhancement to get into those rooms.
IMHO it is missing part of design of this feature "Recreate Table"
Iinsist this issue woudl be a defect.
Another case would be
if the house would be designed wihout those 2 rooms. There were just
one big area (with entry in it:-).
Then you cold require the enhacement to build 2 rooms in this big area...
And if there are no doors into those 2 rooms, then again you woudl
call it bug, not another enhancement...
The same paralery you could watch in our problem of feature "Recreate Tab"
So what's the behavior that the user sees? Some error from the driver?
Or something else? As a short term fix, could we at least alert the
user that this case is not supported?
The user can see a dialog with SQL command that will be executed.
There is a possibility to modify the command.
This bug can't be cleanly fixed in the current architecture. We can detect the
situation and warn the user, but I'm not sure it is worth it. Will be addressed
in a future version of the Database Explorer.
Too late to be fixed for 6.0.
This issue isn't solved in NetBeans 6.5. So changed product version.
What we want to do is use a tool like DDLUtils or some functionality from MySQL Workbench. Let's see if we can do this
in the next release. It would be fixed as part of an overall enhancement to allow you to generate DDL from a schema
(rather than current "grab structure"/"recreate table" model).
Reassigned to new owner.
Fixed. Added a workaround to the current architecture.
Please verify. Thanks.
Integrated into 'main-golden', will be available in build *201206050001* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
User: Jaroslav Havlin <firstname.lastname@example.org>
Log: #18144: Recreate table with compound primary key generate wrong sql command