Skip to content

Commit

Permalink
Merge pull request #312 from sabracrolleton/master
Browse files Browse the repository at this point in the history
Fixing issue 311
  • Loading branch information
sabracrolleton authored Oct 4, 2022
2 parents eed734f + ff8937c commit 8a52e13
Show file tree
Hide file tree
Showing 11 changed files with 246 additions and 244 deletions.
14 changes: 10 additions & 4 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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.
Expand All @@ -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?
Expand Down
2 changes: 1 addition & 1 deletion cl-postgres.asd
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
:author "Marijn Haverbeke <[email protected]>"
:maintainer "Sabra Crolleton <[email protected]>"
: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)
Expand Down
6 changes: 3 additions & 3 deletions cl-postgres/interpret.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions cl-postgres/tests/test-binary-parameters.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
4 changes: 2 additions & 2 deletions cl-postgres/tests/tests.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
Loading

0 comments on commit 8a52e13

Please sign in to comment.