[wp-trac] [WordPress Trac] #51509: Unique key indices missing

WordPress Trac noreply at wordpress.org
Tue Oct 13 16:06:09 UTC 2020


#51509: Unique key indices missing
--------------------------+-----------------------------
 Reporter:  dmsfiris      |      Owner:  (none)
     Type:  defect (bug)  |     Status:  new
 Priority:  normal        |  Milestone:  Awaiting Review
Component:  General       |    Version:  5.5.1
 Severity:  major         |   Keywords:
  Focuses:                |
--------------------------+-----------------------------
 Tables termmeta and postmeta do not update properly using custom "INSERT
 ... ON DUPLICATE KEY UPDATE" queries. I have found this is because of
 dublicate entries in those two tables (WordPress version 5.5.1)

 This bug can be solved by simply adding unique key indices as follows:

 ALTER IGNORE TABLE wp_termmeta ADD UNIQUE (term_id, meta_key);
 ALTER IGNORE TABLE wp_postmeta ADD UNIQUE (post_id, meta_key);

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/51509>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list