r8936: merged classic-tests into tests
[clsql.git] / db-mysql / mysql-client-info.lisp
1 ;;;; -*- Mode: LISP; Syntax: ANSI-Common-Lisp; Base: 10 -*-
2 ;;;; *************************************************************************
3 ;;;; FILE IDENTIFICATION
4 ;;;;
5 ;;;; Name:          mysql-client-info.lisp
6 ;;;; Purpose:       Check mysql client version
7 ;;;; Programmer:    Kevin M. Rosenberg
8 ;;;; Date Started:  April 2004
9 ;;;;
10 ;;;; $Id$
11 ;;;;
12 ;;;; This file, part of CLSQL, is Copyright (c) 2002 by Kevin M. Rosenberg
13 ;;;; and Copyright (c) 1999-2001 by Pierre R. Mai
14 ;;;;
15 ;;;; CLSQL users are granted the rights to distribute and use this software
16 ;;;; as governed by the terms of the Lisp Lesser GNU Public License
17 ;;;; (http://opensource.franz.com/preamble.html), also known as the LLGPL.
18 ;;;; *************************************************************************
19
20 (in-package #:mysql)
21
22 (declaim (inline mysql-get-client-info))
23
24 (eval-when (:compile-toplevel :load-toplevel :execute)
25   (uffi:def-function "mysql_get_client_info"
26       ()
27     :module "mysql"
28     :returning :cstring)
29
30   (let ((version (uffi:convert-from-cstring (mysql-get-client-info))))
31     (cond
32       ((eql (schar version 0) #\3)
33        (pushnew :mysql-client-v3 cl:*features*))
34       ((eql (schar version 0) #\4)
35        (pushnew :mysql-client-v4 cl:*features*))
36       (t
37        (error "Unknown mysql client version '~A'." version)))))
38
39 ;;#-(or :mysql-client-v3 :mysql-client-v4)
40 ;;(eval-when (:compile-toplevel :load-toplevel :execute)
41 ;;  (pushnew :mysql-client-v3 cl:*features*))
42