session1:
mysql> use papa;
Database changed
mysql> show tables;
Empty set (0.00 sec)
mysql> show variables like '%timeout%';
+------------------------------+----------+
| Variable_name | Value |
+------------------------------+----------+
| clone_ddl_timeout | 300 |
| connect_timeout | 10 |
| delayed_insert_timeout | 300 |
| have_statement_timeout | YES |
| innodb_flush_log_at_timeout | 1 |
| innodb_lock_wait_timeout | 600 |
| innodb_rollback_on_timeout | OFF |
| interactive_timeout | 600 |
| lock_wait_timeout | 300 |
| net_read_timeout | 30 |
| net_write_timeout | 60 |
| rpl_semi_sync_master_timeout | 5000 |
| rpl_stop_slave_timeout | 31536000 |
| slave_net_timeout | 10 |
| wait_timeout | 600 |
+------------------------------+----------+
15 rows in set (0.04 sec)
mysql>
mysql>
mysql> create table t1(id int);
Query OK, 0 rows affected (5.13 sec)
mysql> show variables like '%auto%';
+----------------------------------------------+-------+
| Variable_name | Value |
+----------------------------------------------+-------+
| auto_generate_certs | ON |
| auto_increment_increment | 1 |
| auto_increment_offset | 1 |
| autocommit | ON |
| automatic_sp_privileges | ON |
| caching_sha2_password_auto_generate_rsa_keys | ON |
| clone_autotune_concurrency | ON |
| innodb_autoextend_increment | 64 |
| innodb_autoinc_lock_mode | 2 |
| innodb_stats_auto_recalc | ON |
| sha256_password_auto_generate_rsa_keys | ON |
| sql_auto_is_null | OFF |
+----------------------------------------------+-------+
12 rows in set (0.00 sec)
mysql> begin;
Query OK, 0 rows affected (0.00 sec)
mysql> insert into t1 select 1;
Query OK, 1 row affected (0.03 sec)
Records: 1 Duplicates: 0 Warnings: 0
mysql> select * from t1;
+------+
| id |
+------+
| 1 |
+------+
1 row in set (0.00 sec)
mysql> show variables like '%transaction%';
+----------------------------------------------------------+----------------+
| Variable_name | Value |
+----------------------------------------------------------+----------------+
| binlog_direct_non_transactional_updates | OFF |
| binlog_transaction_dependency_history_size | 25000 |
| binlog_transaction_dependency_tracking | COMMIT_ORDER |
| performance_schema_events_transactions_history_long_size | 10000 |
| performance_schema_events_transactions_history_size | 10 |
| session_track_transaction_info | OFF |
| slave_transaction_retries | 10 |
| transaction_alloc_block_size | 8192 |
| transaction_allow_batching | OFF |
| transaction_isolation | READ-COMMITTED |
| transaction_prealloc_size | 4096 |
| transaction_read_only | OFF |
| transaction_write_set_extraction | XXHASH64 |
+----------------------------------------------------------+----------------+
13 rows in set (0.00 sec)
session2:
mysql> select * from information_schema.innodb_trx where time_to_sec(timediff(now(),trx_started))>60\G;
*************************** 1. row ***************************
trx_id: 24595
trx_state: RUNNING
trx_started: 2019-12-15 14:54:05
trx_requested_lock_id: NULL
trx_wait_started: NULL
trx_weight: 2
trx_mysql_thread_id: 7
trx_query: NULL
trx_operation_state: NULL
trx_tables_in_use: 0
trx_tables_locked: 1
trx_lock_structs: 1
trx_lock_memory_bytes: 1136
trx_rows_locked: 0
trx_rows_modified: 1
trx_concurrency_tickets: 0
trx_isolation_level: READ COMMITTED
trx_unique_checks: 1
trx_foreign_key_checks: 1
trx_last_foreign_key_error: NULL
trx_adaptive_hash_latched: 0
trx_adaptive_hash_timeout: 0
trx_is_read_only: 0
trx_autocommit_non_locking: 0
1 row in set (0.00 sec)