The problem is when exporting some selected rows of an uppercase table, the exported dump doesn't contain insert statement for those selected rows. The problem caused because inside the code it transform the sql statement to lowercase and in-turn it will make the table name to lowercase.
Fixed #3830 Can't export custom query because it lowercases table names
explode function is not case sensitive. what if query is in uppercase ? You may need temp variable to do this.
Used preg_split() instead of explode() to split sql query,
Since explode is case sensitive and if table or column contains substring "where" it will give an error
Looks correct to me.