[MDEV-31548] Cursor protocol adds junk information in status 'Created_tmp_tables' Created: 2023-06-26  Updated: 2023-11-28

Status: Open
Project: MariaDB Server
Component/s: None
Affects Version/s: 10.4, 10.5, 10.6, 10.9, 10.10, 11.0, 11.1, 11.2
Fix Version/s: 10.4, 10.5, 10.6, 11.0, 11.1, 11.2

Type: Bug Priority: Major
Reporter: Lena Startseva Assignee: Unassigned
Resolution: Unresolved Votes: 0
Labels: None

Issue Links:
Relates
relates to MDEV-31005 Make working cursor-protocol Stalled

 Description   

In case below it is expected that equality "@tmp_tables_after = @tmp_tables_before" will be true :

Case:

CREATE TABLE t1 (
  a INT,
  b INT,
  PRIMARY KEY (a),
  KEY ab(a, b)
);
INSERT INTO t1 VALUES (1,1),(2,2),(3,3),(4,4);
INSERT INTO t1 SELECT a + 4, b + 4 FROM t1;
 
--disable_query_log
--let $q = `show status like 'Created_tmp_tables';`
eval set @tmp_tables_before = 
  CAST(REPLACE('$q', 'Created_tmp_tables', '') AS UNSIGNED);
--enable_query_log
 
SELECT a FROM t1 IGNORE INDEX FOR GROUP BY (a, ab) GROUP BY a;
 
--disable_query_log
--let $q = `show status like 'Created_tmp_tables';`
eval set @tmp_tables_after = 
  CAST(REPLACE('$q', 'Created_tmp_tables', '') AS UNSIGNED);
--enable_query_log
 
SELECT @tmp_tables_after;
SELECT @tmp_tables_before ;
SELECT @tmp_tables_after = @tmp_tables_before ;
 
DROP TABLE t1;

Expected value:

SELECT @tmp_tables_after;
@tmp_tables_after
1
SELECT @tmp_tables_before ;
@tmp_tables_before
1
SELECT @tmp_tables_after = @tmp_tables_before ;
@tmp_tables_after = @tmp_tables_before
1

Actual value:

SELECT @tmp_tables_after;
@tmp_tables_after
2
SELECT @tmp_tables_before ;
@tmp_tables_before
1
SELECT @tmp_tables_after = @tmp_tables_before ;
@tmp_tables_after = @tmp_tables_before
0


Generated at Thu Feb 08 10:24:42 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.