Bug #111156 main.subquery_sj_all_bka_nobnl and main.subquery_sj_mat_bka_nobnl fail on s390x
Submitted: 25 May 2023 16:34 Modified: 7 Aug 14:25
Reporter: Lena Voytek Email Updates:
Status: Unsupported Impact on me:
None 
Category:Tests: Server Severity:S7 (Test Cases)
Version:8.0.33 OS:Debian (Fails on Debian sid and Ubuntu 20.04-23.04)
Assigned to: CPU Architecture:Other (s390x)

[25 May 2023 16:34] Lena Voytek
Description:
When running the upstream test suite on a s390x Debian or Ubuntu system, the tests main.subquery_sj_all_bka_nobnl and main.subquery_sj_mat_bka_nobnl fail as of 8.0.33. Both tests fail due to content mismatches through join operations. 

I understand s390x is an unsupported architecture here, but I figure these failures may be useful to know about.

A full log for Debian can be found here: https://ci.debian.net/data/autopkgtest/testing/s390x/m/mysql-8.0/33836705/log.gz

The relevant results show the following:

[ 86%] main.subquery_sj_all_bka_nobnl           w7  [ fail ]
        Test ended at 2023-05-24 15:27:00

CURRENT_TEST: main.subquery_sj_all_bka_nobnl
--- /usr/lib/mysql-test/r/subquery_sj_all_bka_nobnl.result	2023-03-16 20:22:37.000000000 +0300
+++ /tmp/tmp.Pf7H4WvKzH/var/7/log/subquery_sj_all_bka_nobnl.reject	2023-05-24 18:26:59.844163031 +0300
@@ -5895,7 +5895,7 @@
 FROM ot1 LEFT JOIN ot2 ON ot1.a=ot2.a AND ot1.a IN (SELECT a FROM it3)
 LEFT JOIN ot3 ON ot2.a=ot3.a AND ot3.a IN (SELECT a FROM it3);
 EXPLAIN
--> Nested loop left join  (cost=48.2 rows=288)
+-> Nested loop left join  (cost=48.3 rows=288)
     -> Nested loop left join  (cost=11.5 rows=96)
         -> Table scan on ot1  (cost=1.05 rows=8)
         -> Nested loop inner join  (cost=4.35 rows=12)

mysqltest: Result content mismatch

The result from queries just before the failure was:
test.t2	analyze	status	OK
EXPLAIN FORMAT=tree SELECT * FROM t1 WHERE EXISTS ( SELECT alias1.f2 FROM t2 LEFT JOIN t1 ON 1 LEFT JOIN t1 AS alias1 ON 1 );
EXPLAIN
-> Remove duplicate t1 rows using temporary table (weedout)  (cost=14.8 rows=54)
    -> Nested loop left join  (cost=14.8 rows=54)
        -> Nested loop left join  (cost=4.85 rows=18)
            -> Nested loop inner join  (cost=1.55 rows=6)
                -> Table scan on t2  (cost=0.45 rows=2)
                -> Table scan on t1  (cost=0.4 rows=3)
            -> Table scan on t1  (cost=0.3 rows=3)
        -> Table scan on alias1  (cost=4.8 rows=3)

SELECT * FROM t1 WHERE EXISTS ( SELECT alias1.f2 FROM t2 LEFT JOIN t1 ON 1 LEFT JOIN t1 AS alias1 ON 1 );
f1	f2
08:35:24	X
11:22:33	Q
14:51:13	S
DROP TABLE t1, t2;
set optimizer_switch=default;
set optimizer_switch=default;
safe_process[66301]: Child process: 66302, exit: 1

[ 96%] main.subquery_sj_mat_bka_nobnl           w3  [ fail ]
        Test ended at 2023-05-24 15:28:05

CURRENT_TEST: main.subquery_sj_mat_bka_nobnl
--- /usr/lib/mysql-test/r/subquery_sj_mat_bka_nobnl.result	2023-03-16 20:22:37.000000000 +0300
+++ /tmp/tmp.Pf7H4WvKzH/var/3/log/subquery_sj_mat_bka_nobnl.reject	2023-05-24 18:28:05.560167037 +0300
@@ -6121,7 +6121,7 @@
 FROM ot1 LEFT JOIN ot2 ON ot1.a=ot2.a AND ot1.a IN (SELECT a FROM it3)
 LEFT JOIN ot3 ON ot2.a=ot3.a AND ot3.a IN (SELECT a FROM it3);
 EXPLAIN
--> Nested loop left join  (cost=48.2 rows=288)
+-> Nested loop left join  (cost=48.3 rows=288)
     -> Nested loop left join  (cost=11.5 rows=96)
         -> Table scan on ot1  (cost=1.05 rows=8)
         -> Nested loop inner join  (cost=4.35 rows=12)

mysqltest: Result content mismatch

The result from queries just before the failure was:
EXPLAIN FORMAT=tree SELECT * FROM t1 WHERE EXISTS ( SELECT alias1.f2 FROM t2 LEFT JOIN t1 ON 1 LEFT JOIN t1 AS alias1 ON 1 );
EXPLAIN
-> Nested loop inner join  (cost=12.4 rows=54)
    -> Constant row from <subquery2>  (cost=6.72..6.72 rows=1)
        -> Materialize with deduplication  (cost=6.65..6.65 rows=18)
            -> Nested loop left join  (cost=4.85 rows=18)
                -> Nested loop left join  (cost=1.55 rows=6)
                    -> Table scan on t2  (cost=0.45 rows=2)
                    -> Table scan on t1  (cost=0.4 rows=3)
                -> Table scan on alias1  (cost=0.3 rows=3)
    -> Table scan on t1  (cost=0.55 rows=3)

SELECT * FROM t1 WHERE EXISTS ( SELECT alias1.f2 FROM t2 LEFT JOIN t1 ON 1 LEFT JOIN t1 AS alias1 ON 1 );
f1	f2
08:35:24	X
11:22:33	Q
14:51:13	S
DROP TABLE t1, t2;
set optimizer_switch=default;
set optimizer_switch=default;
safe_process[73004]: Child process: 73005, exit: 1

How to repeat:
Run the upstream testsuite on an s390x Debian or Ubuntu machine for 8.0.33
[26 May 2023 13:11] MySQL Verification Team
Hi Mr. Voytek,

Thank you for your bug report.

However, IBM's mainframes are NOT supported to all.

We might have attempted to see what is going wrong, but we do NOT have access to ANY of these systems. Some of us have worked on the 43x series and OS/400 series, but we do not have even access to those.

Ten to fifteen years ago , we did manage to make MySQL fully functional on AS/400 and on VM that ran on s390x , but never on the metal itself. 

We can not repeat those experiences, since we do not have access to those systems, nor do we have any plans  to support MySQL on those systems.

Unsupported.

We do not even have ambitions for porting MySQL to any of those platforms.
[7 Aug 14:25] Lena Voytek
Hi, Mrs. Voytek here,

As stated before, I understand s390x is unsupported, but these testsuite failures may be useful to know about.

Just as an update, with the release of 8.4.2, main.subquery_sj_all_bka_nobnl and main.subquery_sj_mat_bka_nobnl are passing again. However, main.archive and main.func_compress now fail with the following:

CURRENT_TEST: main.archive
767s --- /usr/lib/mysql-test/r/archive.result	2024-07-12 22:20:22.000000000 +0300
767s +++ /tmp/tmp.jZHfOwlPLE/var/2/log/archive.reject	2024-08-05 06:27:53.397196328 +0300
767s @@ -12732,7 +12732,7 @@
767s  SELECT DATA_LENGTH, AVG_ROW_LENGTH FROM
767s  INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME='t1' AND TABLE_SCHEMA='test';
767s  DATA_LENGTH	AVG_ROW_LENGTH
767s -122	61
767s +121	60
767s  DROP TABLE t1;
767s  SET @save_join_buffer_size= @@join_buffer_size;
767s  SET @@join_buffer_size= 8192;
767s 
767s mysqltest: Result content mismatch
767s 
767s 
767s The result from queries just before the failure was:
767s 3	3
767s SELECT * FROM innodb_table ORDER BY id;
767s id	x
767s 1	3
767s 3	5
767s 5	6
767s # Delete is allowed if the archive table is only read from.
767s DELETE t2 FROM archive_table AS t1, innodb_table AS t2 WHERE t1.id = t2.id;
767s SELECT * FROM archive_table ORDER BY id;
767s id	x
767s 1	1
767s 2	2
767s 3	3
767s SELECT * FROM innodb_table ORDER BY id;
767s id	x
767s 5	6
767s DROP VIEW v;
767s DROP TABLE archive_table, innodb_table;
767s Warnings:
767s Warning	1287	'@@binlog_format' is deprecated and will be removed in a future release.
767s safe_process[13310]: Child process: 13311, exit: 1

CURRENT_TEST: main.func_compress
1242s --- /usr/lib/mysql-test/r/func_compress.result	2024-07-12 22:20:22.000000000 +0300
1242s +++ /tmp/tmp.jZHfOwlPLE/var/1/log/func_compress.reject	2024-08-05 06:35:48.637478848 +0300
1242s @@ -58,7 +58,7 @@
1242s  length(a)
1242s  NULL
1242s  12
1242s -76
1242s +454
1242s  50000
1242s  select length(uncompress(a)) from t1;
1242s  length(uncompress(a))
1242s 
1242s mysqltest: Result content mismatch
1242s 
1242s 
1242s The result from queries just before the failure was:
1242s Warning	1259	ZLIB: Input data corrupted
1242s drop table t1;
1242s CREATE TABLE t1 (c1 INT);
1242s INSERT INTO t1 VALUES (1), (1111), (11111);
1242s SELECT UNCOMPRESS(c1), UNCOMPRESSED_LENGTH(c1) FROM t1;
1242s UNCOMPRESS(c1)	UNCOMPRESSED_LENGTH(c1)
1242s NULL	0
1242s NULL	0
1242s NULL	825307441
1242s EXPLAIN SELECT * FROM (SELECT UNCOMPRESSED_LENGTH(c1) FROM t1) AS s;
1242s DROP TABLE t1;
1242s End of 5.0 tests
1242s #
1242s # Bug#18693654 VALGRIND WARNINGS IN INFLATE ON UNCOMPRESS
1242s #
1242s SELECT UNCOMPRESS( CAST( 0 AS BINARY(5) ) );
1242s UNCOMPRESS( CAST( 0 AS BINARY(5) ) )
1242s NULL
1242s Warnings:
1242s Warning	1259	ZLIB: Input data corrupted
1242s safe_process[26323]: Child process: 26324, exit: 1

Thanks
[7 Aug 14:49] MySQL Verification Team
Dear Mrs. Voytek,

We are so happy to hear from you again.

Some of us here are still nostalgic about the times when we worked on 4381 systems and used that fantastic 3278 IBM terminal.

But, you probably do not know what we are talking about here.......

Now, about the tests .......

Regarding the archive test, forget about it ....... It is about ARCHIVE storage engine, which is not maintained any more and nobody uses it.

Regarding the other test, well, we might guess what the problem is ......

You should consider rebuilding the zlib library that you are using ........

You should have this one: zlib-1.2.13 .......

It could be also a problem with how you build it ....... that is all ......

.........................................................................................................

One more unrelated question ......

Are you running MySQL on Linux within the VM machine or on the metal .......

If it is first, you do not have to respond ........ that is what we presume .......

We wish you all the best with porting MySQL .......