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

Foreign key drop downlist on insert duplicating FK values #14997

Closed
W1DJM opened this issue Mar 5, 2019 · 3 comments
Closed

Foreign key drop downlist on insert duplicating FK values #14997

W1DJM opened this issue Mar 5, 2019 · 3 comments
Assignees
Labels
duplicate ui Issues relating to the user interface

Comments

@W1DJM
Copy link

W1DJM commented Mar 5, 2019

Problem

When inserting new values in a table that has a foreign key reference the foreign key values are duplicate in the dropdown list with a space added between the 2 groupings.

To Reproduce

CREATE TABLE `table1` (
  `tab1_id` int(11) NOT NULL,
  `name` varchar(255) COLLATE utf8mb4_unicode_520_ci NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_520_ci;

INSERT INTO `table1` (`tab1_id`, `name`) VALUES
(1, 'entry 1'),
(2, 'entry 2');

ALTER TABLE `table1`
  ADD PRIMARY KEY (`tab1_id`),
  ADD UNIQUE KEY `table1_name` (`name`);

ALTER TABLE `table1`
  MODIFY `tab1_id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3;

CREATE TABLE `table2` (
  `tab2_id` int(11) NOT NULL,
  `name` varchar(255) COLLATE utf8mb4_unicode_520_ci NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_520_ci;

ALTER TABLE `table2`
  ADD PRIMARY KEY (`tab2_id`),
  ADD KEY `names` (`name`);

ALTER TABLE `table2`
  MODIFY `tab2_id` int(11) NOT NULL AUTO_INCREMENT;

ALTER TABLE `table2`
  ADD CONSTRAINT `names` FOREIGN KEY (`name`) REFERENCES `table1` (`name`) ON DELETE NO ACTION ON UPDATE NO ACTION;

Switch to table 2 and click on Insert. Select the pulldown next to the name field and you should see the 2 entries from table 1 in the list twice with a space between them as shown in the image below.

dropdown_list_bug

Expected behavior

Since there are only 2 entries in the name field of table 1 only 2 names should be shown in the dropdown list when inserting a value in table 2.

Server configuration

  • Operating system: Windows
  • Web server: Apache 2.4.38
  • Database version: MariaDB 10.3.11
  • PHP version: 7.3.2
  • phpMyAdmin version: 4.8.5

Client configuration

  • Browser: Chrome/Firefox
  • Operating system: Windows
@williamdes williamdes added the ui Issues relating to the user interface label Mar 5, 2019
@williamdes
Copy link
Member

@DEQ-Dave Thank you for the report, this issue seems to be a duplicate of #14181

@W1DJM
Copy link
Author

W1DJM commented Mar 11, 2019

It is indeed so I'll follow that issue.

@W1DJM W1DJM closed this as completed Mar 11, 2019
@williamdes
Copy link
Member

Duplicate of #14181

@williamdes williamdes marked this as a duplicate of #14181 Mar 11, 2019
@williamdes williamdes self-assigned this Mar 11, 2019
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jun 21, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
duplicate ui Issues relating to the user interface
Projects
None yet
Development

No branches or pull requests

2 participants