It will return NULL as the output when the value of either first argument i.e. substring or the value of second argument i.e. substring is NULL. Example below will demonstrate it −
Example
mysql> Select LOCATE(NULL,'Ram is a good boy')As Result;
+--------+
| Result |
+--------+
| NULL |
+--------+
1 row in set (0.00 sec)
mysql> Select LOCATE('Ram',NULL)As Result;
+--------+
| Result |
+--------+
| NULL |
+--------+
1 row in set (0.00 sec)