Changeset unicode,7


Ignore:
Timestamp:
02/20/2008 05:30:35 AM (18 years ago)
Author:
David Owen <dsowen@…>
branch-nick:
unicode
parents:
RevTreeChgset
6@unicode,6[unicode,6]
5.1.1@unicode,5.1.1[unicode,5.1.1]
revision id:
dsowen@fugue88.ws-20080220053035-zvmt9xh4jzwaqj2i
Message:

Merged from vendor.

Location:
unicode
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • unicode/doc/documentation.html

    r5 r5.1.1  
    1616    <p>
    1717      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">
    1919        ODBC documentation from Microsoft</a>.
    2020    </p>
  • unicode/doc/notes.html

    r5 r5.1.1  
    281281The decimal expansion of 1/7 is periodic, so the digits 0.285 are correct. Thus
    282282MySQL uses the precision of double, but does not return all digits.
    283 
     283<p>
     284
     285<h3>The SQL Parser</h3>
     286The <tt>/* ..*/</tt> comments do not have to be closed:
     287<pre>
     28819]> (exec-query *con3* "select 1 as a /*bla")
     289
     290((1)) ;
     291("a")
     292</pre>
     293Maybe this depends on the version of MySQL or some system parameter.
     294</p>
    284295<h3>Parameters</h3>
    285296<p>
  • unicode/src/odbc/odbc-ff-interface.lisp

    r3 r5.1.1  
    313313     year)))
    314314
    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  
    467467;; this functions works only, since we store at value-ptr the position
    468468;; of the parameter
    469 ;; dso--
    470469(defun sql-param-data-position (hstmt)
    471470  (with-temporary-allocations
     
    474473                   (%sql-param-data hstmt ptr))))
    475474      (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
    479478
    480479(defmethod exec-prepared-query ((query prepared-statement) &rest parameters)
  • unicode/src/odbc/parameter.lisp

    r3 r5.1.1  
    305305
    306306
     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
    307327;;;-----------------------
    308328;;;    clob parameter
     
    315335
    316336(defclass clob-parameter (lob-parameter) ())
    317 
    318337
    319338(defmethod initialize-parameter ((param clob-parameter) args)
     
    325344    ;; the value-ptr will be needed to find the parameter, 
    326345    ;; 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))))
    329348
    330349(defmethod set-parameter-value ((param clob-parameter) value)
     
    375394    ;; the value-ptr will be needed to find the parameter, 
    376395    ;; 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))))
    379398
    380399(defmethod set-parameter-value ((param uclob-parameter) value)
     
    384403    (progn
    385404      (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)
    387406              (slot-value param 'position))
    388407      (setf (cffi:mem-ref (slot-value param 'ind-ptr) 'sql-len)
     
    424443    ;; the value-ptr will be needed to find the parameter,
    425444    ;; 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)))
    428447)
    429448
  • unicode/src/test/test-mysql.lisp

    r5 r5.1.1  
    4040
    4141create table type_test
    42 (id int,
     42 (id int,
    4343t_TINYINT TINYINT,
    4444t_SMALLINT  SMALLINT,
     
    9999  --t_LONGBLOB longblob,
    100100  --t_LONGTEXT = lpad('a',33000,'x')
     101*/
    101102  where id =1
    102103")
  • unicode/src/test/test-oracle.lisp

    r6 r7  
    144144                                '(:string :in)
    145145                                '(:string :out))))
    146     (let ((str "lölkÀlkÀölkÀlhjajhgfsjgakjhgfjfjhgffdtrtreztr"))
     146    (let ((str "lolkalkxylkzlhjajhgfsjgakjhgfjfjhgffdtrtreztr"))
    147147      (assert (equal str (first (exec-prepared-command stm str))))
    148148      (free-statement stm)))
  • unicode/src/test/test-sql-server.lisp

    r6 r7  
    245245                            '(:string :in)
    246246                            '(:unicode-string :in))
    247     (let* ((strings '("hjgkhgkzt65646&%2" "nnvfdsfsfz6tztß0#="))
     247    (let* ((strings '("hjgkhgkzt65646&%2" "nnvfdsfsfz6tztB0#="))
    248248           (res (exec-prepared-query stm (first strings) (second strings))))
    249249      (assert (equal res (list strings))))))
Note: See TracChangeset for help on using the changeset viewer.