Bug #107130 GTID_EXECUTED in SHOW VARIABLES truncated without any warning

Submitted: 26 Apr 2022 11:57 Modified: 27 Apr 2022 12:53
Reporter: Iwo P Email Updates:
Status: Verified Impact on me:
None 
Category:MySQL Server: Information schema Severity:S3 (Non-critical)
Version:8.0.28, 5.7.37 OS:Any
Assigned to: CPU Architecture:Any

[26 Apr 2022 11:57] Iwo P
Description:
GTID_EXECUTED when fetched via SHOW (GLOBAL) VARIABLES is truncated without any warning. 

How to repeat:
00) test.b table:

CREATE TABLE `b` (
  `id` int NOT NULL AUTO_INCREMENT,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB;

01) Generate a lot of random GTID sequences (random uuid).

for i in $(seq 1 70000); do echo "SET gtid_next=concat(uuid(),':1'); INSERT INTO b (id) values (null); commit;" ; done | mysql test

02) Fetch data via @@GLOBAL.gtid_executed:

$ mysql -BNe 'SELECT @@GLOBAL.GTID_EXECUTED' | sed -s 's/\\n/\n/g' |wc -l
70001

(no warnings returned)

03) Fetch data via show global variables:

$ mysql -BNe 'SHOW GLOBAL VARIABLES LIKE "gtid_executed" ' | sed -s 's/\\n/\n/g' | wc -l
26
[27 Apr 2022 12:53] MySQL Verification Team
Hello Iwo P,

Thank you for the report and feedback.

regards,
Umesh
[6 May 2022 8:42] huahua xu
Hi, Iwo P,

The MySQL document specifies that: SHOW VARIABLES is subject to a version-dependent display-width limit. For variables with very long values that are not completely displayed, use SELECT as a workaround.

https://dev.mysql.com/doc/refman/8.0/en/show-variables.html

In addition, the current display-width limit is 1024 bytes.

Portions of this website are copyright © 2001, 2002 The PHP Group

Page generated in 0.049 sec. using MySQL 8.4.7-u6-cloud

Timestamp references displayed by the system are UTC.
Content reproduced on this site is the property of the respective copyright holders.
It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.