X-Git-Url: http://git.kpe.io/?a=blobdiff_plain;f=base%2Futils.cl;fp=base%2Futils.cl;h=1a34f78513a2c039b121b362e5a45ec15e2b2e3e;hb=57611810fb1cbfed971acd450000d8cac0d177b8;hp=93d5ecec303fb552394ccc67d1f0100aa8231680;hpb=a32b6934444ec02090e175c6e0ad6d84dfeb98c8;p=clsql.git diff --git a/base/utils.cl b/base/utils.cl index 93d5ece..1a34f78 100644 --- a/base/utils.cl +++ b/base/utils.cl @@ -7,7 +7,7 @@ ;;;; Programmer: Kevin M. Rosenberg ;;;; Date Started: Mar 2002 ;;;; -;;;; $Id: utils.cl,v 1.6 2002/09/17 17:16:43 kevin Exp $ +;;;; $Id: utils.cl,v 1.7 2002/09/30 01:57:32 kevin Exp $ ;;;; ;;;; This file, part of CLSQL, is Copyright (c) 2002 by Kevin M. Rosenberg ;;;; @@ -30,9 +30,22 @@ (defun float-to-sql-string (num) "Convert exponent character for SQL" - (substitute #\e #\f (substitute #\e #\d (write-to-string num :readably t)))) + (let ((str (write-to-string num :readably t))) + (cond + ((find #\f str) + (substitute #\e #\f str)) + ((find #\d str) + (substitute #\e #\d str)) + ((find #\F str) + (substitute #\e #\F str)) + ((find #\D str) + (substitute #\e #\D str)) + ((find #\S str) + (substitute #\e #\S str)) + (t + str)))) -(defun sql-escape (identifier) + (defun sql-escape (identifier) "Change hyphens to underscores, ensure string" (let* ((unescaped (etypecase identifier (symbol (symbol-name identifier))