[wp-trac] [WordPress Trac] #35797: delete_metadata should only delete metadata entries with the value specified in $meta_value arg
WordPress Trac
noreply at wordpress.org
Thu Feb 11 11:57:52 UTC 2016
#35797: delete_metadata should only delete metadata entries with the value
specified in $meta_value arg
-------------------------------------------------+-------------------------
Reporter: rahal.aboulfeth | Owner:
Type: defect (bug) | Status: new
Priority: normal | Milestone: Awaiting
Component: Options, Meta APIs | Review
Severity: normal | Version: trunk
Focuses: administration, multisite, | Keywords:
performance |
-------------------------------------------------+-------------------------
In some cases ( huge database ) , wp_delete_attachment caused a Fatal
error related to available memory.
The investigation led me to delete_metadata and more precisely to this
line :
{{{#!php
<?php
$object_ids = $wpdb->get_col( $wpdb->prepare( "SELECT $type_column FROM
$table WHERE meta_key = %s", $meta_key ) );
}}}
Which as you see, tries to get all the post that have a meta_key.. ( in my
case, it was the thumbnail ) , theses posts were extracted to allow
flushing their meta cache.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/35797>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list