SqlGenerator sortSpec bugs fixed