projects
/
clsql.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
r11060: fix loop error on clisp. RESULT-SET should be T at start of loop to avoid...
[clsql.git]
/
db-mysql
/
mysql-api.lisp
diff --git
a/db-mysql/mysql-api.lisp
b/db-mysql/mysql-api.lisp
index 31828ca296dd99449ddf35ab19371e36bda7edbb..026bde07744211ace6735979ac06b812203152d7 100644
(file)
--- a/
db-mysql/mysql-api.lisp
+++ b/
db-mysql/mysql-api.lisp
@@
-4,8
+4,8
@@
;;;;
;;;; Name: mysql-api.lisp
;;;; Purpose: Low-level MySQL interface using UFFI
;;;;
;;;; Name: mysql-api.lisp
;;;; Purpose: Low-level MySQL interface using UFFI
-;;;; Programmers: Kevin M. Rosenberg based on
-;;;; Original code by Pierre R. Mai
+;;;; Programmers: Kevin M. Rosenberg based on
+;;;; Original code by Pierre R. Mai
;;;; Date Started: Feb 2002
;;;;
;;;; $Id$
;;;; Date Started: Feb 2002
;;;;
;;;; $Id$
@@
-27,7
+27,7
@@
;;;; that are used in a few routines.
;;;; - Removed all references to interiors of C-structions, this will
;;;; increase robustness when MySQL's internal structures change.
;;;; that are used in a few routines.
;;;; - Removed all references to interiors of C-structions, this will
;;;; increase robustness when MySQL's internal structures change.
-
+
;;;; Type definitions
;;; Basic Types
;;;; Type definitions
;;; Basic Types
@@
-132,10
+132,10
@@
(decimals :unsigned-int)
(type mysql-field-types))
(decimals :unsigned-int)
(type mysql-field-types))
-#+
mysql-client-v4.1
+#+
(or mysql-client-v4.1 mysql-client-v5)
(uffi:def-struct mysql-field
(name (* :char))
(uffi:def-struct mysql-field
(name (* :char))
- (org_
tabl
e (* :char))
+ (org_
nam
e (* :char))
(table (* :char))
(org_table (* :char))
(db (* :char))
(table (* :char))
(org_table (* :char))
(db (* :char))
@@
-155,6
+155,18
@@
(charsetnr :unsigned-int)
(type mysql-field-types))
(charsetnr :unsigned-int)
(type mysql-field-types))
+
+(uffi:def-struct mysql-time
+ (year :unsigned-int)
+ (month :unsigned-int)
+ (day :unsigned-int)
+ (hour :unsigned-int)
+ (minute :unsigned-int)
+ (second :unsigned-int)
+ (second-part :unsigned-long)
+ (neg mysql-bool)
+ (time-type :int))
+
;;; MYSQL-ROWS
(uffi:def-array-pointer mysql-row (* :unsigned-char))
;;; MYSQL-ROWS
(uffi:def-array-pointer mysql-row (* :unsigned-char))
@@
-208,7
+220,7
@@
:read-default-group))
(uffi:def-enum mysql-status
:read-default-group))
(uffi:def-enum mysql-status
- (:ready
+ (:ready
:get-result
:use-result))
:get-result
:use-result))
@@
-264,13
+276,13
@@
(handle (:struct-pointer mysql-mysql))
(eof mysql-bool))
(handle (:struct-pointer mysql-mysql))
(eof mysql-bool))
-#+
mysql-client-4.1
+#+
(or mysql-client-v4.1 mysql-client-v5)
(uffi:def-enum mysql-field-types
(uffi:def-enum mysql-field-types
- (:ready
+ (:ready
:get-result
:use-result))
:get-result
:use-result))
-#+
mysql-client-v4.1
+#+
(or mysql-client-v4.1 mysql-client-v5)
(uffi:def-struct mysql-bind
(length (* :unsigned-long))
(is-null (* mysql-bool))
(uffi:def-struct mysql-bind
(length (* :unsigned-long))
(is-null (* mysql-bool))
@@
-294,7
+306,7
@@
(declaim (inline mysql-init))
(uffi:def-function "mysql_init"
((mysql (* mysql-mysql)))
(declaim (inline mysql-init))
(uffi:def-function "mysql_init"
((mysql (* mysql-mysql)))
- :module "mysql"
+ :module "mysql"
:returning (* mysql-mysql))
#-mysql-client-v4
:returning (* mysql-mysql))
#-mysql-client-v4
@@
-529,8
+541,8
@@
(declaim (inline mysql-escape-string))
(uffi:def-function "mysql_escape_string"
(declaim (inline mysql-escape-string))
(uffi:def-function "mysql_escape_string"
- ((to
:cstring
)
- (from
:cstring
)
+ ((to
(* :unsigned-char)
)
+ (from
(* :unsigned-char)
)
(length :unsigned-int))
:module "mysql"
:returning :unsigned-int)
(length :unsigned-int))
:module "mysql"
:returning :unsigned-int)
@@
-548,16
+560,16
@@
:module "clsql-mysql"
:returning :unsigned-int)
:module "clsql-mysql"
:returning :unsigned-int)
-#+
mysql-client-v4.1
+#+
(or mysql-client-v4.1 mysql-client-v5)
(uffi:def-foreign-type mysql-stmt-ptr :pointer-void)
(uffi:def-foreign-type mysql-stmt-ptr :pointer-void)
-#+
mysql-client-v4.1
+#+
(or mysql-client-v4.1 mysql-client-v5)
(uffi:def-function "mysql_stmt_init"
((res (* mysql-mysql-res)))
:module "clsql-mysql"
:returning mysql-stmt-ptr)
(uffi:def-function "mysql_stmt_init"
((res (* mysql-mysql-res)))
:module "clsql-mysql"
:returning mysql-stmt-ptr)
-#+
mysql-client-v4.1
+#+
(or mysql-client-v4.1 mysql-client-v5)
(uffi:def-function "mysql_stmt_prepare"
((stmt mysql-stmt-ptr)
(query :cstring)
(uffi:def-function "mysql_stmt_prepare"
((stmt mysql-stmt-ptr)
(query :cstring)
@@
-565,64
+577,70
@@
:module "clsql-mysql"
:returning :int)
:module "clsql-mysql"
:returning :int)
-#+
mysql-client-v4.1
+#+
(or mysql-client-v4.1 mysql-client-v5)
(uffi:def-function "mysql_stmt_param_count"
((stmt mysql-stmt-ptr))
:module "clsql-mysql"
:returning :unsigned-int)
(uffi:def-function "mysql_stmt_param_count"
((stmt mysql-stmt-ptr))
:module "clsql-mysql"
:returning :unsigned-int)
-#+
mysql-client-v4.1
+#+
(or mysql-client-v4.1 mysql-client-v5)
(uffi:def-function "mysql_stmt_bind_param"
((stmt mysql-stmt-ptr)
(bind (* mysql-bind)))
:module "clsql-mysql"
:returning :short)
(uffi:def-function "mysql_stmt_bind_param"
((stmt mysql-stmt-ptr)
(bind (* mysql-bind)))
:module "clsql-mysql"
:returning :short)
-#+
mysql-client-v4.1
+#+
(or mysql-client-v4.1 mysql-client-v5)
(uffi:def-function "mysql_stmt_bind_result"
((stmt mysql-stmt-ptr)
(bind (* mysql-bind)))
:module "clsql-mysql"
:returning :short)
(uffi:def-function "mysql_stmt_bind_result"
((stmt mysql-stmt-ptr)
(bind (* mysql-bind)))
:module "clsql-mysql"
:returning :short)
-#+
mysql-client-v4.1
+#+
(or mysql-client-v4.1 mysql-client-v5)
(uffi:def-function "mysql_stmt_result_metadata"
((stmt mysql-stmt-ptr))
:module "clsql-mysql"
:returning (* mysql-mysql-res))
(uffi:def-function "mysql_stmt_result_metadata"
((stmt mysql-stmt-ptr))
:module "clsql-mysql"
:returning (* mysql-mysql-res))
-#+
mysql-client-v4.1
+#+
(or mysql-client-v4.1 mysql-client-v5)
(uffi:def-function "mysql_stmt_execute"
((stmt mysql-stmt-ptr))
:module "clsql-mysql"
:returning :int)
(uffi:def-function "mysql_stmt_execute"
((stmt mysql-stmt-ptr))
:module "clsql-mysql"
:returning :int)
-#+mysql-client-v4.1
+#+(or mysql-client-v4.1 mysql-client-v5)
+(uffi:def-function "mysql_stmt_store_result"
+ ((stmt mysql-stmt-ptr))
+ :module "clsql-mysql"
+ :returning :int)
+
+#+(or mysql-client-v4.1 mysql-client-v5)
(uffi:def-function "mysql_stmt_fetch"
((stmt mysql-stmt-ptr))
:module "clsql-mysql"
:returning :int)
(uffi:def-function "mysql_stmt_fetch"
((stmt mysql-stmt-ptr))
:module "clsql-mysql"
:returning :int)
-#+
mysql-client-v4.1
+#+
(or mysql-client-v4.1 mysql-client-v5)
(uffi:def-function "mysql_stmt_free_result"
((stmt mysql-stmt-ptr))
:module "clsql-mysql"
:returning :short)
(uffi:def-function "mysql_stmt_free_result"
((stmt mysql-stmt-ptr))
:module "clsql-mysql"
:returning :short)
-#+
mysql-client-v4.1
+#+
(or mysql-client-v4.1 mysql-client-v5)
(uffi:def-function "mysql_stmt_close"
((stmt mysql-stmt-ptr))
:module "clsql-mysql"
:returning :short)
(uffi:def-function "mysql_stmt_close"
((stmt mysql-stmt-ptr))
:module "clsql-mysql"
:returning :short)
-#+
mysql-client-v4.1
+#+
(or mysql-client-v4.1 mysql-client-v5)
(uffi:def-function "mysql_stmt_errno"
((stmt mysql-stmt-ptr))
:module "clsql-mysql"
:returning :unsigned-int)
(uffi:def-function "mysql_stmt_errno"
((stmt mysql-stmt-ptr))
:module "clsql-mysql"
:returning :unsigned-int)
-#+
mysql-client-v4.1
+#+
(or mysql-client-v4.1 mysql-client-v5)
(uffi:def-function "mysql_stmt_error"
((stmt mysql-stmt-ptr))
:module "clsql-mysql"
(uffi:def-function "mysql_stmt_error"
((stmt mysql-stmt-ptr))
:module "clsql-mysql"
@@
-672,11
+690,11
@@
(declaim (inline mysql-num-fields))
(declaim (inline mysql-num-fields))
-(uffi:def-function "mysql_num_fields"
+(uffi:def-function "mysql_num_fields"
((res (* mysql-mysql-res)))
:returning :unsigned-int
:module "mysql")
((res (* mysql-mysql-res)))
:returning :unsigned-int
:module "mysql")
-
+
(declaim (inline clsql-mysql-eof))
(uffi:def-function ("mysql_eof" clsql-mysql-eof)
((res (* mysql-mysql-res)))
(declaim (inline clsql-mysql-eof))
(uffi:def-function ("mysql_eof" clsql-mysql-eof)
((res (* mysql-mysql-res)))