using GDAL 3.0.4 on windows.
Running an ExecuteSQL command on various datasets (shapefiles, geodatabases, ...) works in almost all cases except when i have an SQL query with an ORDER BY containing multiple fields.
For example either of these succeed:
"SELECT * FROM cities ORDER BY CITY_NAME"
"SELECT * FROM cities ORDER BY COUNTRY_NAME"
But this fails:
"SELECT * FROM cities ORDER BY CITY_NAME, COUNTRY_NAME"
The problem in the failure case, is no error is generated, and the returned OGRLayer is not null. The OGRLayer is just in a bad state, and calling any methods on the OGRLAyer causes a crash. (eg. null pointer access) For example, calling GetFeatureCount() on the returned OGRLayer causes crash.
It is not clear from the GDAL documentation if multiple fields in ORDER BY is supported or not. But even if not, it should return an error and a null OGRLayer.