My favorites | Sign in
Project Home Source
New issue   Search
  Advanced search   Search tips   Subscriptions
Issue 3516: Add primary key does not work
4 people starred this issue and may be notified of changes. Back to list
Status:  Fixed
Owner:  ----
Closed:  Feb 2014

Sign in to add a comment
Reported by, Feb 13, 2014
What exact steps will reproduce the problem?
1. create table
2. add fields
3. add primary key in the "Indexes" Tab

What was the expected output?

What happened instead?
ALTER TABLE `mytable`

Suggested fix (optional)?

Version used?
 HeidiSQL revision:
 MySQL Server version: 4.1.2
 Operating system: Windows 7 x64

Feb 13, 2014

Did you Drag & drop fields into your index ? (or right click on field and create new index or add to index)

I think you try to add an empty index.

When you expand index node you must see the choosen field.
And when a field is on an index, you can see a key befor # column.

Feb 13, 2014

You ara right, I forget to add a field in my index. Is it possible to add a warning message in case of empty index ?

Feb 13, 2014
I will see that
Feb 13, 2014
How can I change this issue type to an enhancement ?
Feb 14, 2014
Labels: -Type-Defect Type-Enhancement
Feb 14, 2014
Feb 14, 2014
Project Member #7
(No comment was entered for this change.)
Status: Accepted
Labels: Severity-Default
Feb 14, 2014
I don't know what is the best solution :

Show warning message ? 
or don't execute query for create empty index ?
Feb 14, 2014
Project Member #9
Removing the ALTER code from the batch would probably lead to misunderstandings. There should be a warning like this:

Index "PRIMARY/whatever" does not contain any column. You can add columns using drag'n drop from the columns list.

Feb 16, 2014
I agree with ansgar, a warning message is better than nothing happens
Feb 17, 2014

I made a patch, is it looks good for you?

I put the patch in the attachment to Ansgar if you want to see the changes (and where I did it).

Index error.PNG
22.1 KB   View   Download
780 bytes   Download
Feb 17, 2014
Project Member #12
Patch looks good, apart from two glitches:
* Grammar in comment: "If No, exit the the function", change to "If not, exit early"
* please include begin/end in for loop. Although it's not required, a loop with more than a one-liner below looks more readable when it's wrapped.
Feb 18, 2014
Project Member #13
Ah, and don't forget to include default.po from the english locale directory with the new string in the same commit!
Feb 20, 2014

Sorry for the late reply, I was abroad for work.

I'm ready to commit this noon.

Feb 20, 2014
Project Member #15
yes, please commit if you have done the things above
Feb 20, 2014
This issue was closed by revision r4714.
Status: Fixed
Feb 22, 2014
What fit on first and second %s, for instance?
Feb 22, 2014
I think I get (based on the image): 
First is the type of index (KEY, PRIMARY KEY, UNIQUE...) 
Second is the name of the index. 

Feb 23, 2014
Yes it is.
Sign in to add a comment

Powered by Google Project Hosting