vieten / sequel-pro

Automatically exported from code.google.com/p/sequel-pro
Other
0 stars 0 forks source link

Adding a unique key to a table only adds an index #1213

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Go to edit table structure
2. + to add an index
3. Set the key type to UNIQUE
4. Save the index

What is the expected output? What do you see instead?
Index is saved as KEY and not UNIQUE. Sadface. :( 

What version of Sequel Pro are you using? What version of MySQL are you
connecting to on the server?
Sequel Pro 0.9
MySQL 5.5.15

Original issue reported on code.google.com by mike.o...@klicknation.com on 14 Oct 2011 at 7:07

GoogleCodeExporter commented 9 years ago
Which version of SP are you using? 
0.9 is a whole set of releases.

Also I cannot reproduce with r3445

Original comment by schlabbe...@gmail.com on 14 Oct 2011 at 8:09

GoogleCodeExporter commented 9 years ago
0.9.9.1 build 3408

Original comment by mike.o...@klicknation.com on 14 Oct 2011 at 8:11

GoogleCodeExporter commented 9 years ago
I can't reproduce this against 5.5.9, I'm afraid.  I checked the query console 
(View menu > Show console), and can see the command being issued correctly:

ALTER TABLE `foo` ADD UNIQUE INDEX (`bar`);

Looking at the structure view after this, the Non_unique column for the newly 
created index is correctly set to 0, and the table syntax correctly shows 
UNIQUE KEY `bar` (`bar`).

If you check the query console, what command is being output when you try this?

Thanks :)

Original comment by rowanb@gmail.com on 14 Oct 2011 at 8:16

GoogleCodeExporter commented 9 years ago
Hmm.. I don't know what happened here. Earlier today I was able to reproduce 
this issue over and over again. I was creating UNIQUE keys, and the non_unique 
was being set to 1. And the show create table syntax was showing "KEY" instead 
of "UNIQUE".

I've since restarted the app. And I can no longer reproduce. Sorry.

Original comment by mike.o...@klicknation.com on 14 Oct 2011 at 9:22

GoogleCodeExporter commented 9 years ago
Mike,

Thanks very much for the update.

I've had a look at the code and can't spot anything obviously wrong there 
either - there's a very close link between the menu item and the resulting 
query.

I'm going to mark this as "WontFix" for now, but please do keep an eye out, and 
we'll do the same; should it occur again, capture details from the query log 
and we may be able to narrow it down further.

Thanks!

Original comment by rowanb@gmail.com on 14 Oct 2011 at 10:54