diff --git a/CHANGELOG.md b/CHANGELOG.md index 7a6a625..a940658 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,10 @@ -# Changelog v. 1.33.5 +# Changelog 1.33.6 +Postmodern/cl-postgres now returns an empty array if Postgresql returns an empty array. + +The previous behavior had been to return nil, but I have been convinced by a user to make this +change. + +# Changelog 1.33.5 Discontinue support for versions of sbcl < 1.2.5 which were compiled without support for bsd-sockets. Drop unwarrented assumption that the role 'postgres' will always exist when dropping a role resulting in ownership changes of postgresql objects. @@ -7,19 +13,19 @@ Add more documentation on the limitation in s-sql on using lists in a parameteri Add additional support for ssl connections to allow use of a root certificate for validation. Set \*ssl-root-ca-file* to the pathname for the root certificate. -# Changelog v. 1.33.4 +# Changelog 1.33.4 Fix bug in a warning in execute-file that referred to the current package rather than Postmodern. Added retry-transaction restart in the call-with-transaction function -# Changelog v. 1.33.2 +# Changelog 1.33.2 Fix bug in export functions when user tries to export nil into a database Fix bug in import functions when functions are called but the current package has changed. Note to self. Pay attention to needs for fully qualified symbols (including package names) and how to test them for equality. -# Changelog v. 1.33.1 +# Changelog 1.33.1 Dao Export and Import Functions (Postmodern v. 1.33.1 and newer) There may be times when the types of values in a dao slot do not have comparable types in Postgresql. For purposes of the following example, assume you have slots that you want to contain lists. Postgresql does not have a "list" data type. Postgresql arrays must be homogeneous but CL lists do not have that limitation. What to do? diff --git a/cl-postgres.asd b/cl-postgres.asd index 568602e..9b48a3f 100644 --- a/cl-postgres.asd +++ b/cl-postgres.asd @@ -16,7 +16,7 @@ :author "Marijn Haverbeke " :maintainer "Sabra Crolleton " :license "zlib" - :version "1.33.5" + :version "1.33.6" :depends-on ("md5" "split-sequence" "ironclad" "cl-base64" "uax-15" (:feature (:or :allegro :ccl :clisp :genera :armedbear :cmucl :lispworks) diff --git a/cl-postgres/interpret.lisp b/cl-postgres/interpret.lisp index b23c9ec..e77432b 100644 --- a/cl-postgres/interpret.lisp +++ b/cl-postgres/interpret.lisp @@ -220,9 +220,9 @@ executing body so that row values will be returned as t." (element-type (read-uint4 stream))) (cond ((zerop num-dims) - ;; Should we return nil or a (make-array nil) when num-dims is - ;; 0? Returning nil for now. - nil) + ;; Should we return nil or a (make-array 0) when num-dims is + ;; 0? Based on feedback we will go with making an array of size 0 + (make-array 0)) (t (let* ((array-dims (loop for i below num-dims diff --git a/cl-postgres/tests/test-binary-parameters.lisp b/cl-postgres/tests/test-binary-parameters.lisp index 279f1eb..2b0f7de 100644 --- a/cl-postgres/tests/test-binary-parameters.lisp +++ b/cl-postgres/tests/test-binary-parameters.lisp @@ -662,7 +662,7 @@ unless it would have been valid as a text parameter." (with-binary-test-connection (cl-postgres::with-binary-row-values (is (equalp (exec-query connection "select row((ARRAY[1,3,4])[5:99])" 'list-row-reader) - '(((NIL)))))))) + '(((#())))))))) (test binary-row-array-nulls-binary-2 (with-binary-test-connection @@ -687,7 +687,7 @@ unless it would have been valid as a text parameter." connection "select row(a[2:45]) from test" 'list-row-reader) - '(((#2A((0 0)))) ((NIL)) ((#2A((2 2)))) ((NIL)) ((NIL)))))))))) + '(((#2A((0 0)))) ((#())) ((#2A((2 2)))) ((#())) ((#())))))))))) (test binary-array-row-text (with-binary-test-connection diff --git a/cl-postgres/tests/tests.lisp b/cl-postgres/tests/tests.lisp index d45b426..1d605ca 100644 --- a/cl-postgres/tests/tests.lisp +++ b/cl-postgres/tests/tests.lisp @@ -767,7 +767,7 @@ variables:~:{~% ~A: ~(~A~), ~:[defaults to \"~A\"~;~:*provided \"~A\"~]~}~%" (with-test-connection (cl-postgres::with-binary-row-values (is (equalp (exec-query connection "select row((ARRAY[1,3,4])[5:99])" 'list-row-reader) - '(((NIL)))))))) + '(((#())))))))) (test row-array-nulls-binary-2 (with-test-connection @@ -792,7 +792,7 @@ variables:~:{~% ~A: ~(~A~), ~:[defaults to \"~A\"~;~:*provided \"~A\"~]~}~%" connection "select row(a[2:45]) from test" 'list-row-reader) - '(((#2A((0 0)))) ((NIL)) ((#2A((2 2)))) ((NIL)) ((NIL)))))))))) + '(((#2A((0 0)))) ((#())) ((#2A((2 2)))) ((#())) ((#())))))))))) (test array-row-text (with-test-connection diff --git a/doc/array-notes.html b/doc/array-notes.html index e77309b..aa9aba1 100644 --- a/doc/array-notes.html +++ b/doc/array-notes.html @@ -1,14 +1,14 @@ - - - + + + S-SQL and Postgresql Arrays - - - - -
+

S-SQL and Postgresql Arrays

-