Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Add tests for fixed-length strings (ie, CHAR(n)) and a link to a disc…

…ussion of the freetds issue with empty strings in 0.82
  • Loading branch information...
commit 0508f187ffaf38706dd2ea4f43d2c8d55e6f1488 1 parent 9217519
Peter Bex authored
Showing with 10 additions and 2 deletions.
  1. +10 −2 tests/run.scm
View
12 tests/run.scm
@@ -91,9 +91,16 @@
(result-values (send-query connection "SELECT 13, 14, 15")))))
(test-group "type parsing"
- (test "String values are retrieved correctly"
+ (test "Variable-length string values are retrieved correctly"
'(("one" "testing" ""))
(result-values (send-query connection "SELECT 'one', 'testing', ''")))
+ (test "Fixed-length string values are retrieved correctly"
+ '(("one" "testing" " "))
+ (result-values (send-query connection
+ (conc "SELECT CAST('one' AS CHAR(3)),"
+ " CAST('testing' AS CHAR(7)),"
+ ;; CHAR(0) is not allowed...
+ " CAST(' ' AS CHAR(1))"))))
(test "Integer values are retrieved correctly"
'((0 -1 110))
(result-values (send-query connection "SELECT 0, -1, 110")))
@@ -148,7 +155,8 @@
(result-values (send-query connection "SELECT NULL, NULL"))))
(test-group "type unparsing"
- (test "String values are written correctly"
+ ;; See http://lists.ibiblio.org/pipermail/freetds/2009q2/024682.html
+ (test "String values are written correctly (broken in FreeTDS <= 0.82)"
'(("one" "testing" ""))
(result-values
(send-query connection "SELECT ?, ?, ?" "one" "testing" "")))
Please sign in to comment.
Something went wrong with that request. Please try again.