This patch adds for "--ps-protocol" second execution
of queries "SELECT".
Also in this patch it is added ability to disable/enable
(--disable_ps2_protocol/--enable_ps2_protocol) second
execution for "--ps-prototocol" in testcases.
Starting with 10.5, InnoDB crash recovery tests seem to time out
more easily under Valgrind, which emulates multiple threads by
interleaving them in a single operating system thread.
These tests will still be covered by
AddressSanitizer and MemorySanitizer.
Since commit fb335b48b5 we may have
a null pointer in purge_sys.query when fetch_data_into_cache() is
invoked and innodb_force_recovery>4. This is because the call to
purge_sys.create() would be skipped.
fetch_data_into_cache(): Load the purge_sys pseudo transaction pointer
to a local variable (null pointer if purge_sys is not initialized).
trx_t::commit_in_memory(): Do not initiate a redo log write if
the transaction has no visible effect. If anything for this
transaction had been made durable, crash recovery will roll back
the transaction just fine even if the end of ROLLBACK is not
durably written.
Rollbacks of transactions that are associated with XA identifiers
(possibly internally via the binlog) will always be persisted.
The test rpl.rpl_gtid_crash covers this.
The srv_monitor_event and the srv_monitor_thread would not be
created when InnoDB is in read-only mode. Yet, some code would
unconditionally invoke os_event_set(srv_monitor_event).
With MDEV-15132 in MariaDB 10.3.5, InnoDB no longer writes the
transaction identifier to the TRX_SYS page. The information is
only written to undo log headers and sometimes rollback segment
headers. Because the setting innodb_force_recovery=5 will skip
reading any of those pages, the maximum transaction identifier
will no longer be determined.
innobase_map_isolation_level(): Always report READ UNCOMMITTED
if innodb_force_recovery has been set to 5 or more, or
innodb_read_only is set. This will avoid errors reported by
lock_check_trx_id_sanity() and ReadView::check_trx_id_sanity().
lock_clust_rec_cons_read_sees(): Do not check for
innodb_read_only, now that innobase_map_isolation_level() will
guarantee that no read view will be created or used.
row_search_mvcc(): Do not check for innodb_force_recovery<5,
now that innobase_map_isolation_level() will guarantee that
no read view will be created or used.
lock_trx_release_locks(): Relax a debug assertion to allow
recovered TRX_STATE_COMMITTED_IN_MEMORY transactions.
trx_commit_in_memory(): Add DEBUG_SYNC instrumentation.
trx_undo_insert_cleanup(): Skip persistent changes if innodb_read_only
is set. This should only happen when a recovered committed transaction
would be cleaned up at shutdown.