Attempt to set a proper FreeTDS buffer size.

Let's see what happens in the tests with that before cleaning up the API
a little here, and maybe getting rid of the hardcoded "25000" rows.
This commit is contained in:
Dimitri Fontaine 2014-12-22 19:25:24 +01:00
parent f323625738
commit f048e36838

View File

@ -99,11 +99,20 @@
(otherwise (error "not supported type ~A"
(foreign-enum-keyword '%syb-value-type type))))))
(defconstant +dbbuffer+ 14)
(define-sybdb-function ("dbsetopt" %dbsetopt) %RETCODE
(dbproc %DBPROCESS)
(option :int)
(char-param :pointer)
(int-param :int))
(defun map-query-results (query &key row-fn (connection *database*))
"Map the query results through the map-fn function."
(let ((%dbproc (slot-value connection 'dbproc))
(cffi:*default-foreign-encoding* (slot-value connection 'external-format)))
(with-foreign-string (%nrows "25000")
(%dbsetopt %dbproc +dbbuffer+ %nrows 0))
(with-foreign-string (%query query)
(%dbcmd %dbproc %query))
(%dbsqlexec %dbproc)