* Adding failing test for base table aliases using SQLSelect
* FIX Retain table aliases applied to the base table on queries
* FIX Move the trimmed alias outside of the condition so we can use it within the condition
The SS4 behaviour of limit=0 is unlikely to be the SS5 behaviour.
To clear the limit limit=null is recommended.
In addition, there’s a bit tighter type maintenance in the internal
limit data (ensure things are int).
Fixes#2950.