Fixed #3789 Erroneous LIMIT clause in prettyprinted SQL

$sql_limit_to_append will only get append with the default limit value according to the session , if the limit is not added to the sql query explicitly.