Bug #108211 linux mysql partial query not displaying correctly before commit
Submitted: 22 Aug 2022 4:59 Modified: 22 Aug 2022 12:59
Reporter: megatron from space Email Updates:
Status: Can't repeat Impact on me:
None 
Category:MySQL Server Severity:S3 (Non-critical)
Version: Ver 8.0.30-0ubuntu0.22.04.1 for Linux o OS:Ubuntu
Assigned to: CPU Architecture:x86
Tags: client connections in workbench transaction id processes command line

[22 Aug 2022 4:59] megatron from space
Description:
Hi all-

I am so sorry if that turns out to NOT be a bug, but I think it is in fact a bug.

mysql> set autocommit=0;
Query OK, 0 rows affected (0.00 sec)

mysql> start transaction;
Query OK, 0 rows affected (0.01 sec)

mysql> update a1 set bar = 'x1' where foo = 2;
Query OK, 1 row affected (0.00 sec)
Rows matched: 1  Changed: 1  Warnings: 0

+--------+-----------+---------------------+-----------------------+------------------+------------+---------------------+---------------------------------------------+---------------------+-------------------+-------------------+------------------+-----------------------+-----------------+-------------------+-------------------------+---------------------+-------------------+------------------------+----------------------------+---------------------------+---------------------------+------------------+----------------------------+---------------------+
| trx_id | trx_state | trx_started         | trx_requested_lock_id | trx_wait_started | trx_weight | trx_mysql_thread_id | trx_query                                   | trx_operation_state | trx_tables_in_use | trx_tables_locked | trx_lock_structs | trx_lock_memory_bytes | trx_rows_locked | trx_rows_modified | trx_concurrency_tickets | trx_isolation_level | trx_unique_checks | trx_foreign_key_checks | trx_last_foreign_key_error | trx_adaptive_hash_latched | trx_adaptive_hash_timeout | trx_is_read_only | trx_autocommit_non_locking | trx_schedule_weight |
+--------+-----------+---------------------+-----------------------+------------------+------------+---------------------+---------------------------------------------+---------------------+-------------------+-------------------+------------------+-----------------------+-----------------+-------------------+-------------------------+---------------------+-------------------+------------------------+----------------------------+---------------------------+---------------------------+------------------+----------------------------+---------------------+
|  29969 | RUNNING   | 2022-08-21 23:51:55 | NULL                  | NULL             |          3 |                   8 | SELECT * FROM information_schema.innodb_trx | NULL                |                 0 |                 1 |                2 |                  1128 |               1 |                 1 |                       0 | REPEATABLE READ     |                 1 |                      1 | NULL                       |                         0 |                         0 |                0 |                          0 |                NULL |
+--------+-----------+---------------------+-----------------------+------------------+------------+---------------------+---------------------------------------------+---------------------+-------------------+-------------------+------------------+-----------------------+-----------------+-------------------+-------------------------+---------------------+-------------------+------------------------+----------------------------+---------------------------+---------------------------+------------------+----------------------------+---------------------+
1 row in set (0.00 sec)

How to repeat:
-- Connection Id: 8
-- User: root
-- Host: localhost
-- DB: mydb
-- Command: Sleep
-- Time: 52
-- State: None

SELECT * FROM information_schema.innodb_trx;
'29969', 'RUNNING', '2022-08-21 23:51:55', NULL, NULL, '3', '8', NULL, NULL, '0', '1', '2', '1128', '1', '1', '0', 'REPEATABLE READ', '1', '1', NULL, '0', '0', '0', '0', NULL

Suggested fix:
Please make it so when I have a partial transaction that is not committed or rolled back, so that it reports the correct partial query that has not completed.
[22 Aug 2022 12:59] MySQL Verification Team
Hi Mr. megatron,

Thank you for your bug report.

However, we are not able to see any problems when we are using our own binary.

Can't repeat.