X-Git-Url: http://git.kpe.io/?a=blobdiff_plain;f=db-mysql%2Fmysql-client-info.lisp;h=4124e0be0ba64e56ad93c0ef146dd70890b96304;hb=9d6ec50020109467ff766ad753a4194ee756b1b9;hp=5cb8d0e26a912a5b97320267e4755e7c7016f3fc;hpb=23b76563b25a517ad20f29d6dc5a65c8b958a042;p=clsql.git diff --git a/db-mysql/mysql-client-info.lisp b/db-mysql/mysql-client-info.lisp index 5cb8d0e..4124e0b 100644 --- a/db-mysql/mysql-client-info.lisp +++ b/db-mysql/mysql-client-info.lisp @@ -9,8 +9,7 @@ ;;;; ;;;; $Id$ ;;;; -;;;; 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) 2004 by Kevin M. Rosenberg ;;;; ;;;; CLSQL users are granted the rights to distribute and use this software ;;;; as governed by the terms of the Lisp Lesser GNU Public License @@ -24,18 +23,26 @@ (defvar *mysql-client-info* nil) (eval-when (:compile-toplevel :load-toplevel :execute) - (uffi:def-function "mysql_get_client_info" + (uffi:def-function ("mysql_get_client_info" mysql-get-client-info) () :module "mysql" :returning :cstring) (setf *mysql-client-info* (uffi:convert-from-cstring (mysql-get-client-info))) - - (cond - ((eql (schar *mysql-client-info* 0) #\3) - (pushnew :mysql-client-v3 cl:*features*)) - ((eql (schar *mysql-client-info* 0) #\4) - (pushnew :mysql-client-v4 cl:*features*)) - (t - (error "Unknown mysql client version '~A'." *mysql-client-info*)))) + + + (when (and (stringp *mysql-client-info*) + (plusp (length *mysql-client-info*))) + (cond + ((eql (schar *mysql-client-info* 0) #\3) + (pushnew :mysql-client-v3 cl:*features*)) + ((eql (schar *mysql-client-info* 0) #\4) + (pushnew :mysql-client-v4 cl:*features*) + (when (and (>= (length *mysql-client-info*) 3) + (string-equal "4.1" *mysql-client-info* :end2 3)) + (pushnew :mysql-client-v4.1 cl:*features*))) + ((eql (schar *mysql-client-info* 0) #\5) + (pushnew :mysql-client-v5 cl:*features*)) + (t + (error "Unknown mysql client version '~A'." *mysql-client-info*)))))