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

Indexes not always displaying while switching table #578

Closed
fifonik opened this issue Mar 17, 2019 · 3 comments

Comments

Projects
None yet
2 participants
@fifonik
Copy link

commented Mar 17, 2019

Steps to reproduce this issue

  1. Create 3 tables using the following script:
CREATE TABLE `t1` (
	`a` INT(11) NULL DEFAULT NULL,
	INDEX `idx_t1_a` (`a`)
);

CREATE TABLE `t2` (
	`b` INT(11) NULL DEFAULT NULL,
	INDEX `idx_t2_b` (`b`)
);

CREATE TABLE `t3` (
	`c` INT(11) NULL DEFAULT NULL
);
  1. Refresh database (F5)
  2. Click at t1 table in tree and select 'Indexes' tab => you'll see index idx_t1_a => OK
  3. Click at t2 table in tree, your default tab will be 'Indexes' and you will see index idx_t2_b => OK
  4. Click at t3 table in tree, your default tab will be 'Indexes' and you will not see any indexes as the table does not have any => OK
  5. Click at t1 table in tree again. Your default tab will be 'Indexes', but this time you will NOT see the index idx_t1_a => ISSUE
  6. Click at t2 table in tree again. Still no index idx_t2_b => ISSUE
    etc

You need to switch from 'Indexes' tab to another tab and back to be able to see table's indexes again.

Current behavior

Indexes not displaying when switching from table that does not have any indexes to table that does have them.

Expected behavior

I believe you should be able to see indexes.

Possible solution

As a workaround you can to switch from 'Indexes' tab to another tab ('Basic' for example) and back.
Unfortunately, you have to do this every time when you see no indexes to be sure that there is no actually indexes on the table.

Environment

  • HeidiSQL version: 10.1.5498
  • Database system and version: MySQL 5.7.23, MariaDB 10.1.14
  • Operating system: Windows 10 x64
@fifonik

This comment has been minimized.

Copy link
Author

commented Apr 11, 2019

Looks like nobody using indexes :)

@fifonik

This comment has been minimized.

Copy link
Author

commented Jun 10, 2019

I noticed the same issue on 'Foreign keys' tabs.

It looks like just Repaint is missed somewhere as when switching table while on the Indexes tab, the Clear button on the left becoming active and if Add button on the left is clicked, the new index added AND already existing indexes appeared.

@ansgarbecker ansgarbecker added this to the v10.2 milestone Jun 11, 2019

ansgarbecker added a commit that referenced this issue Jun 11, 2019

Issue #578: prefer Invalidate over Repaint, as the lists may not be d…
…isplayed at all and may crash when forcing a repaint
@ansgarbecker

This comment has been minimized.

Copy link
Collaborator

commented Jun 11, 2019

Problem was indeed a missing repaint/invalidation in the initialization method. That repaint then indirectly sets the number of root nodes in both index and foreign key editors.
Previously, if there were 0 nodes in the previous table, the next table did never set it to 1 (or whatever number), unless the user clicked "Add" or some other button.

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.