r7061: initial property settings
[clsql.git] / db-mysql / mysql-api.lisp
index 6842f8b2aaad031988a304e5bbc437a4b8f45469..d49a0894d943f292722219f124b57f00aa8a38c0 100644 (file)
@@ -2,13 +2,13 @@
 ;;;; *************************************************************************
 ;;;; FILE IDENTIFICATION
 ;;;;
-;;;; Name:          mysql.cl
+;;;; Name:          mysql-api.lisp
 ;;;; Purpose:       Low-level MySQL interface using UFFI
 ;;;; Programmers:   Kevin M. Rosenberg based on 
 ;;;;                Original code by Pierre R. Mai 
 ;;;; Date Started:  Feb 2002
 ;;;;
-;;;; $Id: mysql-api.lisp,v 1.1 2002/09/30 10:19:23 kevin Exp $
+;;;; $Id$
 ;;;;
 ;;;; This file, part of CLSQL, is Copyright (c) 2002 by Kevin M. Rosenberg
 ;;;; and Copyright (c) 1999-2001 by Pierre R. Mai
@@ -18,9 +18,7 @@
 ;;;; (http://opensource.franz.com/preamble.html), also known as the LLGPL.
 ;;;; *************************************************************************
 
-(declaim (optimize (debug 3) (speed 3) (safety 1) (compilation-speed 0)))
-
-(in-package :mysql)
+(in-package #:mysql)
 
 ;;;; Modifications from original code
 ;;;;  - Updated C-structures to conform to structures in MySQL 3.23.46
      (:blob 252)
      (:var-string 253)
      (:string 254)))
-  
+
+#-(or mysql-client-v3 mysql-client-v4)
+(eval-when (:compile-toplevel :load-toplevel :execute)
+  (pushnew :mysql-client-v3 cl:*features*))
+
+#+mysql-client-v3
 (uffi:def-struct mysql-field
     (name (* :char))
   (table (* :char))
   (flags :unsigned-int)
   (decimals :unsigned-int))
 
+;; structure changed in mysql 4 client
+#+mysql-client-v4
+(uffi:def-struct mysql-field
+    (name (* :char))
+  (table (* :char))
+  (org_table (* :char))
+  (db (* :char))
+  (def (* :char))
+  (length :unsigned-int)
+  (max-length :unsigned-int)
+  (flags :unsigned-int)
+  (decimals :unsigned-int)
+  (type mysql-field-types))
+
 ;;; MYSQL-ROWS
 
 (uffi:def-array-pointer mysql-row (* :unsigned-char))