Lock-data:supremum pseudo-record in MySQL5.7.11 with REPEATABLE-READ
<p>MySQL5.7.11, tx_isolation is REPEATABLE-READ;</p>

<p>Table like this:</p>

<pre><code>CREATE TABLE a (
  id int(11) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

insert into a values(1);
</code></pre>

<p>in session1, execute like this:</p>

<pre><code>begin;
select * from a where id=2 for update;
</code></pre>

<p>then in session2, execute:</p>

<pre><code>begin;
insert into a values(3);
</code></pre>

<p>session2 is blocked, and I think session2 is blocked because the GAP lock, 
but in information_schema.innodb_lock, it shows supremum pseudo-record and RECORD Lock;</p>

<pre><code>*************************** 1. row ***************************
    lock_id: 234076:115:3:1
lock_trx_id: 234076
  lock_mode: X
  lock_type: RECORD
 lock_table: `test`.`a`
 lock_index: PRIMARY
 lock_space: 115
  lock_page: 3
   lock_rec: 1
  lock_data: supremum pseudo-record
*************************** 2. row ***************************
    lock_id: 234075:115:3:1
lock_trx_id: 234075
  lock_mode: X
  lock_type: RECORD
 lock_table: `test`.`a`
 lock_index: PRIMARY
 lock_space: 115
  lock_page: 3
   lock_rec: 1
  lock_data: supremum pseudo-record
2 rows in set (0.00 sec)
</code></pre>

<p>MySQL_Doc describes it as follow:</p>

<pre><code>For the last interval, the next-key lock locks the gap above the largest value in the index and the
“supremum” pseudo-record having a value higher than any value actually in the index. The supremum
is not a real index record, so, in effect, this next-key lock locks only the gap following the largest index
value.
</code></pre>

<p>why is the Record Lock and the lock_data is supremum pseudo-record?</p>