My favorites | Sign in
Project Home Source
New issue   Search
for
  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 jtiss...@edge-airport.com, 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?
ALTER TABLE `mytable` ADD PRIMARY KEY (`id`);

What happened instead?
ALTER TABLE `mytable`
	ADD;

Suggested fix (optional)?

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

Feb 13, 2014
#1 adri.gra...@gmail.com
Hi, 

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
#2 jtiss...@edge-airport.com
Hi, 

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 ?

Thanks
Feb 13, 2014
#3 adri.gra...@gmail.com
I will see that
Feb 13, 2014
#4 jtiss...@edge-airport.com
How can I change this issue type to an enhancement ?
Feb 14, 2014
#5 adri.gra...@gmail.com
Done
Labels: -Type-Defect Type-Enhancement
Feb 14, 2014
#6 jtiss...@edge-airport.com
Thanks
Feb 14, 2014
Project Member #7 a...@anse.de
(No comment was entered for this change.)
Status: Accepted
Labels: Severity-Default
Feb 14, 2014
#8 adri.gra...@gmail.com
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 a...@anse.de
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
#10 jtiss...@edge-airport.com
I agree with ansgar, a warning message is better than nothing happens
Feb 17, 2014
#11 adri.gra...@gmail.com
Hi, 

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
table_editor.pas.patch
780 bytes   Download
Feb 17, 2014
Project Member #12 a...@anse.de
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 a...@anse.de
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
#14 adri.gra...@gmail.com
Hello, 

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

I'm ready to commit this noon.

Feb 20, 2014
Project Member #15 a...@anse.de
yes, please commit if you have done the things above
Feb 20, 2014
#16 adri.gra...@gmail.com
This issue was closed by revision r4714.
Status: Fixed
Feb 22, 2014
#17 david.pr...@gmail.com
Translation:
What fit on first and second %s, for instance?
Feb 22, 2014
#18 david.pr...@gmail.com
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. 

Correct?
Feb 23, 2014
#19 adri.gra...@gmail.com
Yes it is.
Sign in to add a comment

Powered by Google Project Hosting