X-Git-Url: http://git.kpe.io/?p=clsql.git;a=blobdiff_plain;f=sql%2Futils.lisp;h=d0402e8954a7fb7b85a96f77887a5f0ad62cdd08;hp=a23a820ff0231b108c92c526da089ab1e4743c01;hb=e75e62c7127f074ef2b2add3d2850c42dfaf590e;hpb=3ac9e8d4881eebebe5cfbbf786d5268997046519 diff --git a/sql/utils.lisp b/sql/utils.lisp index a23a820..d0402e8 100644 --- a/sql/utils.lisp +++ b/sql/utils.lisp @@ -21,7 +21,7 @@ (defun number-to-sql-string (num) (etypecase num (integer - num) + (princ-to-string num)) (rational (float-to-sql-string (coerce num 'double-float))) (number @@ -52,25 +52,18 @@ (defun sql-escape (identifier) "Change hyphens to underscores, ensure string" - (let* ((unescaped (etypecase identifier - (symbol (symbol-name identifier)) - (string identifier))) - (escaped (make-string (length unescaped)))) - (dotimes (i (length unescaped)) - (setf (char escaped i) - (cond ((equal (char unescaped i) #\-) - #\_) - ;; ... - (t - (char unescaped i))))) - escaped)) + (let ((unescaped (etypecase identifier + (symbol (symbol-name identifier)) + (string identifier)))) + (substitute #\_ #\- unescaped))) (defmacro without-interrupts (&body body) - #+lispworks `(mp:without-preemption ,@body) #+allegro `(mp:without-scheduling ,@body) + #+clisp `(progn ,@body) #+cmu `(system:without-interrupts ,@body) - #+sbcl `(sb-sys::without-interrupts ,@body) - #+openmcl `(ccl:without-interrupts ,@body)) + #+lispworks `(mp:without-preemption ,@body) + #+openmcl `(ccl:without-interrupts ,@body) + #+sbcl `(sb-sys::without-interrupts ,@body)) (defun make-process-lock (name) #+allegro (mp:make-process-lock :name name)