X-Git-Url: http://git.kpe.io/?a=blobdiff_plain;f=sql%2Foodml.lisp;h=fb76c55743fe7ff464377d42c08ac5958ec5dae6;hb=c58d03408390451aeb6887d78b391684ecc8f691;hp=9bd2ab66dea8f5db6b74f2665ea31092b2ebe899;hpb=e567409d9fff3f7231c2a0bb69b345e19de2b246;p=clsql.git diff --git a/sql/oodml.lisp b/sql/oodml.lisp index 9bd2ab6..fb76c55 100644 --- a/sql/oodml.lisp +++ b/sql/oodml.lisp @@ -949,7 +949,6 @@ maximum of MAX-LEN instances updated in each query." (listify order-by))) (join-where nil)) - ;;(format t "sclasses: ~W~%ijc: ~W~%tables: ~W~%" sclasses immediate-join-classes tables) (dolist (ob order-by-slots) @@ -1094,17 +1093,22 @@ as elements of a list." ;; one selected table. This is required so FIND-ALL won't duplicate ;; the field (when (and order-by (= 1 (length target-args))) - (let ((table-name (view-table (find-class (car target-args)))) + (let ((table-name (view-table (find-class (car target-args)))) (order-by-list (copy-seq (listify order-by)))) (loop for i from 0 below (length order-by-list) - do (etypecase (nth i order-by-list) + do (typecase (nth i order-by-list) (sql-ident-attribute - (unless (slot-value (nth i order-by-list) 'qualifier) - (setf (slot-value (nth i order-by-list) 'qualifier) table-name))) + (handler-case + (unless (slot-value (nth i order-by-list) 'qualifier) + (setf (slot-value (nth i order-by-list) 'qualifier) table-name)) + (simple-error ()))) (cons - (unless (slot-value (car (nth i order-by-list)) 'qualifier) - (setf (slot-value (car (nth i order-by-list)) 'qualifier) table-name))))) + (handler-case + (unless (slot-value (car (nth i order-by-list)) 'qualifier) + (setf (slot-value (car (nth i order-by-list)) 'qualifier) table-name)) + (simple-error ()))) + (clsql-sys:sql-function-exp))) (setf (getf qualifier-args :order-by) order-by-list))) (cond