Description:
Hello, I found a bug in 8.0.35-cluster version of MYSQL cluster. It will cause the current mysql service to crash.
The detail is as follow.
OS version and name:
Ubuntu 22.04.3 LTS (Jammy Jellyfish)
Linux eb1f47b08982 6.5.11-8-pve #1 SMP PREEMPT_DYNAMIC PMX 6.5.11-8 (2024-01-30T12:27Z) x86_64 x86_64 x86_64 GNU/Linux
Poc:
```
delete from mytest90.test9
where
EXISTS (
select
ref_0.column1 as c0,
(select node_id from ndbinfo.cpuinfo limit 1 offset 6)
as c1,
subq_0.c1 as c2,
ref_0.column2 as c3,
case when (false) or (false) then 21 else 21 end
as c4
from
mytest90.test1 as ref_0
right join (select
(select mysql_version from sys.version limit 1 offset 48)
as c0,
ref_1.column6 as c1,
(select LOCK_DATA from performance_schema.data_locks limit 1 offset 4)
as c2,
mytest90.test9.column5 as c3,
ref_1.column4 as c4,
ref_1.column5 as c5
from
mytest90.test4 as ref_1 where ref_1.column6 is NULL) as subq_0
on (false)
where (true)
and ((true)
or ((mytest90.test9.column8 is not NULL)
and ((false)
or ((mytest90.test9.column10 is not NULL)
or ((true)
and (EXISTS (
select
subq_0.c2 as c0,
subq_0.c2 as c1,
ref_0.column2 as c2,
ref_2.column1 as c3
from
mytest90.test3 as ref_2
where subq_0.c1 is NULL
limit 150)))))))
limit 120);
```
It manifests itself in this way:
```
ERROR 2013 (HY000): Lost connection to MySQL server during query
No connection. Trying to reconnect...
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/usr/local/mysql-cluster/sock/mysql.sock' (111)
ERROR:
Can't connect to the server
```
Architecture Information:
'''
[NDBD DEFAULT]
NoOfReplicas =2
DataMemory = 512M
IndexMemory = 64M
[NDB_MGMD]
NodeId=1
hostname =192.172.10.8
datadir =/var/lib/mysql-cluster
[NDBD]
NodeId =2
hostname =192.172.10.9
datadir =/usr/local/mysql-cluster/data
NodeGroup=0
[NDBD]
NodeId =3
hostname =192.172.10.10
datadir =/usr/local/mysql-cluster/data
NodeGroup=1
[NDBD]
NodeId =4
hostname =192.172.10.11
datadir =/usr/local/mysql-cluster/data
NodeGroup=0
[NDBD]
NodeId =5
hostname =192.172.10.12
datadir =/usr/local/mysql-cluster/data
NodeGroup=1
[mysqld]
NodeId =6
hostname =192.172.10.9
[mysqld]
NodeId =7
hostname =192.172.10.10
[mysqld]
NodeId =8
hostname =192.172.10.11
[mysqld]
NodeId =9
hostname =192.172.10.12
'''
Attempted and successfully reproduced!
How to repeat:
Importing the database file I give later, and then executing Poc
Suggested fix:
I'm not sure why this issue is occurring, but since there are multiple layers of nested queries and EXISTS clauses involved, it may be that there is a problem with the synchronization process?