anchor.diff:      (mapcar
        (lambda (f) (truncate (read-from-string f)))
        (clsql:select [coalesce [managerid] 10] :from [employee] :order-by [emplid]
  -                   :field-names nil :result-types nil :flatp t))
  +		   :field-names nil :result-types nil :flatp t))
     (10 1 1 1 1 1 1 1 1 1))
   
   (deftest :fdml/select/28
       (mapcar
        (lambda (f) (truncate (read-from-string (car f))))
        (loop for column in `([*] [emplid]) collect
  -           (clsql:select [count column] :from [employee]
  -                         :flatp t :result-types nil :field-names nil)))
  +	   (clsql:select [count column] :from [employee]
  +			 :flatp t :result-types nil :field-names nil)))
    (10 10))
   
   (deftest :fdml/select/29
    (clsql:select [first-name] [last-name] :from [employee]
  -                       :result-types nil :field-names nil
  -                       :order-by '(([first-name] :asc) ([last-name] :desc)))
  +		       :result-types nil :field-names nil
  +		       :order-by '(([first-name] :asc) ([last-name] :desc)))
    (("Boris" "Yeltsin") ("Josef" "Stalin") ("Konstantin" "Chernenko")
     ("Leon" "Trotsky") ("Leonid" "Brezhnev") ("Mikhail" "Gorbachev")
     ("Nikita" "Kruschev") ("Vladimir" "Putin") ("Vladimir" "Lenin")
  
positive.code: 
  (deftest :fdml/select/37
      (clsql:select [emplid] :from [employee]
                    :order-by [emplid]
                    :limit 5
                    :field-names nil
                    :flatp t)
    (1 2 3 4 5))
  
  (deftest :fdml/select/38
      (clsql:select [emplid] :from [employee]
                    :order-by [emplid]
                    :limit 5
                    :offset 3
                    :field-names nil
                    :flatp t)
    (4 5 6 7 8))
  
  (deftest :fdml/do-query/1
      (let ((result '()))
      (clsql:do-query ((name) [select [last-name] :from [employee]
                                     :order-by [last-name]])
        (push name result))
      result)
   ("Yeltsin" "Trotsky" "Stalin" "Putin" "Lenin" "Kruschev" "Gorbachev"
              "Chernenko" "Brezhnev" "Andropov"))
  
  (deftest :fdml/map-query/1
      (clsql:map-query 'list #'identity
                      [select [last-name] :from [employee] :flatp t
                              :order-by [last-name]])
    ("Andropov" "Brezhnev" "Chernenko" "Gorbachev" "Kruschev" "Lenin" "Putin"
                "Stalin" "Trotsky" "Yeltsin"))
  
  (deftest :fdml/map-query/2
      (clsql:map-query 'vector #'identity
                      [select [last-name] :from [employee] :flatp t
                              :order-by [last-name]])
    #("Andropov" "Brezhnev" "Chernenko" "Gorbachev" "Kruschev" "Lenin" "Putin"
      "Stalin" "Trotsky" "Yeltsin"))
  
  (deftest :fdml/map-query/3
   (clsql:map-query 'list #'identity
                    [select [last-name] :from [employee] :order-by [last-name]])
   (("Andropov") ("Brezhnev") ("Chernenko") ("Gorbachev") ("Kruschev") ("Lenin")
    ("Putin") ("Stalin") ("Trotsky") ("Yeltsin")))
  
  (deftest :fdml/map-query/4
   (clsql:map-query 'list #'identity
                    [select [first-name] [last-name] :from [employee]
                            :order-by [last-name]])
   (("Yuri" "Andropov") ("Leonid" "Brezhnev") ("Konstantin" "Chernenko")
    ("Mikhail" "Gorbachev") ("Nikita" "Kruschev") ("Vladimir" "Lenin")
    ("Vladimir" "Putin") ("Josef" "Stalin") ("Leon" "Trotsky")
  
negative.code: ;; these guys!)
  (deftest :fdml/select/1
      (let ((max (clsql:select [function "floor"
  			     [/ [* [max [height]] 100] 2.54]]
  			     :from [employee]
  			     :result-types nil
  			     :flatp t))
  	  (min (clsql:select [function "floor"
  			     [/ [* [min [height]] 100] 2.54]]
  			     :from [employee]
  			     :result-types nil
  			     :flatp t))
  	  (avg (clsql:select [function "floor"
  			     [avg [/ [* [height] 100] 2.54]]]
  			     :from [employee]
  			     :result-types nil
  			     :flatp t)))
        (apply #'< (mapcar #'(lambda (s) (parse-integer s :junk-allowed t))
  			 (append min avg max))))
   t)
  
  (deftest :fdml/select/2
   (clsql:select [first-name] :from [employee] :flatp t :distinct t
  			    :field-names nil
  			    :result-types nil
  			    :order-by [first-name])
   ("Boris" "Josef" "Konstantin" "Leon" "Leonid" "Mikhail" "Nikita" "Vladimir"
    "Yuri"))
  
  (deftest :fdml/select/3
      (let ((res (clsql:select [first-name] [count [*]] :from [employee]
  			     :result-types nil
  			     :group-by [first-name]
  			     :order-by [first-name]
  			     :field-names nil)))
        (mapcar (lambda (p) (list (car p) (truncate (read-from-string (second p)))))
  	      res))
    (("Boris" 1) ("Josef" 1) ("Konstantin" 1) ("Leon" 1) ("Leonid" 1)
     ("Mikhail" 1) ("Nikita" 1) ("Vladimir" 2) ("Yuri" 1)))
  
  (deftest :fdml/select/4
      (clsql:select [last-name] :from [employee]
  			  :where [like [email] "%org"]
  			  :order-by [last-name]
  			  :field-names nil
  			  :result-types nil
  			  :flatp t)
   ("Andropov" "Brezhnev" "Chernenko" "Gorbachev" "Kruschev" "Lenin" "Putin"
    "Stalin" "Trotsky" "Yeltsin"))
  
  (deftest :fdml/select/5
      (clsql:select [email] :from [employee] :flatp t :result-types nil
  			  :where [in [employee emplid]
  			  [select [managerid] :from [employee]]]
  			  :field-names nil)
    ("lenin@soviet.org"))
  
  (deftest :fdml/select/6
      (if (clsql-sys:db-type-has-fancy-math? *test-database-underlying-type*)
  	(mapcar #'(lambda (s) (parse-integer s :junk-allowed t))
  		(clsql:select [function "trunc" [height]] :from [employee]
  			      :result-types nil
  			      :field-names nil
  			      :flatp t))
  	(mapcar #'(lambda (s) (truncate (parse-integer s :junk-allowed t)))
  		(clsql:select [height] :from [employee] :flatp t
  			      :field-names nil :result-types nil)))
   (1 1 1 1 1 1 1 1 1 1))
  
  (deftest :fdml/select/7
      (let ((result (car (clsql:select [max [emplid]] :from [employee] :flatp t
  				     :field-names nil :result-types nil))))
        (values
         (stringp result)
         (nth-value 0 (truncate (read-from-string result)))))
  