Status: Confirmed (View Workflow)
Affects Version/s: 10.3, 10.4, 10.3.11, 10.3.12, 10.3.13
Environment:CentOS 6.10 x64, Windows 10 x64
I had updated from MariaDB 10.1.38 to MariaDB 10.3.13 via WHM. In the process it updated to MariaDB 10.2.23 first. After the process ends, a single application has bugged. After dig a lot I discover what happen, but not why.
Run this code:
The original query is very long, so I tried to simplificate this test case to the best that as I could.
If you run this code the server will crash with the following error:
SQL Error (2013): Lost connection to MySQL server during query
And the my.err will be (full log is attached):
I just run the server with: mysqld without any additional parameters.
I did it based on my original code that crashes, so please consider the following changes (I did it to simplificate, but crashes happen anyway):
- The original code have five tables and is used at ON clauses to make sense. But set all ON to FALSE still will crashes;
- The original code have only a single AS because the join1 and join2 tables are the same. All other tables are not aliases because are differents tables;
I did a lot of tests based on this simplified code that solves the crash, but will change the behaviour of query:
- Dropping the PRIMARY_KEY from id will solve;
- Dropping any JOIN or unwrapper it will solve;
- Dropping NULL AND will solve;
- Replacing NULL AND with NULL OR will solve;
- Replacing join4.id to join3.id will solve;
- Replacing NULL with any other value will solve;
- Moving join1 over join2 will solve;
- Moving join1 to inside of join2, join3 or join4 will solve;
- Moving join2, join3 or join4 to inside of join1 will solve;
- Using other engines than not InnoDB or MRG_MyISAM will solve;
- Adding parentheses to JOIN will not solve;
- Adding PRIMARY_KEY to id will not solve;
- Swapping join4.id with NULL will not solve;
- Replacing NULL with NOT NULL will not solve;
I test some previous versions, and the problems starts in MariaDB 10.3.11 and still affects MariaDB 10.3.12 and MariaDB 10.3.13 (current).
Actually, the problem seems to be related with the `NULL AND`. For some reason it crashes the server.