BUG#21065746 RQG_PARTN_PRUNING_VALGRIND FAILED IN REM0REC.CC
BUG#21065746 RQG_PARTN_PRUNING_VALGRIND FAILED IN REM0REC.CC

Problem :
---------
This is a regression of Bug#19138298. In purge_node_t::validate_pcur
we are trying to get offsets for all columns of clustered index from
stored record in persistent cursor. This would fail when stored record
is not having all fields of the index. The stored record stores only
fields that are needed to uniquely identify the entry.

Solution :
----------
1. Use pcur.old_n_fields to get fields that are stored
2. Add comment to note dependency between stored fields in purge node
ref and stored cursor.
3. Return if the cursor record is not already stored as it is not safe
to access cursor record directly without latch.

Reviewed-by: Marko Makela <marko.makela@oracle.com>

RB: 9139

natsys/mariadb_10.2,natsys/mariadb_10.2,flynn1973/mariadb-aix,ollie314/server,ollie314/server,natsys/mariadb_10.2,flynn1973/mariadb-aix,flynn1973/mariadb-aix,davidl-zend/zenddbi,ollie314/server,ollie314/server,davidl-zend/zenddbi,davidl-zend/zenddbi,ollie314/server,davidl-zend/zenddbi,ollie314/server,davidl-zend/zenddbi,ollie314/server,natsys/mariadb_10.2,natsys/mariadb_10.2,ollie314/server,ollie314/server,natsys/mariadb_10.2,flynn1973/mariadb-aix,natsys/mariadb_10.2,ollie314/server,flynn1973/mariadb-aix,slanterns/server,flynn1973/mariadb-aix,davidl-zend/zenddbi,flynn1973/mariadb-aix,davidl-zend/zenddbi,davidl-zend/zenddbi,davidl-zend/zenddbi,flynn1973/mariadb-aix,natsys/mariadb_10.2,natsys/mariadb_10.2,natsys/mariadb_10.2,natsys/mariadb_10.2,davidl-zend/zenddbi,ollie314/server,flynn1973/mariadb-aix,flynn1973/mariadb-aix,flynn1973/mariadb-aix,davidl-zend/zenddbi