Bug#13340047 LATCHING ORDER VIOLATION IN IBUF_SET_ENTRY_COUNTER()
Bug#13340047 LATCHING ORDER VIOLATION IN IBUF_SET_ENTRY_COUNTER()

ibuf_insert_low(), the only caller of ibuf_set_entry_counter(), will
have latched an insert buffer bitmap page in bitmap_mtr before
invoking ibuf_set_entry_counter(). The latching order forbids any
further pages to be latched.

ibuf_set_entry_counter(): Renamed to ibuf_get_entry_counter(),
simplified the code and added comments.

Added the following symbols for predefined field numbers in change
buffer records:

#define IBUF_REC_FIELD_SPACE	0	/*!< in the pre-4.1 format,
					the page number. later, the space_id */
#define IBUF_REC_FIELD_MARKER	1	/*!< starting with 4.1, a marker
					consisting of 1 byte that is 0 */
#define IBUF_REC_FIELD_PAGE	2	/*!< starting with 4.1, the
					page number */
#define IBUF_REC_FIELD_METADATA	3	/* the metadata field */
#define IBUF_REC_FIELD_USER	4	/* first user field */

rb:802 approved by Sunny Bains

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