X-Git-Url: http://git.kpe.io/?a=blobdiff_plain;ds=sidebyside;f=db-mysql%2Fmysql-api.lisp;h=96d904c70900954e1b04548100b501d5d1159ac5;hb=fa8bab0b07d9aa9f1c546920971f41252434e285;hp=7170fda066b72a29f480c80e0dc04422eecb5c1f;hpb=43ec897ec7d84892fa59cc9b7858ce23d64a8a1a;p=clsql.git diff --git a/db-mysql/mysql-api.lisp b/db-mysql/mysql-api.lisp index 7170fda..96d904c 100644 --- a/db-mysql/mysql-api.lisp +++ b/db-mysql/mysql-api.lisp @@ -118,17 +118,40 @@ (decimals :unsigned-int)) ;; structure changed in mysql 4 client -#+mysql-client-v4 +#+(and mysql-client-v4 (not mysql-client-v4.1)) (uffi:def-struct mysql-field (name (* :char)) (table (* :char)) (org_table (* :char)) (db (* :char)) (def (* :char)) - (length :unsigned-int) - (max-length :unsigned-int) + (length :unsigned-long) + (max-length :unsigned-long) + (flags :unsigned-int) + (decimals :unsigned-int) + (type mysql-field-types)) + +#+mysql-client-v4.1 +(uffi:def-struct mysql-field + (name (* :char)) + (org_table (* :char)) + (table (* :char)) + (org_table (* :char)) + (db (* :char)) + (catalog_db (* :char)) + (def (* :char)) + (length :unsigned-long) + (max-length :unsigned-long) + (name-length :unsigned-int) + (org-name-length :unsigned-int) + (table-length :unsigned-int) + (org-table-length :unsigned-int) + (db-length :unsigned-int) + (catalog-length :unsigned-int) + (def-length :unsigned-int) (flags :unsigned-int) (decimals :unsigned-int) + (charsetnr :unsigned-int) (type mysql-field-types)) ;;; MYSQL-ROWS @@ -240,6 +263,16 @@ (handle (:struct-pointer mysql-mysql)) (eof mysql-bool)) +#+mysql-client-v4.1 +(uffi:def-struct mysql-bind + (length (* :unsigned-long)) + (is-null (* :short)) + (buffer :pointer-void) + (buffer-type :int) + (buffer-length :unsigned-long) + ;; remainder of structure is for internal use + ) + ;;;; The Foreign C routines (declaim (inline mysql-init)) (uffi:def-function "mysql_init" @@ -269,7 +302,7 @@ (db :cstring) (port :unsigned-int) (unix-socket :cstring) - (clientflag :unsigned-int)) + (clientflag :unsigned-long)) :module "mysql" :returning (* mysql-mysql)) @@ -498,6 +531,46 @@ :module "clsql-mysql" :returning :unsigned-int) +#+mysql-client-v4.1 +(uffi:def-foreign-type mysql-stmt-ptr :pointer-void) + +#+mysql-client-v4.1 +(uffi:def-function "mysql_stmt_init" + ((res (* mysql-mysql-res))) + :module "clsql-mysql" + :returning mysql-stmt-ptr) + +#+mysql-client-v4.1 +(uffi:def-function "mysql_stmt_bind_param" + ((stmt mysql-stmt-ptr) + (bind (* mysql-bind))) + :module "clsql-mysql" + :returning :short) + +#+mysql-client-v4.1 +(uffi:def-function "mysql_stmt_bind_result" + ((stmt mysql-stmt-ptr) + (bind (* mysql-bind))) + :module "clsql-mysql" + :returning :short) + +#+mysql-client-v4.1 +(uffi:def-function "mysql_stmt_execute" + ((stmt mysql-stmt-ptr)) + :module "clsql-mysql" + :returning :int) + +#+mysql-client-v4.1 +(uffi:def-function "mysql_stmt_fetch" + ((stmt mysql-stmt-ptr)) + :module "clsql-mysql" + :returning :int) + +#+mysql-client-v4.1 +(uffi:def-function "mysql_stmt_free_result" + ((stmt mysql-stmt-ptr)) + :module "clsql-mysql" + :returning :short) ;;;; Equivalents of C Macro definitions for accessing various fields ;;;; in the internal MySQL Datastructures @@ -593,7 +666,6 @@ :module "clsql-mysql" :returning :void) - (defun mysql-data-seek (res offset) (multiple-value-bind (high32 low32) (split-64-bit-integer offset) (clsql-mysql-data-seek res high32 low32)))