Changeset unicode,7
- Timestamp:
- 02/20/2008 05:30:35 AM (18 years ago)
- branch-nick:
- unicode
- parents:
Rev Tree Chgset 6 @unicode,6 [unicode,6] 5.1.1 @unicode,5.1.1 [unicode,5.1.1] - revision id:
- dsowen@fugue88.ws-20080220053035-zvmt9xh4jzwaqj2i
- Location:
- unicode
- Files:
-
- 8 edited
-
doc/documentation.html (modified) (1 diff)
-
doc/notes.html (modified) (1 diff)
-
src/odbc/odbc-ff-interface.lisp (modified) (1 diff)
-
src/odbc/odbc-main.lisp (modified) (2 diffs)
-
src/odbc/parameter.lisp (modified) (6 diffs)
-
src/test/test-mysql.lisp (modified) (2 diffs)
-
src/test/test-oracle.lisp (modified) (1 diff)
-
src/test/test-sql-server.lisp (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
unicode/doc/documentation.html
r5 r5.1.1 16 16 <p> 17 17 For Information about ODBC-API, I recommend the 18 <a href="http://msdn .microsoft.com/library/default.asp?url=/library/en-us/odbc/htm/dasdkodbcoverview.asp">18 <a href="http://msdn2.microsoft.com/en-us/library/ms710252(VS.85).aspx"> 19 19 ODBC documentation from Microsoft</a>. 20 20 </p> -
unicode/doc/notes.html
r5 r5.1.1 281 281 The decimal expansion of 1/7 is periodic, so the digits 0.285 are correct. Thus 282 282 MySQL uses the precision of double, but does not return all digits. 283 283 <p> 284 285 <h3>The SQL Parser</h3> 286 The <tt>/* ..*/</tt> comments do not have to be closed: 287 <pre> 288 19]> (exec-query *con3* "select 1 as a /*bla") 289 290 ((1)) ; 291 ("a") 292 </pre> 293 Maybe this depends on the version of MySQL or some system parameter. 294 </p> 284 295 <h3>Parameters</h3> 285 296 <p> -
unicode/src/odbc/odbc-ff-interface.lisp
r3 r5.1.1 313 313 year))) 314 314 315 316 (defmacro %sql-len-data-at-exec (length) 317 `(- $SQL_LEN_DATA_AT_EXEC_OFFSET ,length)) 315 (defun %sql-len-data-at-exec (length) 316 (- $SQL_LEN_DATA_AT_EXEC_OFFSET length)) -
unicode/src/odbc/odbc-main.lisp
r5 r5.1.1 467 467 ;; this functions works only, since we store at value-ptr the position 468 468 ;; of the parameter 469 ;; dso--470 469 (defun sql-param-data-position (hstmt) 471 470 (with-temporary-allocations … … 474 473 (%sql-param-data hstmt ptr)))) 475 474 (values res (if (= res $SQL_NEED_DATA) 476 (cffi:mem-ref (cffi:mem-ref ptr :pointer) : int32))))))477 ; TODO: The :int32 above 478 ; should probably be changed! 475 (cffi:mem-ref (cffi:mem-ref ptr :pointer) :long)))))) 476 477 479 478 480 479 (defmethod exec-prepared-query ((query prepared-statement) &rest parameters) -
unicode/src/odbc/parameter.lisp
r3 r5.1.1 305 305 306 306 307 308 ;;; LOB parameters 309 ;;; lob parameters are handled differently, the buffer is not filled with the 310 ;;; parameters value but we send data at execution time. 311 ;;; This is done with the call: 312 ;;; (setf (cffi:mem-ref (slot-value param 'ind-ptr) 'sql-len) 313 ;;; (%sql-len-data-at-exec (length value)))))) 314 ;;; At execution time the result of %sql-execute or %sql-exec-direct 315 ;;; is $SQL_NEED_DATA. 316 ;;; The next call to %sql-param-data gives the address of the data buffer 317 ;;; of the needed bind parameter. 318 ;;; For the LOB parameters we store in this buffer the position of the 319 ;;; bind parameter. At execution time we get the buffer address of the 320 ;;; bind parameter. From this buffer we retrieve the parameter position 321 ;;; and so we know which parameter to send. 322 ;;; see functions exec-sql-statement and sql-param-data-position 323 ;;; in odbc-main.lisp 324 ;;; there is also the Microsoft documentation on SQLPutData, SQLParamData, 325 ;;; SQL_NEED_DATA and etc. 326 307 327 ;;;----------------------- 308 328 ;;; clob parameter … … 315 335 316 336 (defclass clob-parameter (lob-parameter) ()) 317 318 337 319 338 (defmethod initialize-parameter ((param clob-parameter) args) … … 325 344 ;; the value-ptr will be needed to find the parameter, 326 345 ;; we store the position there 327 (setf buffer-length (cffi:foreign-type-size 'sql-pointer))328 (setf value-ptr (cffi:foreign-alloc 'sql-pointer))))346 (setf buffer-length (cffi:foreign-type-size :long)) 347 (setf value-ptr (cffi:foreign-alloc :long)))) 329 348 330 349 (defmethod set-parameter-value ((param clob-parameter) value) … … 375 394 ;; the value-ptr will be needed to find the parameter, 376 395 ;; we store the position there 377 (setf buffer-length (cffi:foreign-type-size 'sql-pointer))378 (setf value-ptr (cffi:foreign-alloc ' sql-pointer))))396 (setf buffer-length (cffi:foreign-type-size :long)) 397 (setf value-ptr (cffi:foreign-alloc ':long)))) 379 398 380 399 (defmethod set-parameter-value ((param uclob-parameter) value) … … 384 403 (progn 385 404 (setf (slot-value param 'temp-val) value) 386 (setf (cffi:mem-ref (slot-value param 'value-ptr) ':long)405 (setf (cffi:mem-ref (slot-value param 'value-ptr) :long) 387 406 (slot-value param 'position)) 388 407 (setf (cffi:mem-ref (slot-value param 'ind-ptr) 'sql-len) … … 424 443 ;; the value-ptr will be needed to find the parameter, 425 444 ;; we store the position there 426 (setf buffer-length (cffi:foreign-type-size 'sql-pointer))427 (setf value-ptr (cffi:foreign-alloc 'sql-pointer)))445 (setf buffer-length (cffi:foreign-type-size :long)) 446 (setf value-ptr (cffi:foreign-alloc :long))) 428 447 ) 429 448 -
unicode/src/test/test-mysql.lisp
r5 r5.1.1 40 40 41 41 create table type_test 42 (id int,42 (id int, 43 43 t_TINYINT TINYINT, 44 44 t_SMALLINT SMALLINT, … … 99 99 --t_LONGBLOB longblob, 100 100 --t_LONGTEXT = lpad('a',33000,'x') 101 */ 101 102 where id =1 102 103 ") -
unicode/src/test/test-oracle.lisp
r6 r7 144 144 '(:string :in) 145 145 '(:string :out)))) 146 (let ((str "l ölkÀlkÀölkÀlhjajhgfsjgakjhgfjfjhgffdtrtreztr"))146 (let ((str "lolkalkxylkzlhjajhgfsjgakjhgfjfjhgffdtrtreztr")) 147 147 (assert (equal str (first (exec-prepared-command stm str)))) 148 148 (free-statement stm))) -
unicode/src/test/test-sql-server.lisp
r6 r7 245 245 '(:string :in) 246 246 '(:unicode-string :in)) 247 (let* ((strings '("hjgkhgkzt65646&%2" "nnvfdsfsfz6tzt Ã0#="))247 (let* ((strings '("hjgkhgkzt65646&%2" "nnvfdsfsfz6tztB0#=")) 248 248 (res (exec-prepared-query stm (first strings) (second strings)))) 249 249 (assert (equal res (list strings))))))
Note: See TracChangeset
for help on using the changeset viewer.
