From: Kevin M. Rosenberg Date: Sun, 23 May 2004 13:43:07 +0000 (+0000) Subject: r9452: * sql/sql.lisp: Honor case of string table identifier to INSERT-RECORDS X-Git-Tag: v3.8.6~395 X-Git-Url: http://git.kpe.io/?p=clsql.git;a=commitdiff_plain;h=4d46d4d631cad1c4fe3accbe99f4182d975fd678 r9452: * sql/sql.lisp: Honor case of string table identifier to INSERT-RECORDS * test/test-fddl.lisp: Add two tests for mixed case names --- diff --git a/ChangeLog b/ChangeLog index fce7ca4..5bf5a4f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -2,6 +2,8 @@ * sql/kmr-mop.lisp, sql/objects.lisp: Since SBCL is the only implementation that has reversed class slots, change the default for ordered-class-slots so that slots are now in the same order an in the def-view-class. + * sql/sql.lisp: Honor case of string table identifier to INSERT-RECORDS + * test/test-fddl.lisp: Add two tests for mixed case names 22 May 2004 Kevin Rosenberg * Version 2.10.21 released diff --git a/TODO b/TODO index 2daf98a..53afb2f 100644 --- a/TODO +++ b/TODO @@ -11,7 +11,6 @@ TESTS TO ADD * owner phrases for postgresql and oracle backends * test of large table with large numbers of rows, greater than 2x the number of rows (200) returned by the oracle backend at a time -* test mixed case table identifiers and column identifiers COMMONSQL INCOMPATIBILITY diff --git a/sql/classes.lisp b/sql/classes.lisp index 6848621..80d735c 100644 --- a/sql/classes.lisp +++ b/sql/classes.lisp @@ -661,7 +661,11 @@ uninclusive, and the args from that keyword to the end." (with-slots (into attributes values query) ins (write-string "INSERT INTO " *sql-stream*) - (output-sql into database) + (output-sql + (typecase into + (string (sql-expression :attribute into)) + (t into)) + database) (when attributes (write-char #\Space *sql-stream*) (output-sql attributes database)) diff --git a/tests/test-fddl.lisp b/tests/test-fddl.lisp index 7623b4b..301c37c 100644 --- a/tests/test-fddl.lisp +++ b/tests/test-fddl.lisp @@ -59,6 +59,27 @@ (clsql:drop-table [foo] :if-does-not-exist :ignore)))) "comments" "height" "id" "name") +(deftest :fddl/table/4 + (values + (clsql:table-exists-p "MyMixedCase") + (progn + (clsql:create-table "MyMixedCase" '(([a] integer))) + (clsql:table-exists-p "MyMixedCase")) + (progn + (clsql:drop-table "MyMixedCase") + (clsql:table-exists-p "MyMixedCase"))) + nil t nil) + +(deftest :fddl/table/5 + (prog1 + (progn + (clsql:create-table "MyMixedCase" '(([a] integer))) + (clsql:execute-command "insert into MyMixedCase values (5)") + (clsql:insert-records :into "MyMixedCase" :values '(6)) + (clsql:select [a] :from "MyMixedCase" :order-by '((a :asc)))) + (clsql:drop-table "MyMixedCase")) + ((5) (6))) + (deftest :fddl/attributes/1 (apply #'values (sort