X-Git-Url: http://git.kpe.io/?p=clsql.git;a=blobdiff_plain;f=sql%2Fsyntax.lisp;h=6d771da016dad928c3db849a92f7f637e60f4c84;hp=bf3ce15484487696cd7e8fb1d6e4b5da5aa4fab1;hb=155c60b5195d618ef93541699694d57a21be3246;hpb=73cf858d596ad1d51c745b478292433617cf9d72 diff --git a/sql/syntax.lisp b/sql/syntax.lisp index bf3ce15..6d771da 100644 --- a/sql/syntax.lisp +++ b/sql/syntax.lisp @@ -14,7 +14,6 @@ ;;;; (http://opensource.franz.com/preamble.html), also known as the LLGPL. ;;;; ************************************************************************* - (in-package #:clsql-sys) (defvar *original-reader-enter* nil) @@ -85,9 +84,13 @@ syntax is disabled." (defun sql-reader-open (stream char) (declare (ignore char)) (let ((sqllist (read-delimited-list #\] stream t))) - (if (sql-operator (car sqllist)) - (cons (sql-operator (car sqllist)) (cdr sqllist)) - (apply #'generate-sql-reference sqllist)))) + (cond ((string= (write-to-string (car sqllist)) "||") + (cons (sql-operator 'concat) (cdr sqllist))) + ((and (= (length sqllist) 1) (eql (car sqllist) '*)) + (apply #'generate-sql-reference sqllist)) + ((sql-operator (car sqllist)) + (cons (sql-operator (car sqllist)) (cdr sqllist))) + (t (apply #'generate-sql-reference sqllist))))) ;; Internal function that disables the close syntax when leaving sql context. (defun disable-sql-close-syntax () @@ -158,7 +161,7 @@ attribute and type." for the operator." (typecase operation (string nil) - (symbol (gethash (string-upcase (symbol-name operation)) + (symbol (gethash (symbol-name-default-case (symbol-name operation)) *sql-op-table*)))) (defun sql-operation (operation &rest rest)