In SELECT():
1. Reduce the scope of order_buf and having_buf, thereby reducing the number
of places where we need to remember to free them.
2. Don't allocate order_buf unless we're going to use it.
3. Return an error if the ORDER BY clause references an invalid class
or column (instead of silently ignoring the reference).
4. Return an error if the ORDER BY clause references a virtual field
(instead of including it like it was a real column, resulting in a
failure later).
git-svn-id: svn://svn.open-ils.org/ILS/trunk@12973
dcc99617-32d9-48b4-a31d-
7c20da2025e4