This function returns the full sql query with sorting order only if the default query is set. This function is only a part of PMA_handleSortOrder function. I didn't wrote any new logic here. This is used to fetch the sql query to display on the UI.