projects
/
clsql.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
r1670: updated mysql to handle :longlong field translation
[clsql.git]
/
interfaces
/
mysql
/
mysql-sql.cl
diff --git
a/interfaces/mysql/mysql-sql.cl
b/interfaces/mysql/mysql-sql.cl
index 32db9b64bac4131353610db423c632b55a8250d5..9d14dc888b6c4dd3df4186cbc359281f6b4439e0 100644
(file)
--- a/
interfaces/mysql/mysql-sql.cl
+++ b/
interfaces/mysql/mysql-sql.cl
@@
-8,7
+8,7
@@
;;;; Original code by Pierre R. Mai
;;;; Date Started: Feb 2002
;;;;
;;;; Original code by Pierre R. Mai
;;;; Date Started: Feb 2002
;;;;
-;;;; $Id: mysql-sql.cl,v 1.1
1 2002/03/27 00:25:03
kevin Exp $
+;;;; $Id: mysql-sql.cl,v 1.1
3 2002/03/27 05:37:35
kevin Exp $
;;;;
;;;; This file, part of CLSQL, is Copyright (c) 2002 by Kevin M. Rosenberg
;;;; and Copyright (c) 1999-2001 by Pierre R. Mai
;;;;
;;;; This file, part of CLSQL, is Copyright (c) 2002 by Kevin M. Rosenberg
;;;; and Copyright (c) 1999-2001 by Pierre R. Mai
@@
-73,6
+73,8
@@
#.mysql-field-types#int24
#.mysql-field-types#long)
:int)
#.mysql-field-types#int24
#.mysql-field-types#long)
:int)
+ (#.mysql-field-types#longlong
+ :longlong)
((#.mysql-field-types#double
#.mysql-field-types#float
#.mysql-field-types#decimal)
((#.mysql-field-types#double
#.mysql-field-types#float
#.mysql-field-types#decimal)
@@
-92,6
+94,11
@@
((str (* :unsigned-char)))
:returning :long)
((str (* :unsigned-char)))
:returning :long)
+(uffi:def-function "atol64"
+ ((str (* :unsigned-char))
+ (high32 (* :int)))
+ :returning :int)
+
(uffi:def-function "atof"
((str (* :unsigned-char)))
:returning :double)
(uffi:def-function "atof"
((str (* :unsigned-char)))
:returning :double)
@@
-107,6
+114,13
@@
(atol char-ptr))
(:double
(atof char-ptr))
(atol char-ptr))
(:double
(atof char-ptr))
+ (:longlong
+ (uffi:with-foreign-object (high32-ptr :int)
+ (let ((low32 (atol64 char-ptr high32-ptr))
+ (high32 (uffi:deref-pointer high32-ptr :int)))
+ (if (zerop high32)
+ low32
+ (mysql:make-64-bit-integer high32 low32)))))
(otherwise
(uffi:convert-from-foreign-string char-ptr)))))
(otherwise
(uffi:convert-from-foreign-string char-ptr)))))
@@
-187,8
+201,9
@@
collect
(loop for i from 0 below num-fields
collect
collect
(loop for i from 0 below num-fields
collect
- (uffi:convert-from-foreign-string
- (uffi:deref-array row 'mysql-row i))))
+ (convert-raw-field
+ (uffi:deref-array row 'mysql-row i)
+ types i)))
(mysql-free-result res-ptr)))
(error 'clsql-sql-error
:database database
(mysql-free-result res-ptr)))
(error 'clsql-sql-error
:database database