Changeset 64-bit,13
- Timestamp:
- 02/04/2008 12:59:54 AM (18 years ago)
- branch-nick:
- test
- parents:
Rev Tree Chgset 12 @64-bit,12 [64-bit,12] 2.1.1 @64-bit,2.1.1 [64-bit,2.1.1] - revision id:
- dsowen@fugue88.ws-20080204005954-s1vx8hf9i7l2iqqe
- Location:
- 64-bit/src
- Files:
-
- 5 edited
-
odbc/odbc-functions.lisp (modified) (5 diffs)
-
odbc/odbc-utilities.lisp (modified) (2 diffs)
-
odbc/parameter.lisp (modified) (4 diffs)
-
test/test-mysql.lisp (modified) (2 diffs)
-
test/test-oracle.lisp (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
64-bit/src/odbc/odbc-functions.lisp
r6 r13 261 261 ; col-nr = :bookmark retrieves a bookmark. 262 262 (defun %bind-column (hstmt column-nr c-type data-ptr precision out-len-ptr) 263 (declare ( (integer 0) column-nr))263 (declare (type (integer 0) column-nr)) 264 264 (with-error-handling 265 265 (:hstmt hstmt) … … 272 272 sql-type precision scale data-ptr 273 273 max-value out-len-ptr) 274 (declare ( (integer 0) parameter-nr))274 (declare (type (integer 0) parameter-nr)) 275 275 (with-error-handling 276 276 (:hstmt hstmt) … … 499 499 ;; Column counting is 1-based 500 500 (defun %describe-column (hstmt column-nr) 501 (declare ( (integer 1) column-nr))501 (declare (type (integer 1) column-nr)) 502 502 (with-temporary-allocations 503 503 ((column-name-ptr (alloc-chars 256)) … … 593 593 ; column-nr is zero-based 594 594 (defun %sql-get-data (hstmt column-nr c-type data-ptr precision out-len-ptr) 595 (declare ( (integer 0) column-nr))595 (declare (type (integer 0) column-nr)) 596 596 (with-error-handling 597 597 (:hstmt hstmt :print-info nil) … … 600 600 601 601 (defun %sql-get-data-raw (hstmt position c-type data-ptr buffer-length ind-ptr) 602 (declare ( (integer 0) position))602 (declare (type (integer 0) position)) 603 603 (SQLGetData hstmt (1+ position) 604 604 c-type data-ptr buffer-length ind-ptr)) -
64-bit/src/odbc/odbc-utilities.lisp
r1 r2.1.1 12 12 (defvar *default-oracle-dsn* "default-oracle-dsn") 13 13 (defvar *default-sql-server-dsn* "default-sql-server-dsn") 14 (defvar *default-mysql-dsn* "default-mysql-dsn") 15 14 16 15 17 … … 42 44 ))) 43 45 46 (defun connect-mysql (server user password) 47 (connect-generic :dsn *default-mysql-dsn* 48 :server server :uid user :pwd password)) 49 50 44 51 (defun with-prepared-statement-fun (con string params fun) 45 52 (let ((stm (apply #'prepare-statement con string params))) -
64-bit/src/odbc/parameter.lisp
r7 r13 293 293 ) 294 294 (progn 295 ;; (break)296 295 (setf (cffi:mem-ref (slot-value param 'ind-ptr) 'sql-len) 297 296 (length value)) … … 426 425 ;; we store the position there 427 426 (setf buffer-length (cffi:foreign-type-size 'sql-pointer)) 428 (setf value-ptr (cffi:foreign-alloc 'sql-pointer)))) 427 (setf value-ptr (cffi:foreign-alloc 'sql-pointer))) 428 ) 429 429 430 430 (defmethod set-parameter-value ((param blob-parameter) value) … … 437 437 (slot-value param 'position)) 438 438 (setf (cffi:mem-ref (slot-value param 'ind-ptr) 'sql-len) 439 (%sql-len-data-at-exec (length value)))))) 439 (%sql-len-data-at-exec (length value))) 440 ))) 440 441 441 442 (defmethod send-parameter-data ((param blob-parameter) hstmt) … … 443 444 (len (length temp-val)) 444 445 (buffer (cffi:foreign-alloc :uchar 445 :count (if (zerop len) 1 len))))446 :count (if (zerop len) 1 len)))) 446 447 (put-byte-vector buffer 447 448 temp-val) -
64-bit/src/test/test-mysql.lisp
r1 r2.1.1 12 12 (mysql-test4 con) 13 13 (mysql-test5 con) 14 (mysql-test6 con) 14 15 ) 15 16 … … 186 187 (commit con) 187 188 ) 189 190 191 (defun mysql-drop-test-proc (con proc) 192 (unless (zerop (caar (exec-query con (format nil 193 " 194 select count(*) 195 from information_schema.routines 196 where routine_name ='~A' 197 and routine_schema='test'" proc)))) 198 (exec-command con (format nil "drop procedure ~A" proc)))) 199 200 201 (defun mysql-test6 (con) 202 (mysql-drop-test-proc con "test99") 203 (exec-command con " 204 CREATE PROCEDURE test99 (in p1 int, out p2 INT) 205 BEGIN 206 set p2=p1+5; 207 END;") 208 (commit con) 209 (pprint 210 (let ((stm (prepare-statement con "{call test.test99(?,?)}" 211 '(:integer :in) 212 '(:integer :out)))) 213 (assert (= 6 (first (exec-prepared-command stm 1)))) 214 (free-statement stm))) -
64-bit/src/test/test-oracle.lisp
r1 r2.1.1 64 64 con "update type_test set t_blob=?,t_clob=? where id =1" 65 65 '(:blob :in) '(:clob :in)))) 66 (exec-prepared-update stm 67 (make-array 10000 :element-type '(unsigned-byte 8) :initial-element 33) 68 (make-string 100001 :initial-element #\o))) 66 (exec-prepared-update 67 stm ;; sizes were 100000 and 100001 68 (make-array 100000 :element-type '(unsigned-byte 8) :initial-element 33) 69 (make-string 1000001 :initial-element #\o))) 69 70 (commit con)) 70 71
Note: See TracChangeset
for help on using the changeset viewer.
