X-Git-Url: http://git.kpe.io/?p=clsql.git;a=blobdiff_plain;f=base%2Futils.lisp;h=f123b4feccc885f0ab0ebc2e41b2a2ba01c480b4;hp=5514dc72ed9b5757ba0128e20ae22fcde37f5e95;hb=ce0e343835a040406678dff74a62d1b0cb56f317;hpb=998937376fa6f9ce29bd3c7954fb0ebca91c37d7 diff --git a/base/utils.lisp b/base/utils.lisp index 5514dc7..f123b4f 100644 --- a/base/utils.lisp +++ b/base/utils.lisp @@ -2,22 +2,21 @@ ;;;; ************************************************************************* ;;;; FILE IDENTIFICATION ;;;; -;;;; Name: utils.cl +;;;; Name: utils.lisp ;;;; Purpose: SQL utility functions ;;;; Programmer: Kevin M. Rosenberg ;;;; Date Started: Mar 2002 ;;;; -;;;; $Id: utils.lisp,v 1.1 2002/09/30 10:19:01 kevin Exp $ +;;;; $Id$ ;;;; -;;;; This file, part of CLSQL, is Copyright (c) 2002 by Kevin M. Rosenberg +;;;; This file, part of CLSQL, is Copyright (c) 2002-2004 by Kevin M. Rosenberg ;;;; ;;;; CLSQL users are granted the rights to distribute and use this software ;;;; as governed by the terms of the Lisp Lesser GNU Public License ;;;; (http://opensource.franz.com/preamble.html), also known as the LLGPL. ;;;; ************************************************************************* -(declaim (optimize (debug 3) (speed 3) (safety 1) (compilation-speed 0))) -(in-package :clsql-base-sys) +(in-package #:clsql-base-sys) (defun number-to-sql-string (num) (etypecase num @@ -36,16 +35,22 @@ (substitute #\e #\f str)) ((find #\d str) (substitute #\e #\d str)) + ((find #\l str) + (substitute #\e #\l str)) + ((find #\s str) + (substitute #\e #\S str)) ((find #\F str) (substitute #\e #\F str)) ((find #\D str) (substitute #\e #\D str)) + ((find #\L str) + (substitute #\e #\L 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))