delete_port does not delete all entries referencing a port #4684

Closed
ekoyle opened this Issue Sep 30, 2016 · 0 comments

Projects

None yet

2 participants

@ekoyle
Contributor
ekoyle commented Sep 30, 2016

DO NOT DELETE THIS INFORMATION.

Please read this information carefully.

  • Is your install up to date? Updating your install
    Please do not submit an issue if your install is not up to date within the last 24 hours or on a stable monthly release.
  • Please include all of the information between the ==================================== section of ./validate.php.
  • If you would like us to add a new device then please provide the information asked for here
  • Please provide as much detail as possible.

I just noticed that delete_port (called from delete_device) does not delete everything related to a port.

It is deleting data from about 8 tables, but there seem to be a lot more that reference port_id in some way or another. I would just add them all to the list, but I'm not sure if that is the desired behavior (also, links and ports_stack will need special handling).

MariaDB [(none)]> SELECT DISTINCT TABLE_NAME
     FROM INFORMATION_SCHEMA.COLUMNS
     WHERE COLUMN_NAME LIKE '%port_id%'
     AND TABLE_SCHEMA='librenms';
+--------------------+
| TABLE_NAME         |
+--------------------+
| bill_port_counters |
| bill_ports         |
| ipv4_addresses     |
| ipv4_mac           |
| ipv6_addresses     |
| juniAtmVp          |
| links              |
| mac_accounting     |
| ospf_nbrs          |
| ospf_ports         |
| ports              |
| ports_adsl         |
| ports_perms        |
| ports_stack        |
| ports_statistics   |
| ports_stp          |
| ports_vlans        |
| pseudowires        |
+--------------------+
18 rows in set (0.00 sec)

MariaDB [(none)]> 
@laf laf added the Bug label Oct 1, 2016
@Rosiak Rosiak added a commit to Rosiak/librenms that referenced this issue Oct 14, 2016
@Rosiak Rosiak fix: Delete all port_id references #4684 b1be5aa
@Rosiak Rosiak referenced this issue Oct 14, 2016
Merged

fix: Delete all port_id references #4684 #4798

2 of 2 tasks complete
@laf laf closed this in #4798 Oct 15, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment