Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"Duplicate row" doesnt duplicate primary or unique fields #396

Closed
arikanorh opened this issue Nov 14, 2018 · 5 comments

Comments

Projects
None yet
2 participants
@arikanorh
Copy link

commented Nov 14, 2018

Steps to reproduce this issue

image

  1. Step 1; Create table with multi-column primary key and other fields
  2. Step 2;Insert some data
  3. Step N; Then duplicate row
  4. Then I get empty fields on primary key fields

Current behavior

The fields are empty

Expected behavior

I expect those fields are duplicated as above row

Possible solution

just duplicate those columns and let user change them

Environment

  • HeidiSQL version:
    9.5.0.5337 (64 Bit)
  • Database system and version:
    MySQL
  • Operating system:
    Windows 10
@ansgarbecker

This comment has been minimized.

Copy link
Collaborator

commented Nov 14, 2018

HeidiSQL lets these out intentionally, as you would get some "duplicate entry" error when posting such values. The user would be forced to change unique values otherwise. That's a solution to a problem, not a bug. What do you propose to solve that issue?

@arikanorh

This comment has been minimized.

Copy link
Author

commented Nov 15, 2018

Leaving empty throws another error, "Fields doesnt have default value". This just changes the problem not solve it. This also makes the problem worse. What i mean that, when you duplicate a row a and leave primary fields empty, user have to type all the fields, that nullifies convinience of duplicating row.

But If it would have duplicated all fields no matter what, user have to change only one primary key field to make it not duplicate.

In my case, there are 3 primary fields which two of them are timestamps. When those are left empty, I have to manually type those 3 fields. Bu all i need the change the just hour value of the one timestamp column.

You force the user fill 3 column instead of just change a part of 1 column.

I believe that my solution is more convinient for duplicating the row.

@ansgarbecker

This comment has been minimized.

Copy link
Collaborator

commented Dec 4, 2018

As there were users complaining about exactly these unwanted unique key values in a duplicated row, I propose a second "Duplicate row" menu item, perhaps labelled "Duplicate row with keys". The other one should probably renamed to "Duplicate row without keys". Hoping that "keys" is clear for the user that it means "primary or unique key values", as that would be too long for the context menu.

@ansgarbecker ansgarbecker added this to the v10.1 milestone Jan 3, 2019

@ansgarbecker

This comment has been minimized.

Copy link
Collaborator

commented Apr 17, 2019

Just implemented that new item to the context menu. Please test and report back.

@arikanorh

This comment has been minimized.

Copy link
Author

commented Apr 17, 2019

Hey, just tested and working as expected. Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.