Bug #112935 Different Behaviour Seen Between MyISAM and MEMORY Engine
Submitted: 2 Nov 2023 10:05 Modified: 2 Nov 2023 13:40
Reporter: Aaditya Dubey Email Updates:
Status: Duplicate Impact on me:
None 
Category:MySQL Server Severity:S2 (Serious)
Version:8.0.35 OS:Any
Assigned to: CPU Architecture:Any

[2 Nov 2023 10:05] Aaditya Dubey
Description:
Hi Team,

Start Two MySQL server (8.0.35) and create database test on both the servers:

Run Following table creation and data insertion scripts on the servers separately:

Server 1:

1. source create-MYISAM.sql
2. source select.sql

Server 2:

1. source create-MEMORY.sql
2. source select.sql

The only difference is those two files is the engine rest everything is same.

Same select returns different results.

How to repeat:
mysql [localhost:8036] {msandbox} ((none)) > use test
Database changed

mysql [localhost:8036] {msandbox} (test) > source create-MYISAM.sql
Query OK, 0 rows affected, 29 warnings (0.02 sec)

Query OK, 1 row affected, 29 warnings (0.02 sec)

Query OK, 1 row affected, 29 warnings (0.00 sec)

Query OK, 0 rows affected, 30 warnings (0.00 sec)

Query OK, 0 rows affected, 30 warnings (0.00 sec)

Query OK, 0 rows affected, 30 warnings (0.00 sec)

Query OK, 0 rows affected, 30 warnings (0.00 sec)
...

Query OK, 0 rows affected, 30 warnings (0.00 sec)

Query OK, 0 rows affected, 30 warnings (0.00 sec)

mysql [localhost:8036] {msandbox} (test) > source select.sql
Empty set (0.04 sec)

mysql [localhost:8036] {msandbox} (test) > source create-MEMORY.sql
Query OK, 0 rows affected, 29 warnings (0.02 sec)

Query OK, 1 row affected, 29 warnings (0.00 sec)

Query OK, 1 row affected, 29 warnings (0.00 sec)

Query OK, 0 rows affected, 30 warnings (0.00 sec)

Query OK, 0 rows affected, 30 warnings (0.00 sec)

Query OK, 0 rows affected, 30 warnings (0.00 sec)

Query OK, 0 rows affected, 30 warnings (0.01 sec)

Query OK, 0 rows affected, 30 warnings (0.00 sec)
...

Query OK, 0 rows affected, 30 warnings (0.00 sec)

Query OK, 0 rows affected, 30 warnings (0.00 sec)

mysql [localhost:8036] {msandbox} (test) > source select.sql
+------+------+------+------+
| c0   | c1   | c2   | c3   |
+------+------+------+------+
| NULL | NULL | NULL | NULL |
| NULL | NULL | NULL | NULL |
| NULL | NULL | NULL | NULL |
| NULL | NULL | NULL | NULL |
+------+------+------+------+
4 rows in set (0.01 sec)

Suggested fix:
Expecting same results irrespective of engine type.
[2 Nov 2023 10:09] Aaditya Dubey
MyISAM File

Attachment: create-MYISAM.sql (application/octet-stream, text), 253.60 KiB.

[2 Nov 2023 10:09] Aaditya Dubey
Memory File

Attachment: create-MEMORY.sql (application/octet-stream, text), 253.60 KiB.

[2 Nov 2023 10:09] Aaditya Dubey
Select Statement

Attachment: select.sql (application/octet-stream, text), 13.89 KiB.

[2 Nov 2023 10:43] Aaditya Dubey
Please note InnoDB results are empty too so it is same as MyISAM.
[2 Nov 2023 13:40] MySQL Verification Team
Please do not submit the same bug more than once. An existing bug report already describes this very problem. Even if you feel that your issue is somewhat different, the resolution is likely
to be the same. Because of this, we hope you add your comments to the original bug instead.

The original bug is: https://bugs.mysql.com/bug.php?id=112917

Thank you for your interest in MySQL.