Changeset combined,2.1.6
- Timestamp:
- 11/28/2007 03:53:07 AM (19 years ago)
- branch-nick:
- 64-bit
- revision id:
- dsowen@tux-20071128035307-g1o96vxy0t1sjzky
- File:
-
- 1 edited
-
combined/src/odbc/column.lisp (modified) (16 diffs)
Legend:
- Unmodified
- Added
- Removed
-
combined/src/odbc/column.lisp
r2.1.2 r2.1.6 112 112 (cffi:foreign-alloc :char :count (slot-value column 'buffer-length)))) 113 113 114 ;; dso+115 114 (defmethod get-column-value ((column string-column)) 116 115 (let ((len (cffi:mem-ref (slot-value column 'ind-ptr) 'sql-len))) … … 147 146 (cffi:foreign-alloc :uchar :count (slot-value column 'buffer-length)))) 148 147 149 ;; dso+150 148 (defmethod get-column-value ((column unicode-string-column)) 151 149 (let ((len (cffi:mem-ref (slot-value column 'ind-ptr) 'sql-len))) … … 174 172 175 173 176 ;; dso+177 174 (defmethod get-column-value ((column integer-column)) 178 175 (let ((len (cffi:mem-ref (slot-value column 'ind-ptr) 'sql-len))) … … 188 185 (defclass double-column (column) ()) 189 186 190 ;; dso+191 187 (defmethod initialize-column ((column double-column) args) 192 188 (declare (ignore args)) … … 196 192 (setf (slot-value column 'value-ptr) (cffi:foreign-alloc :double))) 197 193 198 ;; dso+199 194 (defmethod get-column-value ((column double-column)) 200 195 ;; (%get-long (slot-value column 'ind-ptr)) … … 211 206 (defclass date-column (column) ()) 212 207 213 ;; dso+214 208 (defmethod initialize-column ((column date-column) args) 215 209 (declare (ignore args)) … … 219 213 (setf (slot-value column 'value-ptr) (cffi:foreign-alloc :uchar :count 32))) 220 214 221 ;; dso+222 215 (defmethod get-column-value ((column date-column)) 223 216 (let ((len (cffi:mem-ref (slot-value column 'ind-ptr) 'sql-len))) … … 248 241 249 242 (defmethod get-column-value ((column binary-column)) 250 (let ((len (cffi:mem-ref (slot-value column 'ind-ptr) :long)))243 (let ((len (cffi:mem-ref (slot-value column 'ind-ptr) 'sql-len))) 251 244 (if (= len $SQL_NULL_DATA) 252 245 nil … … 258 251 (defclass bigint-column (column) ()) 259 252 260 ;; dso+261 253 (defmethod initialize-column ((column bigint-column) args) 262 254 (declare (ignore args)) … … 267 259 (setf (slot-value column 'value-ptr) (cffi:foreign-alloc :uchar :count 25))) 268 260 269 ;; dso+270 261 (defmethod get-column-value ((column bigint-column)) 271 262 (let ((len (cffi:mem-ref (slot-value column 'ind-ptr) 'sql-len))) … … 322 313 323 314 (defmethod get-column-value ((column decimal-column)) 324 (let ((len (cffi:mem-ref (slot-value column 'ind-ptr) :long)))315 (let ((len (cffi:mem-ref (slot-value column 'ind-ptr) 'sql-len))) 325 316 (if (= len $SQL_NULL_DATA) 326 nil327 (let ((bytes (get-byte-vector (slot-value column 'value-ptr) len))328 (sum 0))329 (dotimes (i 16)330 (setf sum (+ (* 256 sum) (aref bytes (- (+ 3 16) 1 i)))))331 (*332 sum333 (if (zerop (aref bytes 2)) -1 1) ;sign334 (expt 10 (- (aref bytes 1))))))))317 nil 318 (let ((bytes (get-byte-vector (slot-value column 'value-ptr) len)) 319 (sum 0)) 320 (dotimes (i 16) 321 (setf sum (+ (* 256 sum) (aref bytes (- (+ 3 16) 1 i))))) 322 (* 323 sum 324 (if (zerop (aref bytes 2)) -1 1) ;sign 325 (expt 10 (- (aref bytes 1)))))))) 335 326 336 327 … … 350 341 (let* ((value-ptr (cffi:foreign-alloc :char 351 342 :count (slot-value column 'buffer-length))) 352 (ind-ptr (cffi:foreign-alloc :long)))343 (ind-ptr (cffi:foreign-alloc 'sql-len))) 353 344 (unwind-protect 354 345 (get-character-data … … 374 365 (defmethod get-column-value ((column uclob-column)) 375 366 (let* ((value-ptr (cffi:foreign-alloc :char :count (slot-value column 'buffer-length))) 376 (ind-ptr (cffi:foreign-alloc :long)))367 (ind-ptr (cffi:foreign-alloc 'sql-len))) 377 368 (unwind-protect 378 369 (get-unicode-character-data … … 398 389 (defmethod get-column-value ((column blob-column)) 399 390 (let* ((value-ptr (cffi:foreign-alloc :uchar :count (slot-value column 'buffer-length))) 400 (ind-ptr (cffi:foreign-alloc :long)))391 (ind-ptr (cffi:foreign-alloc 'sql-len))) 401 392 (unwind-protect 402 393 (get-binary-data … … 412 403 ;; fetch data via SQlGetData 413 404 ;; ------------------------------ 414 ;; dso+415 405 (defun get-character-data (hstmt position value-ptr buffer-length ind-ptr) 416 406 ;; local error handling, we can not use the general error handling … … 530 520 (get-output-stream-string sos)))))))) 531 521 532 ;; dso+533 522 (defun get-binary-data (hstmt position value-ptr buffer-length ind-ptr) 534 523 ;; local error handling, we can not use the general error handling
Note: See TracChangeset
for help on using the changeset viewer.
