The only data node storage engine, i.e. the only storage engine that actually stores data, that needs prune_partitions_for_child() to be called is MyISAM for Merge tables. However, support for this functionality has not yet been added to MyISAM Merge. Therefore the data node storage engines will always execute
virtual bool handler::prune_partitions_for_child(THD *thd, Item *pprune_cond) { return FALSE; }
|
That is why this code looks weird right now. It looked weird to me too, until Kentoku explained it. In the meantime, this functionality is only supported by the Vertical Partioning Storage Engine for its vertical partitions. Until Kentoku merges that engine into MariaDB, refer to the tar at http://spiderformysql.com/downloads/spider-3.3/patch_mariadb-10.2.0.tgz to see the details of how that engine uses prune_partitions_for_child().
The patch includes
if (!pprune_cond)
{
mark_all_partitions_as_used(part_info);
- DBUG_RETURN(FALSE);
+ retval= base_table->file->prune_partitions_for_child(thd, pprune_cond);
+ DBUG_RETURN(retval);
}
Which doesnt seem to make sense: it does not make any sensse to call prune_partitions_for_child(thd, NULL).