range check bug fix that caused mysql to crash
bug fixes found during porting the documentation, port of the pgSphere documentation